text:
import java.io.EOFException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.nio.file.Files;
import java.nio.file.Paths;

public class ReadSequentialFile {

	private static ObjectInputStream input;

	public static void main(String[] args) {
		openFile();
		readRecords();
		closeFile();
	}

	// enable user to select file to open
	public static void openFile() {
		try { // open file
			input = new ObjectInputStream(Files.newInputStream(Paths.get("clients.ser")));
		} catch (IOException ioException) {
			System.err.println("Error opening file.");
			System.exit(1);
		}
	}

	// read record from file
	public static void readRecords() {
		System.out.printf("%-10s%-12s%-12s%10s%n", "Account", "First Name", "Last Name", "Balance");

		try {
			while (true) { // loop until there is an EOFException
				Account record = (Account) input.readObject();

				// display record contents
				System.out.printf("%-10d%-12s%-12s%10.2f%n", record.getAccount(), record.getFirstName(),
						record.getLastName(), record.getBalance());
			}
		} catch (EOFException endOfFileException) {
			System.out.printf("%nNo more records%n");
		} catch (ClassNotFoundException classNotFoundException) {
			System.err.println("Invalid object type. Terminating.");
		} catch (IOException ioException) {
			System.err.println("Error reading from file. Terminating");
		}
	} // end method readRecords

	// close file and terminate application
	public static void closeFile() {
		try {
			if (input != null)
				input.close();
		} catch (IOException ioException) {
			System.err.println("Error closing file. Terminating.");
			System.exit(1);
		}
	}

} // end class ReadSequentialFile


text:
<?php

declare(strict_types=1);

namespace Sylius\Bundle\CoreBundle\Validator\Constraints;

use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Webmozart\Assert\Assert;

final class RegisteredUserValidator extends ConstraintValidator
{
    /** @var RepositoryInterface */
    private $customerRepository;

    public function __construct(RepositoryInterface $customerRepository)
    {
        $this->customerRepository = $customerRepository;
    }

    public function validate($customer, Constraint $constraint): void
    {
        /** @var CustomerInterface $customer */
        Assert::isInstanceOf($customer, CustomerInterface::class);

        /** @var RegisteredUser $constraint */
        Assert::isInstanceOf($constraint, RegisteredUser::class);

        /** @var CustomerInterface|null $existingCustomer */
        $existingCustomer = $this->customerRepository->findOneBy(['email' => $customer->getEmail()]);
        if (null !== $existingCustomer && null !== $existingCustomer->getUser()) {
            $this->context->buildViolation($constraint->message)->atPath('email')->addViolation();
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Rhubarb Upside-Down Cake « All Things Simple</title>
<link rel="stylesheet" type="text/css" href="http://s0.wp.com/wp-content/themes/pub/bueno/style.css?m=1309109431g" media="screen" />
<link rel="pingback" href="http://allthingssimpleblog.com/xmlrpc.php" />

<link href="http://s0.wp.com/wp-content/themes/pub/bueno/styles/default.css?m=1309109431g" rel="stylesheet" type="text/css" />

		<link rel="alternate" type="application/rss+xml" title="All Things Simple » Feed" href="http://allthingssimpleblog.com/feed/" />
<link rel="alternate" type="application/rss+xml" title="All Things Simple » Comments Feed" href="http://allthingssimpleblog.com/comments/feed/" />
<link rel="alternate" type="application/rss+xml" title="All Things Simple » Rhubarb Upside-Down Cake Comments Feed" href="http://allthingssimpleblog.com/2011/07/19/rhubarb-upside-down-cake-2/feed/" />

<link rel="stylesheet" href="http://s0.wp.com/wp-content/themes/h4/global.css?m=1309109352g" type="text/css" />
<link rel='stylesheet' id='sharedaddy-css'  href='http://s1.wp.com/wp-content/mu-plugins/post-react-1/sharing/sharing.css?m=1309109333g&ver=MU' type='text/css' media='all' />

<link rel='stylesheet' id='highlander-comments-css'  href='http://s2.wp.com/wp-content/mu-plugins/highlander-comments/style.css?m=1309455920g&ver=20110620' type='text/css' media='all' />

<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://lbrisbo.wordpress.com/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://lbrisbo.wordpress.com/wp-includes/wlwmanifest.xml" />
<link rel='index' title='All Things Simple' href='http://allthingssimpleblog.com/' />
<link rel='prev' title='Kitchen Adventures: Homemade Dog Treats' href='http://allthingssimpleblog.com/2011/07/14/kitchen-adventures-homemade-dog-treats/' />
<meta name="generator" content="WordPress.com" />
<link rel='canonical' href='http://allthingssimpleblog.com/2011/07/19/rhubarb-upside-down-cake-2/' />
<link rel='shortlink' href='http://wp.me/pTNgr-kA' />
<link rel="alternate" type="application/json+oembed" href="http://public-api.wordpress.com/oembed/1.0/?format=json&url=http%3A%2F%2Fallthingssimpleblog.com%2F2011%2F07%2F19%2Frhubarb-upside-down-cake-2%2F&for=wpcom-auto-discovery" /><link rel="alternate" type="application/xml+oembed" href="http://public-api.wordpress.com/oembed/1.0/?format=xml&url=http%3A%2F%2Fallthingssimpleblog.com%2F2011%2F07%2F19%2Frhubarb-upside-down-cake-2%2F&for=wpcom-auto-discovery" /><link rel="shortcut icon" type="image/x-icon" href="http://s1.wp.com/i/favicon-stacked.ico?m=1309109303g" sizes="16x16 24x24 32x32 48x48" />
<link rel="icon" type="image/x-icon" href="http://s1.wp.com/i/favicon-stacked.ico?m=1309109303g" sizes="16x16 24x24 32x32 48x48" />
<link rel="apple-touch-icon" href="http://s0.wp.com/wp-content/themes/h4/i/webclip.png?m=1309109351g" />
<link rel='openid.server' href='http://lbrisbo.wordpress.com/?openidserver=1' />
<link rel='openid.delegate' href='http://lbrisbo.wordpress.com/' />
<link rel="search" type="application/opensearchdescription+xml" href="http://allthingssimpleblog.com/osd.xml" title="All Things Simple" />
<link rel="search" type="application/opensearchdescription+xml" href="http://wordpress.com/opensearch.xml" title="WordPress.com" />

	<meta name="application-name" content="All Things Simple" /><meta name="msapplication-window" content="width=device-width;height=device-height" /><meta name="msapplication-task" content="name=Subscribe;action-uri=http://allthingssimpleblog.com/feed/;icon-uri=http://s1.wp.com/i/favicon-stacked.ico" /><meta name="msapplication-task" content="name=Sign up for a free blog;action-uri=http://wordpress.com/signup/;icon-uri=http://s2.wp.com/i/favicon.ico" /><meta name="msapplication-task" content="name=WordPress.com Support;action-uri=http://support.wordpress.com/;icon-uri=http://s2.wp.com/i/favicon.ico" /><meta name="msapplication-task" content="name=WordPress.com Forums;action-uri=http://forums.wordpress.com/;icon-uri=http://s2.wp.com/i/favicon.ico" />

	<link rel="stylesheet" type="text/css" href="http://s0.wp.com/?custom-css=1&csblog=TNgr&cscache=5&csrev=92" />

Search

    <form method="get" id="searchform" action="http://allthingssimpleblog.com">
        <input type="text" class="field" name="s" id="s"  value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}" />
        <input type="submit" class="submit" name="submit" value="Search" />
    </form>

	      		      		All Things Simple

Home

About

Recipes

RSS

Rhubarb Upside-Down Cake

                    	19
                    	Jul

I really love the taste of rhubarb, but I just haven’t been able to break away from my trusty rhubarb crisp routine. So when I happened upon this recipe for rhubarb upside-down cake, I just had to try it. This cake is really something special. The sour cream makes the batter so moist, and the orange zest adds an extra layer of flavor. But make no mistake–the rhubarb is still the star of the show.

Rhubarb comes in all shapes, sizes, and colors. Because of this, no two rhubarb upside-down cakes will come out looking the same. If symmetry and predictability is your thing, this may not be the recipe for you. You can try to position the rhubarb just perfectly, but when it cooks, chances are it will shift around a bit. There is something beautifully imperfect about this cake–just go with it!

The original recipe is from Martha Stewart, but I felt like there were a couple crucial steps left out of the written directions. Hopefully my additions help! Also, a quick note. I understand that some upside-down cakes can be made in a spring form pan. Unfortunately, a lot of liquid is released from the rhubarb when it is cooked, which may leak through the spring form and start a small fire in your oven. I may or may not know this from personal experience…

Rhubarb Upside-Down Cake

Adapted from Martha Stewart

Yield: 10 servings

For The Topping

4 tablespoons unsalted butter, melted

1/2 cup all-purpose flour

1/4 cup sugar

Coarse salt

For The Cake

1 1/2 sticks unsalted butter, room temperature, plus more for buttering pan

1 pound rhubarb, trimmed and cut on a very sharp diagonal about 1/2 inch thick

1 3/4 cups sugar

1 1/2 cups all-purpose flour

1 1/2 teaspoons baking powder

Coarse salt

1/2 teaspoon finely grated orange zest plus 1 tablespoon fresh orange juice

2 large eggs

1 cup sour cream

Preheat oven to 350 degrees. Make the topping: Stir together butter, flour, sugar, and 1/4 teaspoon salt until moist and crumbly. Set aside in refrigerator until ready to use.

Make the cake: Butter a 9-inch round cake pan (2 inches deep). Dot with 4 tablespoons butter (cut into pieces). Toss rhubarb with 3/4 cup sugar; let stand for 2 minutes. Toss again, and spread in pan with red side of the rhubarb facing down so it will show when the cake is flipped.

Whisk together flour, baking powder, and 1 1/2 teaspoons salt. Set flour mixture aside.

Beat remaining stick butter and cup sugar with a mixer on medium speed until pale and fluffy. Beat in orange zest and juice. Beat in eggs, 1 at a time, until incorporated, scraping down sides of bowl. Beat in flour mixture in 3 additions, alternating with sour cream, until smooth. Spread evenly over rhubarb. Crumble topping evenly over batter.

Bake until a toothpick inserted into the center comes out clean and top springs back when touched, about 1 hour. Let cool for 10 minutes. Run a knife around edge of cake, and invert onto a wire rack. Let cool completely.

Let the cake cool for 10 minutes before removing it from the pan. The rhubarb will be too hot to handle safely right after baking. But if the cake sits much longer, it may stick.

The rhubarb I picked up from the farmers market was adorably small, so I had to pull quite a few stalks to make a pound.

I chose the reddest rhubarb at the market, but this is just an aesthetic preference–greener rhubarb will taste just as good.

Dot the butter in the pan and wedge in the rhubarb. If there is sugar left at the bottom of the bowl, sprinkle it on top of the rhubarb.

The batter will be a little thick, so gently smooth it over the rhubarb with a spatula.

The crumb “topping” will become the bottom of the cake once it is flipped.

Ta-da! Rhubarb upside-down cake in all its glory.

Share this:

Facebook

Email

Tags: Dessert, Martha Stewart, Rhubarb, Upside-Down Cake

                    			Comments
                    			4 Comments

                    			Categories
                    			Recipes

                    			Author
                    			Lauren B.

← Kitchen Adventures: Homemade Dog Treats

Like

Be the first to like this post.

4 Responses to “Rhubarb Upside-Down Cake”

	        	tzirelchana

	        		July 19, 2011 at 11:52 pm

	        		#

this sounds amazing. I can only get frozen rhubarb but I may try it.

	            	Reply

	        	Lauren B.

	        		July 20, 2011 at 8:42 am

	        		#

I think defrosted, frozen rhubarb would work wonderfully in this cake. Enjoy!

	            	Reply

	        	Alice

	        		July 21, 2011 at 12:42 pm

	        		#

You should try this again with the caramel topping I made on my nectarine upside down cake (recipe on my blog of course), I think it could be pretty tasty for you, and it will help you to lay the rhubarb in a pattern that holds  – if you would like of course, but this sounds pretty good too!

	            	Reply

	        	Lauren B.

	        		July 21, 2011 at 2:31 pm

	        		#

Thanks for the tip, Alice! Your nectarine upside-down cake looks beautiful. I think you are right–if you omit the sugar in the rhubarb and use your caramel instead, the rhubarb would set a little better. What a great idea! I will definitely give this a try next time I make this cake.

	            	Reply

Leave a Reply Cancel reply

									<form action="http://allthingssimpleblog.com/wp-comments-post.php" method="post" id="commentform">

<input type="hidden" name="hc_post_as" id="hc_post_as" value="guest" />

	Enter your comment here...

<textarea id="comment" name="comment"></textarea>

Guest

Log In

Log In

Log In

					Email (required) (Not published)

<input id="email" name="email" type="text" value="" />

					Name (required)

<input id="author" name="author" type="text" value="" />

					Website

<input id="url" name="url" type="text" value="" />

Please log in to WordPress.com to post a comment to your blog.

				<input type="hidden" name="twitter_avatar" id="twitter-avatar" class="comment-meta-twitter" value="" />
				<input type="hidden" name="twitter_user_id" id="twitter-user_id" class="comment-meta-twitter" value="" />
				<input type="hidden" name="twitter_access_token" id="twitter-access_token" class="comment-meta-twitter" value="" />

 You are commenting using your Twitter account. (Log Out)

				<input type="hidden" name="fb_avatar" id="facebook-avatar" class="comment-meta-facebook" value="" />
				<input type="hidden" name="fb_user_id" id="facebook-user_id" class="comment-meta-facebook" value="" />
				<input type="hidden" name="fb_access_token" id="facebook-access_token" class="comment-meta-facebook" value="" />

 You are commenting using your Facebook account. (Log Out)

Connecting to %s

<input type="checkbox" name="subscribe" id="subscribe" value="subscribe" style="width: auto;" tabindex="6"/> Notify me of follow-up comments via email.

							<input name="submit" type="submit" id="comment-submit" value="Post Comment" />
							<input type='hidden' name='comment_post_ID' value='1276' id='comment_post_ID' />
<input type='hidden' name='comment_parent' id='comment_parent' value='0' />

<input type="hidden" name="genseq" value="1311307093" />

<input type="hidden" id="akismet_comment_nonce" name="akismet_comment_nonce" value="5944935f1f" />

<input type="hidden" id="ak_js" name="ak_js" value="61"/>
					</form>

My Tweets

@onefinedae Me too Linda, me too. Just holding out for tomorrow when there is allegedly supposed to be sun! 9 hours ago

Interesting article about cold-brewing coffee and tea: http://nyti.ms/r31ACg 1 day ago

@Michelle_Heng thanks for the RT! Hope you have a chance to try it! 1 day ago

Love this homemade cheese kit--mozzarella, ricotta, goat cheese, paneer, and queso blanco. Yes, please! http://t.co/3V8Rm2K 1 day ago

Latest Happenings

Rhubarb Upside-Down Cake

Kitchen Adventures: Homemade Dog Treats

Cold-Brewed Iced Coffee

Morel and Spring Pea Pasta

Sweet and Salty Bacon Jam

Archives
		<select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value="">Select Month</option> 	<option value='http://allthingssimpleblog.com/2011/07/'> July 2011  (3)</option>
	<option value='http://allthingssimpleblog.com/2011/06/'> June 2011  (2)</option>
	<option value='http://allthingssimpleblog.com/2011/05/'> May 2011  (3)</option>
	<option value='http://allthingssimpleblog.com/2011/04/'> April 2011  (6)</option>
	<option value='http://allthingssimpleblog.com/2011/03/'> March 2011  (2)</option>
	<option value='http://allthingssimpleblog.com/2011/02/'> February 2011  (2)</option>
 </select>

Simple Pleasures

A Cup of Jo

Anthroholic

Design*Sponge

Effortless Anthropologie

Harper & Henny

Intentional Tortes

Mark Bittman

Oh Joy!

One Fine Dae

See Jane.

smitten kitchen

Sprouted Kitchen

Blog at WordPress.com.

				Theme: Bueno by WooThemes.

		<form action="" method="post">
			Send to Email Address
			<input type="text" name="target_email" id="target_email" value="" />

				Your Name
				<input type="text" name="source_name" id="source_name" value="" />

				Your Email Address
				<input type="text" name="source_email" id="source_email" value="" />

			<input type="submit" value="Send Email" class="sharing_send" />
			Cancel

				Post was not sent - check your email addresses!

				Email check failed, please try again

				Sorry, your blog cannot share posts by email.

		</form>


text:
require "fog/core/model"

module Fog
  module Compute
    class Brkt
      class Image < Fog::Model
        # @!group Attributes
        identity :id

        attribute :name
        attribute :description
        attribute :state
        attribute :is_base,      :aliases => :base,      :type => :boolean
        attribute :is_encrypted, :aliases => :encrypted, :type => :boolean
        attribute :os
        attribute :os_settings
        # @!endgroup

        def encrypted?
          !!is_encrypted
        end

        def base?
          !!is_base
        end

        # Create Image.
        # Required attributes: *name*, *os*
        #
        # @return [true]
        def save
          requires :name, :os

          data = service.create_image(attributes).body
          merge_attributes(data)
          true
        end

        # Delete image
        #
        # @return [true]
        def destroy
          requires :id

          service.delete_image(id)
          true
        end

        # @return [CspImages] Csp images collection
        def csp_images
          service.csp_images(:image => self)
        end
      end
    end
  end
end


text:
import {
  Component,
  OnInit,
  TemplateRef,
  ViewChild,
  ViewEncapsulation
} from '@angular/core';

import { TableConfig } from '../table-config';
import { TableEvent } from '../../table-event';

import { cloneDeep } from 'lodash';

@Component({
  encapsulation: ViewEncapsulation.None,
  selector: 'table-basic-example',
  templateUrl: './table-basic-example.component.html'
})
export class TableBasicExampleComponent implements OnInit {
  @ViewChild('addressTemplate') addressTemplate: TemplateRef<any>;
  @ViewChild('birthMonthTemplate') birthMonthTemplate: TemplateRef<any>;
  @ViewChild('nameTemplate') nameTemplate: TemplateRef<any>;
  @ViewChild('weekDayTemplate') weekDayTemplate: TemplateRef<any>;

  actionsText: string = '';
  allRows: any[];
  columns: any[];
  rows: any[];
  tableConfig: TableConfig;

  constructor() {
  }

  ngOnInit(): void {
    this.columns = [{
      cellTemplate: this.nameTemplate,
      draggable: true,
      prop: 'name',
      name: 'Name',
      resizeable: true
    }, {
      cellTemplate: this.addressTemplate,
      draggable: true,
      prop: 'address',
      name: 'Address',
      resizeable: true
    }, {
      cellTemplate: this.birthMonthTemplate,
      draggable: true,
      prop: 'birthMonth',
      name: 'Birth Month',
      resizeable: true
    }, {
      cellTemplate: this.weekDayTemplate,
      draggable: true,
      prop: 'weekDay',
      name: 'Week Day',
      resizeable: true
    }];

    this.allRows = [{
      name: 'Fred Flintstone',
      address: '20 Dinosaur Way, Bedrock, Washingstone',
      birthMonth: 'February',
      birthMonthId: 'month2',
      weekDay: 'Sunday',
      weekdayId: 'day1'
    }, {
      name: 'John Smith',
      address: '415 East Main Street, Norfolk, Virginia',
      birthMonth: 'October',
      birthMonthId: '10',
      // selected: true,
      weekDay: 'Monday',
      weekdayId: 'day2'
    }, {
      name: 'Frank Livingston',
      address: '234 Elm Street, Pittsburgh, Pennsylvania',
      birthMonth: 'March',
      birthMonthId: 'month3',
      weekDay: 'Tuesday',
      weekdayId: 'day3'
    }, {
      name: 'Judy Green',
      address: '2 Apple Boulevard, Cincinatti, Ohio',
      birthMonth: 'December',
      birthMonthId: 'month12',
      weekDay: 'Wednesday',
      weekdayId: 'day4'
    }, {
      name: 'Pat Thomas',
      address: '50 Second Street, New York, New York',
      birthMonth: 'February',
      birthMonthId: 'month2',
      weekDay: 'Thursday',
      weekdayId: 'day5'
    }];
    this.rows = this.allRows;

    this.tableConfig = {
      showCheckbox: true
    } as TableConfig;
  }

  // Selection

  handleSelectionChange($event: TableEvent): void {
    this.actionsText = $event.selectedRows.length + ' rows selected\r\n' + this.actionsText;
  }
}


text:
namespace autofill {

namespace {

std::pair<int, int> CalculatePopupXAndWidth(
    const display::Display& left_display,
    const display::Display& right_display,
    int popup_required_width,
    const gfx::Rect& element_bounds,
    bool is_rtl) {
  int leftmost_display_x = left_display.bounds().x();
  int rightmost_display_x =
      right_display.GetSizeInPixel().width() + right_display.bounds().x();

  // Calculate the start coordinates for the popup if it is growing right or
  // the end position if it is growing to the left, capped to screen space.
  int right_growth_start = std::max(
      leftmost_display_x, std::min(rightmost_display_x, element_bounds.x()));
  int left_growth_end =
      std::max(leftmost_display_x,
               std::min(rightmost_display_x, element_bounds.right()));

  int right_available = rightmost_display_x - right_growth_start;
  int left_available = left_growth_end - leftmost_display_x;

  int popup_width =
      std::min(popup_required_width, std::max(right_available, left_available));

  std::pair<int, int> grow_right(right_growth_start, popup_width);
  std::pair<int, int> grow_left(left_growth_end - popup_width, popup_width);

  // Prefer to grow towards the end (right for LTR, left for RTL). But if there
  // is not enough space available in the desired direction and more space in
  // the other direction, reverse it.
  if (is_rtl) {
    return left_available >= popup_width || left_available >= right_available
               ? grow_left
               : grow_right;
  }
  return right_available >= popup_width || right_available >= left_available
             ? grow_right
             : grow_left;
}

// Calculates the height of the popup and the y position of it. These values
// will stay on the screen.
std::pair<int, int> CalculatePopupYAndHeight(
    const display::Display& top_display,
    const display::Display& bottom_display,
    int popup_required_height,
    const gfx::Rect& element_bounds) {
  int topmost_display_y = top_display.bounds().y();
  int bottommost_display_y =
      bottom_display.GetSizeInPixel().height() + bottom_display.bounds().y();

  // Calculate the start coordinates for the popup if it is growing down or
  // the end position if it is growing up, capped to screen space.
  int top_growth_end = std::max(
      topmost_display_y, std::min(bottommost_display_y, element_bounds.y()));
  int bottom_growth_start =
      std::max(topmost_display_y,
               std::min(bottommost_display_y, element_bounds.bottom()));

  int top_available = bottom_growth_start - topmost_display_y;
  int bottom_available = bottommost_display_y - top_growth_end;

  // TODO(csharp): Restrict the popup height to what is available.
  if (bottom_available >= popup_required_height ||
      bottom_available >= top_available) {
    // The popup can appear below the field.
    return std::make_pair(bottom_growth_start, popup_required_height);
  } else {
    // The popup must appear above the field.
    return std::make_pair(top_growth_end - popup_required_height,
                          popup_required_height);
  }
}

}  // namespace

gfx::Rect PopupViewCommon::CalculatePopupBounds(int desired_width,
                                                int desired_height,
                                                const gfx::Rect& element_bounds,
                                                gfx::NativeView container_view,
                                                bool is_rtl) {
  // This is the top left point of the popup if the popup is above the element
  // and grows to the left (since that is the highest and furthest left the
  // popup go could).
  gfx::Point top_left_corner_of_popup =
      element_bounds.origin() +
      gfx::Vector2d(element_bounds.width() - desired_width, -desired_height);

  // This is the bottom right point of the popup if the popup is below the
  // element and grows to the right (since the is the lowest and furthest right
  // the popup could go).
  gfx::Point bottom_right_corner_of_popup =
      element_bounds.origin() +
      gfx::Vector2d(desired_width, element_bounds.height() + desired_height);

  display::Display top_left_display =
      GetDisplayNearestPoint(top_left_corner_of_popup, container_view);
  display::Display bottom_right_display =
      GetDisplayNearestPoint(bottom_right_corner_of_popup, container_view);

  std::pair<int, int> popup_x_and_width =
      CalculatePopupXAndWidth(top_left_display, bottom_right_display,
                              desired_width, element_bounds, is_rtl);
  std::pair<int, int> popup_y_and_height = CalculatePopupYAndHeight(
      top_left_display, bottom_right_display, desired_height, element_bounds);

  return gfx::Rect(popup_x_and_width.first, popup_y_and_height.first,
                   popup_x_and_width.second, popup_y_and_height.second);
}

display::Display PopupViewCommon::GetDisplayNearestPoint(
    const gfx::Point& point,
    gfx::NativeView container_view) {
  return display::Screen::GetScreen()->GetDisplayNearestPoint(point);
}

}  // namespace autofill


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="event-manager" version="2.5"
		 xmlns="http://java.sun.com/xml/ns/javaee"
		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

	<!-- buildNumber will be substituted by maven -->
	<display-name>${project.name} (${buildNumber})</display-name>

	<filter>
		<filter-name>guiceFilter</filter-name>
		<filter-class>com.google.inject.servlet.GuiceFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>guiceFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<!-- http://stackoverflow.com/questions/32689146/google-app-engine-does-httpsessionlistener-work -->
	<!-- http://stackoverflow.com/questions/4809882/google-app-engine-how-to-track-httpsession-destroy -->

	<listener>
		<listener-class>com.google.developers.event.DefaultStartupListener</listener-class>
	</listener>

	<error-page>
		<exception-type>java.lang.Exception</exception-type>
		<location>/api/5xx/</location>
	</error-page>

	<!-- https://developers.google.com/appengine/docs/java/config/webxml#Secure_URLs -->
	<!-- this is for forcing https -->
<!--
	<security-constraint>
		<web-resource-collection>
			<web-resource-name>everything</web-resource-name>
			<url-pattern>/*</url-pattern>
		</web-resource-collection>
		<user-data-constraint>
			<transport-guarantee>CONFIDENTIAL</transport-guarantee>
		</user-data-constraint>
	</security-constraint>
-->

	<security-constraint>
		<web-resource-collection>
			<web-resource-name>admin</web-resource-name>

			<url-pattern>/admin/*</url-pattern>

			<!-- https://developers.google.com/appengine/docs/java/config/cron#Securing_URLs_for_Cron -->
			<url-pattern>/cron/*</url-pattern>

			<!-- https://developers.google.com/appengine/docs/java/taskqueue/overview-push#Securing_URLs_for_Tasks -->
			<url-pattern>/task/*</url-pattern>

			<!-- https://developers.google.com/appengine/docs/java/mail/receiving -->
			<url-pattern>/_ah/mail/*</url-pattern>

			<!-- https://developers.google.com/appengine/docs/java/mail/bounce -->
			<url-pattern>/_ah/bounce</url-pattern>

		</web-resource-collection>
		<auth-constraint>
			<role-name>admin</role-name>
		</auth-constraint>
	</security-constraint>

	<security-constraint>
		<web-resource-collection>
			<web-resource-name>authenticated</web-resource-name>
			<url-pattern>/authenticated/*</url-pattern>
		</web-resource-collection>
<!--
		<web-resource-collection>
			<web-resource-name>spreadsheet</web-resource-name>
			<url-pattern>/spreadsheet/*</url-pattern>
		</web-resource-collection>
-->
		<auth-constraint>
			<role-name>*</role-name>
		</auth-constraint>
	</security-constraint>

	<welcome-file-list>
		<welcome-file>gdg-index.html</welcome-file>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>
</web-app>


text:
package com.mpatric.mp3agic;

import java.util.Arrays;

import junit.framework.TestCase;

public class ID3v2ChapterTOCFrameDataTest extends TestCase {

	public void testShouldConsiderTwoEquivalentObjectsEqual() throws Exception {
		String children[] = {"ch1", "ch2"};
		ID3v2ChapterTOCFrameData frameData1 = new ID3v2ChapterTOCFrameData(false, true, false, "toc1", children);
		ID3v2TextFrameData subFrameData1 = new ID3v2TextFrameData(false, new EncodedText("Hello there"));
		frameData1.addSubframe("TIT2", subFrameData1);
		ID3v2ChapterTOCFrameData frameData2 = new ID3v2ChapterTOCFrameData(false, true, false, "toc1", children);;
		ID3v2TextFrameData subFrameData2 = new ID3v2TextFrameData(false, new EncodedText("Hello there"));
		frameData2.addSubframe("TIT2", subFrameData2);
		assertEquals(frameData1, frameData2);
	}

	public void testShouldConvertFrameDataToBytesAndBackToEquivalentObject() throws Exception {
		String children[] = {"ch1", "ch2"};
		ID3v2ChapterTOCFrameData frameData = new ID3v2ChapterTOCFrameData(false, true, true, "toc1", children);
		ID3v2TextFrameData subFrameData = new ID3v2TextFrameData(false, new EncodedText("Hello there"));
		frameData.addSubframe("TIT2", subFrameData);
		byte[] bytes = frameData.toBytes();
		byte[] expectedBytes = {
				't', 'o', 'c', '1', 0,
				3, 2,
				'c', 'h', '1', 0,
				'c', 'h', '2', 0,
				'T', 'I', 'T', '2',
				0, 0, 0, (byte)0xc,
				0, 0,
				0,
				'H', 'e', 'l', 'l', 'o', ' ', 't', 'h', 'e', 'r', 'e'
		};
		assertTrue(Arrays.equals(expectedBytes, bytes));
		ID3v2ChapterTOCFrameData frameDataCopy = new ID3v2ChapterTOCFrameData(false, bytes);
		assertEquals(frameData, frameDataCopy);
	}
}


text:
package policy

import (
	"strconv"
	"time"

	"github.com/cilium/cilium/api/v1/models"
	"github.com/cilium/cilium/pkg/labels"
)

const (
	secLabelTimeout = time.Duration(120 * time.Second)

	// MinimalNumericIdentity represents the minimal numeric identity not
	// used for reserved purposes.
	MinimalNumericIdentity = NumericIdentity(256)

	// InvalidIdentity is the identity assigned if the identity is invalid
	// or not determined yet
	InvalidIdentity = NumericIdentity(0)
)

// NumericIdentity represents an identity of an entity to which consumer policy
// can be applied to.
type NumericIdentity uint32

func ParseNumericIdentity(id string) (NumericIdentity, error) {
	nid, err := strconv.ParseUint(id, 0, 32)
	if err != nil {
		return NumericIdentity(0), err
	}
	return NumericIdentity(nid), nil
}

func (id NumericIdentity) StringID() string {
	return strconv.FormatUint(uint64(id), 10)
}

func (id NumericIdentity) String() string {
	if v, exists := ReservedIdentityNames[id]; exists {
		return v
	}

	return id.StringID()
}

// Uint32 normalizes the ID for use in BPF program.
func (id NumericIdentity) Uint32() uint32 {
	return uint32(id)
}

// Identity is the representation of the security context for a particular set of
// labels.
type Identity struct {
	// Identity's ID.
	ID NumericIdentity `json:"id"`
	// Endpoints that have this Identity where their value is the last time they were seen.
	Labels labels.Labels `json:"labels"`
	// Set of labels that belong to this Identity.
	Endpoints map[string]time.Time `json:"containers"`
}

func NewIdentityFromModel(base *models.Identity) *Identity {
	if base == nil {
		return nil
	}

	id := &Identity{
		ID:        NumericIdentity(base.ID),
		Labels:    make(labels.Labels),
		Endpoints: make(map[string]time.Time),
	}
	for _, v := range base.Labels {
		lbl := labels.ParseLabel(v)
		id.Labels[lbl.Key] = lbl
	}

	return id
}

func (id *Identity) GetModel() *models.Identity {
	if id == nil {
		return nil
	}

	ret := &models.Identity{
		ID:     int64(id.ID),
		Labels: []string{},
	}

	for _, v := range id.Labels {
		ret.Labels = append(ret.Labels, v.String())
	}

	return ret
}

func (id *Identity) DeepCopy() *Identity {
	cpy := &Identity{
		ID:        id.ID,
		Labels:    id.Labels.DeepCopy(),
		Endpoints: make(map[string]time.Time, len(id.Endpoints)),
	}
	for k, v := range id.Endpoints {
		cpy.Endpoints[k] = v
	}
	return cpy
}

func NewIdentity() *Identity {
	return &Identity{
		Endpoints: make(map[string]time.Time),
		Labels:    make(map[string]*labels.Label),
	}
}

// AssociateEndpoint associates the endpoint with identity.
func (id *Identity) AssociateEndpoint(epID string) {
	id.Endpoints[epID] = time.Now().UTC()
}

// DisassociateEndpoint disassociates the endpoint endpoint with identity and
// returns true if successful.
func (id *Identity) DisassociateEndpoint(epID string) bool {
	if _, ok := id.Endpoints[epID]; ok {
		delete(id.Endpoints, epID)
		return true
	}

	return false
}

func (id *Identity) RefCount() int {
	refCount := 0
	for _, t := range id.Endpoints {
		if t.Add(secLabelTimeout).After(time.Now().UTC()) {
			refCount++
		}
	}
	return refCount
}

const (
	ID_UNKNOWN NumericIdentity = iota
	ID_HOST
	ID_WORLD
)

var (
	ReservedIdentities = map[string]NumericIdentity{
		labels.IDNameHost:  ID_HOST,
		labels.IDNameWorld: ID_WORLD,
	}
	ReservedIdentityNames = map[NumericIdentity]string{
		ID_HOST:  labels.IDNameHost,
		ID_WORLD: labels.IDNameWorld,
	}
)

func GetReservedID(name string) NumericIdentity {
	if v, ok := ReservedIdentities[name]; ok {
		return v
	}
	return ID_UNKNOWN
}


text: The maximum number of concurrently running slave containers that Docker is allowed to run.


text:
// methods
import curry from './curry';

// utils
import coalesceToArray from './_utils/coalesceToArray';
import isObject from './_utils/isObject';

/**
 * @function takeObject
 *
 * @description
 * get the first n number of items in an object
 *
 * @param {number} size the number of items to get from the end of the object
 * @param {Object} object the object of items to get the first n items from
 * @param {Array<string>} keys the keys of the object
 * @return {Object} the first n number of items
 */
function takeObject(size, object, keys) {
  let index = -1,
      newObject = {},
      key;

  while (++index < size) {
    key = keys[index];

    newObject[key] = object[key];
  }

  return newObject;
}

/**
 * @function takeArray
 *
 * @description
 * get the first n number of items in an array
 *
 * @param {number} size the number of items to get from the end of the array
 * @param {Array<*>} array the array of items to get the first n items from
 * @return {Array<*>} the first n number of items
 */
function takeArray(size, array) {
  return size > 0 ? array.slice(0, size) : [];
}

/**
 * @function take
 *
 * @description
 * get the first n number of items in a collection
 *
 * @param {number} size the number of items to get from the end of the collection
 * @param {Array<*>|Object} collection the collection of items to get the first n items from
 * @return {Array<*>|Object} the first n number of items
 */
export default curry(function take(size, collection) {
  return isObject(collection)
    ? takeObject(size, collection, Object.keys(collection))
    : takeArray(size, coalesceToArray(collection));
});


text:
#import "Mother.h"

#import "Child.h"

@implementation Mother

@dynamic name;
@dynamic children;

@end


text:
`volatile` variables are not guaranteed by the standard to be thread-safe (MS compiler makes volatiles atomic as an extension, but relying on that is non-portable.)
C++11 excplicitly specifies that `volatile` is intended to be used only for low-level work with hardware and `std::atomic` should be used instead for thread-safe access to data.

For C++03 `boost::atomic` may be used.

> https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rconc-volatile2


text:
module ElectionHelpers
  TEST_API_URL = "https://test.example.org/api/v1".freeze

  def with_electoral_api_url(&block)
    ClimateControl.modify ELECTIONS_API_URL: TEST_API_URL, &block
  end

  def stub_api_postcode_lookup(postcode, response: "{}", status: 200)
    stub_request(:get, "#{TEST_API_URL}/postcode/#{postcode}")
      .to_return(status:, body: response)
  end

  def stub_api_address_lookup(uprn, response: "{}", status: 200)
    stub_request(:get, "#{TEST_API_URL}/address/#{uprn}")
      .to_return(status:, body: response)
  end

  def api_response
    path = Rails.root.join("test/fixtures/electoral-result.json")
    File.read(path)
  end
end


text:
package  com.rabbit.dto.monitor;

import java.io.Serializable;
/**
 * @author Administrator
 *
 */
public class RabbitMonitorDto implements Serializable {
	private static final long serialVersionUID = 868591398710684992L;
	private String moniterId;		//记录ID
	private String recordKey;		//能够唯一标识的记录(通过此记录能够获得记录标识)
	private String optType;			//操作类型 :eg:p_push(类型_操作)
	//private String extendsField;	//辅助属性,当唯一标识不能确定记录的唯一性时,辅助属性存json以帮助确定唯一 eg:sku+语言+站点
	private String recordState;		//记录状态 1:成功  2:失败
	private String nodeData;		//存放失败原因和报文{reason:XXX,node:xxx}
	private String failReason;		//失败原因
	private String createdOn;			// 创建时间 UTC
	private String createdBy;		//  创建人
	private String lastUpdatedOn;		//  最后更新时间 UTC
	private String lastUpdatedBy;	//  最后更新人
	private String isDeleted;		//是否已逻辑删除 1:是 0:否 默认:0

	public String getFailReason() {
		return failReason;
	}
	public void setFailReason(String failReason) {
		this.failReason = failReason;
	}
	public String getMoniterId() {
		return moniterId;
	}
	public void setMoniterId(String moniterId) {
		this.moniterId = moniterId;
	}
	public String getRecordKey() {
		return recordKey;
	}
	public void setRecordKey(String recordKey) {
		this.recordKey = recordKey;
	}
	public String getOptType() {
		return optType;
	}
	public void setOptType(String optType) {
		this.optType = optType;
	}
	public String getRecordState() {
		return recordState;
	}
	public void setRecordState(String recordState) {
		this.recordState = recordState;
	}

	public String getNodeData() {
		return nodeData;
	}
	public void setNodeData(String nodeData) {
		this.nodeData = nodeData;
	}
	public String getCreatedBy() {
		return createdBy;
	}
	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}
	public String getLastUpdatedBy() {
		return lastUpdatedBy;
	}
	public void setLastUpdatedBy(String lastUpdatedBy) {
		this.lastUpdatedBy = lastUpdatedBy;
	}
	public String getIsDeleted() {
		return isDeleted;
	}
	public void setIsDeleted(String isDeleted) {
		this.isDeleted = isDeleted;
	}
	public String getCreatedOn() {
		return createdOn;
	}
	public void setCreatedOn(String createdOn) {
		this.createdOn = createdOn;
	}
	public String getLastUpdatedOn() {
		return lastUpdatedOn;
	}
	public void setLastUpdatedOn(String lastUpdatedOn) {
		this.lastUpdatedOn = lastUpdatedOn;
	}

}


text:
FOUNDATION_EXPORT double DHLocalizedStringVersionNumber;

//! Project version string for DHLocalizedStringOSX.
FOUNDATION_EXPORT const unsigned char DHLocalizedStringVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <DHLocalizedString/PublicHeader.h>


text:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="/js/spritejs.js"></script>
  <style>
    canvas {
      width: 512px;
      height: 288px;
    }
  </style>
</head>
<body>
  <canvas width="1023" height="576"></canvas>
  <script>
    const canvas = document.querySelector('canvas');

    const layer = new spritejs.Layer({
      canvas,
    });

    const video = document.createElement('video');
    video.src = 'https://s4.ssl.qhres2.com/static/a2fa8e8634dd1ccb.mp4';
    video.crossOrigin = 'Anonymous';
    video.loop = true;
    video.muted = true;
    video.play();

    const videoCanvas = canvas.cloneNode();
    const videoCtx = videoCanvas.getContext('2d');

    const s = new spritejs.Sprite({
      width: 1023,
      height: 576,
    });

    layer.append(s);

    let started = false;
    video.addEventListener('playing', () => {
      if(!started) {
        started = true;
        layer.tick(() => {
          videoCtx.drawImage(video, 0, 0);
          s.attr('texture', videoCanvas);
        });
      }
    });
  </script>
</body>
</html>


text:
#include "paddle/fluid/operators/flatten_op.h"

#include <memory>
#include <string>
#include <unordered_map>
#include <vector>

#include "paddle/fluid/framework/infershape_utils.h"
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/phi/core/infermeta_utils.h"
#include "paddle/phi/infermeta/backward.h"
#include "paddle/phi/infermeta/unary.h"

namespace paddle {
namespace operators {

using Tensor = phi::DenseTensor;

class FlattenOp : public framework::OperatorWithKernel {
 public:
  using framework::OperatorWithKernel::OperatorWithKernel;

  void InferShape(framework::InferShapeContext *ctx) const override {
    OP_INOUT_CHECK(ctx->HasInput("X"), "Input", "X", "Flatten");
    OP_INOUT_CHECK(ctx->HasOutput("Out"), "Output", "Out", "Flatten");
    const auto &axis = ctx->Attrs().Get<int>("axis");
    const auto &in_dims = ctx->GetInputDim("X");
    PADDLE_ENFORCE_GE(axis,
                      0,
                      platform::errors::InvalidArgument(
                          "The axis should be greater than or equal to 0."));
    PADDLE_ENFORCE_LE(
        axis,
        in_dims.size(),
        platform::errors::InvalidArgument(
            "The axis should be less than or equal to input tensor's rank."));

    const auto &out_dims = GetOutputShape(axis, in_dims);
    ctx->SetOutputDim("Out", phi::make_ddim(out_dims));
    if (in_dims[0] == out_dims[0]) {
      // Only pass LoD when the first dimension of output and Input(X)
      // are the same.
      ctx->ShareLoD("X", "Out");
    }
  }

  static std::vector<int32_t> GetOutputShape(const int axis,
                                             const framework::DDim &in_dims) {
    int64_t outer = 1, inner = 1;
    for (int i = 0; i < in_dims.size(); ++i) {
      if (i < axis) {
        if (in_dims[i] == -1 || outer == -1) {
          outer = -1;
        } else {
          outer *= in_dims[i];
        }
      } else {
        if (in_dims[i] == -1 || inner == -1) {
          inner = -1;
        } else {
          inner *= in_dims[i];
        }
      }
    }
    std::vector<int32_t> out_shape(2);
    out_shape[0] = outer;
    out_shape[1] = inner;
    return out_shape;
  }

 protected:
  framework::OpKernelType GetExpectedKernelType(
      const framework::ExecutionContext &ctx) const override {
    auto input_data_type =
        framework::OperatorWithKernel::IndicateVarDataType(ctx, "X");
    return framework::OpKernelType(input_data_type, ctx.GetPlace());
  }
};

class FlattenOpMaker : public framework::OpProtoAndCheckerMaker {
 public:
  void Make() override {
    AddInput("X", "(Tensor) A tensor of rank >= axis.");
    AddOutput("Out",
              "A 2D tensor is reshaped input tensor. The input dimensions"
              "up to axis are flattened to the outer dimension of the output"
              "and the remaining input dimensions are flattened into the inner"
              "dimension of the output.");
    AddAttr<int>("axis",
                 "(int)"
                 "Indicate up to which input dimensions (exclusive) should be"
                 "flattened to the outer dimension of the output. The value"
                 "for axis must be in the range [0, R], where R is the rank of"
                 "the input tensor. When axis = 0, the shape of the output"
                 "tensor is (1, (d_0 X d_1 ... d_n), where the shape of the"
                 "input tensor is (d_0, d_1, ... d_n).")
        .SetDefault(1);
    AddAttr<bool>("use_mkldnn",
                  "(bool, default false) Only used in mkldnn kernel")
        .SetDefault(false)
        .AsExtra();
    AddAttr<std::string>(
        "mkldnn_data_type",
        "(string, default \"float32\"). Data type of mkldnn kernel")
        .SetDefault("float32")
        .InEnum({"float32", "bfloat16"})
        .AsExtra();
    AddComment(R"DOC(
Flatten Operator

Flattens the input tensor into a 2D matrix.

Examples:
Case 1:
  Given
    X.shape = (3, 100, 100, 4)
  and
    axis = 2
  We get:
    Out.shape = (3 * 100, 4 * 100)

Case 2:
  Given
    X.shape = (3, 100, 100, 4)
  and
    axis = 0
  We get:
    Out.shape = (1, 3 * 100 * 100 * 4)
)DOC");
  }
};

class FlattenGradOp : public framework::OperatorWithKernel {
 public:
  using framework::OperatorWithKernel::OperatorWithKernel;

  void InferShape(framework::InferShapeContext *context) const override {
    context->SetOutputDim(framework::GradVarName("X"),
                          context->GetInputDim("X"));
    context->ShareLoD("X", framework::GradVarName("X"));
  }

 protected:
  framework::OpKernelType GetExpectedKernelType(
      const framework::ExecutionContext &ctx) const override {
    auto input_data_type = framework::OperatorWithKernel::IndicateVarDataType(
        ctx, framework::GradVarName("Out"));
    return framework::OpKernelType(input_data_type, ctx.GetPlace());
  }
};

template <typename T>
class FlattenGradOpMaker : public framework::SingleGradOpMaker<T> {
 public:
  using framework::SingleGradOpMaker<T>::SingleGradOpMaker;

  void Apply(GradOpPtr<T> grad_op) const override {
    grad_op->SetType("flatten_grad");
    grad_op->SetInput("X", this->Input("X"));
    grad_op->SetInput(framework::GradVarName("Out"), this->OutputGrad("Out"));
    grad_op->SetOutput(framework::GradVarName("X"), this->InputGrad("X"));
    grad_op->SetAttrMap(this->Attrs());
  }
};

// FIXME(zcd): flatten2 adds an intermediate output(XShape) based on flatten,
// the XShape is used to carry the shape and lod of X which will be used in
// flatten_grad, in this way, the framework can reuse the memory of X
// immediately the flatten2_op is finished.
// Considering compatibility issues, we could not fix flatten2_op
class Flatten2Op : public framework::OperatorWithKernel {
 public:
  using framework::OperatorWithKernel::OperatorWithKernel;

  void InferShape(framework::InferShapeContext *ctx) const override {
    OP_INOUT_CHECK(ctx->HasInput("X"), "Input", "X", "Flatten2");
    OP_INOUT_CHECK(ctx->HasOutput("Out"), "Output", "Out", "Flatten2");
    const auto &axis = ctx->Attrs().Get<int>("axis");
    const auto &in_dims = ctx->GetInputDim("X");
    PADDLE_ENFORCE_GE(axis,
                      0,
                      platform::errors::InvalidArgument(
                          "The axis should be greater than or equal to 0."));
    PADDLE_ENFORCE_LE(
        axis,
        in_dims.size(),
        platform::errors::InvalidArgument(
            "The axis should be less than or equal to input tensor's rank"));

    const auto &out_dims = FlattenOp::GetOutputShape(axis, in_dims);
    ctx->SetOutputDim("Out", phi::make_ddim(out_dims));
    if (in_dims[0] == out_dims[0]) {
      // Only pass LoD when the first dimension of output and Input(X)
      // are the same.
      ctx->ShareLoD("X", "Out");
    }
    if (!ctx->HasOutput("XShape")) return;
    // OP_INOUT_CHECK(ctx->HasOutput("XShape"), "Output", "XShape", "Flatten2");
    std::vector<int64_t> xshape_dims(in_dims.size() + 1);
    xshape_dims[0] = 0;
    for (int i = 0; i < in_dims.size(); ++i) {
      xshape_dims[i + 1] = in_dims[i];
    }
    ctx->SetOutputDim("XShape", phi::make_ddim(xshape_dims));
    ctx->ShareLoD("X", "XShape");
  }

  framework::OpKernelType GetExpectedKernelType(
      const framework::ExecutionContext &ctx) const override {
    auto input_data_type =
        framework::OperatorWithKernel::IndicateVarDataType(ctx, "X");
    return framework::OpKernelType(input_data_type, ctx.GetPlace());
  }
};

class Flatten2OpMaker : public FlattenOpMaker {
 public:
  void Make() override {
    FlattenOpMaker::Make();
    AddOutput("XShape",
              "XShape is just used to store the shape and lod of X, which will "
              "be used in FlattenGradOp.")
        .AsIntermediate()
        .AsExtra();
  }
};

template <typename T>
class Flatten2GradOpMaker : public framework::SingleGradOpMaker<T> {
 public:
  using framework::SingleGradOpMaker<T>::SingleGradOpMaker;

  void Apply(GradOpPtr<T> grad_op) const override {
    grad_op->SetType("flatten2_grad");
    grad_op->SetInput("XShape", this->Output("XShape"));
    grad_op->SetInput(framework::GradVarName("Out"), this->OutputGrad("Out"));
    grad_op->SetOutput(framework::GradVarName("X"), this->InputGrad("X"));
    grad_op->SetAttrMap(this->Attrs());
  }
};

class Flatten2GradOp : public framework::OperatorWithKernel {
 public:
  using framework::OperatorWithKernel::OperatorWithKernel;

  void InferShape(framework::InferShapeContext *context) const override {
    OP_INOUT_CHECK(
        context->HasInput("XShape"), "Input", "XShape", "Flatten2Grad");
    OP_INOUT_CHECK(context->HasInput(framework::GradVarName("Out")),
                   "Input",
                   framework::GradVarName("Out"),
                   "Flatten2Grad");
    auto xshape_dims = context->GetInputDim("XShape");
    auto x_dims = phi::slice_ddim(xshape_dims, 1, xshape_dims.size());
    context->SetOutputDim(framework::GradVarName("X"), x_dims);
    context->ShareLoD("XShape", framework::GradVarName("X"));
  }

 protected:
  framework::OpKernelType GetExpectedKernelType(
      const framework::ExecutionContext &ctx) const override {
    auto input_data_type = framework::OperatorWithKernel::IndicateVarDataType(
        ctx, framework::GradVarName("Out"));
    return framework::OpKernelType(input_data_type, ctx.GetPlace());
  }
};

class FlattenContiguousRangeOp : public framework::OperatorWithKernel {
 public:
  using framework::OperatorWithKernel::OperatorWithKernel;
  void InferShape(framework::InferShapeContext *ctx) const override {
    OP_INOUT_CHECK(ctx->HasInput("X"), "Input", "X", "FlattenContiguousRange");
    OP_INOUT_CHECK(
        ctx->HasOutput("Out"), "Output", "Out", "FlattenContiguousRange");
    const auto &start_axis = ctx->Attrs().Get<int>("start_axis");
    const auto &stop_axis = ctx->Attrs().Get<int>("stop_axis");

    // Construct MetaTensor for InferMeta Func
    using CompatMetaTensor = framework::CompatMetaTensor;
    CompatMetaTensor x(ctx->GetInputVarPtrs("X")[0], ctx->IsRuntime());
    CompatMetaTensor out(ctx->GetOutputVarPtrs("Out")[0], ctx->IsRuntime());
    std::unique_ptr<CompatMetaTensor> xshape(nullptr);
    if (ctx->HasOutput("XShape")) {
      xshape = std::move(std::unique_ptr<CompatMetaTensor>(new CompatMetaTensor(
          ctx->GetOutputVarPtrs("XShape")[0], ctx->IsRuntime())));
    }
    phi::FlattenWithXShapeInferMeta(
        x, start_axis, stop_axis, &out, xshape.get());
  }
};

class FlattenContiguousRangeOpMaker : public FlattenOpMaker {
 public:
  void Make() override {
    AddInput("X", "(Tensor) A tensor of rank >= axis.");
    AddOutput("Out",
              "A 2D tensor is reshaped input tensor. The input dimensions"
              "up to axis are flattened to the outer dimension of the output"
              "and the remaining input dimensions are flattened into the inner"
              "dimension of the output.");
    AddAttr<int>("start_axis",
                 "(int)"
                 "Indicate the input start dimension (exclusive) to flatten")
        .SetDefault(1);
    AddAttr<int>("stop_axis",
                 "(int)"
                 "Indicate the input stop dimension (exclusive) to flatten")
        .SetDefault(1);
    AddComment(R"DOC(
Flatten Operator

Flattens the input tensor into a new matrix according to start_axis and stop_axis.

Examples:
Case 1:
  Given
    X.shape = (3, 100, 100, 4)
  and
    start_axis = 2, stop_axis = -1
  We get:
    Out.shape = (3, 100, 400)

Case 2:
  Given
    X.shape = (3, 100, 100, 4)
  and
    start_axis = 0, stop_axis = -1
  We get:
    Out.shape = (3 * 100 * 100 * 4)
)DOC");
    AddOutput("XShape",
              "XShape is just used to store the shape and lod of X, which will "
              "be used in FlattenGradOp.")
        .AsIntermediate()
        .AsExtra();
  }
};

template <typename T>
class FlattenContiguousRangeGradOpMaker
    : public framework::SingleGradOpMaker<T> {
 public:
  using framework::SingleGradOpMaker<T>::SingleGradOpMaker;

  void Apply(GradOpPtr<T> grad_op) const override {
    grad_op->SetType("flatten_contiguous_range_grad");
    grad_op->SetInput("XShape", this->Output("XShape"));
    grad_op->SetInput(framework::GradVarName("Out"), this->OutputGrad("Out"));
    grad_op->SetOutput(framework::GradVarName("X"), this->InputGrad("X"));
    grad_op->SetAttrMap(this->Attrs());
  }
};

class FlattenContiguousRangeGradOp : public framework::OperatorWithKernel {
 public:
  using framework::OperatorWithKernel::OperatorWithKernel;

  void InferShape(framework::InferShapeContext *context) const override {
    OP_INOUT_CHECK(context->HasInput("XShape"),
                   "Input",
                   "XShape",
                   "FlattenContiguousRangeGrad");
    OP_INOUT_CHECK(context->HasInput(framework::GradVarName("Out")),
                   "Input",
                   framework::GradVarName("Out"),
                   "FlattenContiguousRangeGrad");
    // Construct MetaTensor for InferMeta Func
    using CompatMetaTensor = framework::CompatMetaTensor;
    CompatMetaTensor xshape(context->GetInputVarPtrs("XShape")[0],
                            context->IsRuntime());
    CompatMetaTensor dx(
        context->GetOutputVarPtrs(framework::GradVarName("X"))[0],
        context->IsRuntime());
    phi::KernelWithXShapeInferMeta(xshape, &dx);
  }

 protected:
  framework::OpKernelType GetExpectedKernelType(
      const framework::ExecutionContext &ctx) const override {
    return framework::OpKernelType(OperatorWithKernel::IndicateVarDataType(
                                       ctx, framework::GradVarName("Out")),
                                   ctx.device_context());
  }
};
DECLARE_INPLACE_OP_INFERER(FlattenOpInplaceInferer, {"X", "Out"});
DECLARE_INPLACE_OP_INFERER(FlattenGradInplaceInferer,
                           {framework::GradVarName("Out"),
                            framework::GradVarName("X")});
DECLARE_NO_NEED_BUFFER_VARS_INFERER(FlattenGradNoNeedBufferVarsInferer, "X");

}  // namespace operators
}  // namespace paddle

namespace ops = paddle::operators;
REGISTER_OPERATOR(flatten,
                  ops::FlattenOp,
                  ops::FlattenOpMaker,
                  ops::FlattenGradOpMaker<paddle::framework::OpDesc>,
                  ops::FlattenGradOpMaker<paddle::imperative::OpBase>,
                  ops::FlattenOpInplaceInferer);
REGISTER_OPERATOR(flatten_grad,
                  ops::FlattenGradOp,
                  ops::FlattenGradInplaceInferer,
                  ops::FlattenGradNoNeedBufferVarsInferer);

REGISTER_OPERATOR(flatten2,
                  ops::Flatten2Op,
                  ops::Flatten2OpMaker,
                  ops::Flatten2GradOpMaker<paddle::framework::OpDesc>,
                  ops::Flatten2GradOpMaker<paddle::imperative::OpBase>,
                  ops::FlattenOpInplaceInferer);
REGISTER_OPERATOR(flatten2_grad,
                  ops::Flatten2GradOp,
                  ops::FlattenGradInplaceInferer);

REGISTER_OPERATOR(
    flatten_contiguous_range,
    ops::FlattenContiguousRangeOp,
    ops::FlattenContiguousRangeOpMaker,
    ops::FlattenContiguousRangeGradOpMaker<paddle::framework::OpDesc>,
    ops::FlattenContiguousRangeGradOpMaker<paddle::imperative::OpBase>,
    ops::FlattenOpInplaceInferer);
REGISTER_OPERATOR(flatten_contiguous_range_grad,
                  ops::FlattenContiguousRangeGradOp,
                  ops::FlattenGradInplaceInferer);

REGISTER_OP_CPU_KERNEL(flatten,
                       ops::FlattenKernel<phi::CPUContext, float>,
                       ops::FlattenKernel<phi::CPUContext, double>,
                       ops::FlattenKernel<phi::CPUContext, uint8_t>,
                       ops::FlattenKernel<phi::CPUContext, int>,
                       ops::FlattenKernel<phi::CPUContext, int8_t>,
                       ops::FlattenKernel<phi::CPUContext, int64_t>);
REGISTER_OP_CPU_KERNEL(flatten_grad,
                       ops::FlattenGradKernel<phi::CPUContext, float>,
                       ops::FlattenGradKernel<phi::CPUContext, double>,
                       ops::FlattenGradKernel<phi::CPUContext, uint8_t>,
                       ops::FlattenGradKernel<phi::CPUContext, int>,
                       ops::FlattenGradKernel<phi::CPUContext, int8_t>,
                       ops::FlattenGradKernel<phi::CPUContext, int64_t>);
REGISTER_OP_CPU_KERNEL(flatten2,
                       ops::Flatten2Kernel<phi::CPUContext, float>,
                       ops::Flatten2Kernel<phi::CPUContext, double>,
                       ops::Flatten2Kernel<phi::CPUContext, uint8_t>,
                       ops::Flatten2Kernel<phi::CPUContext, int>,
                       ops::Flatten2Kernel<phi::CPUContext, int8_t>,
                       ops::Flatten2Kernel<phi::CPUContext, int64_t>);
REGISTER_OP_CPU_KERNEL(flatten2_grad,
                       ops::Flatten2GradKernel<phi::CPUContext, float>,
                       ops::Flatten2GradKernel<phi::CPUContext, double>,
                       ops::Flatten2GradKernel<phi::CPUContext, uint8_t>,
                       ops::Flatten2GradKernel<phi::CPUContext, int>,
                       ops::Flatten2GradKernel<phi::CPUContext, int8_t>,
                       ops::Flatten2GradKernel<phi::CPUContext, int64_t>);


text:
<!doctype html>

		<title>Zabuun - Learn Egyptian Arabic for English speakers</title>
		<meta name="description" content="">
		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/head.php';?>

		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/ie8.php';?>
		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/header.php';?>

			<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/side.php';?>

Essays > Making a Sandwich

						Expand All | Collapse All

Making a Sandwich

 His stomach was growling. He had not eaten in five hours. He was starving. He went to his kitchen. He took out a loaf of bread. The bread was made from wheat. It was his favorite bread to eat. He grabbed two slices. He opened the fridge. He gathered all the ingredients. He laid them out across the table. He opened the jar of mayonnaise. It was low-fat mayonnaise. He spread it across the slice of bread. He used a knife to spread the mayonnaise. He unzipped the container of ham. The ham was honey glazed. He grabbed four slices of ham. He put it on the bread slice. He opened the cheese container. He grabbed a slice and put it on top of the ham. He cut some tomatoes and lettuce. He put the vegetables on top of the cheese and ham. He glazed it all with ketchup and mustard. The sandwich was ready for him to eat.

		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/footer.php';?>
		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/scripts.php';?>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>net.sourceforge.pmd.cpd (PMD JavaScript 5.2.2 Test API)</title>
<meta name="date" content="2014-12-03">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

net.sourceforge.pmd.cpd

Classes

EcmascriptTokenizerTest


text:
package org.araqne.jython;

import org.python.util.PythonInterpreter;

public interface JythonService {
	PythonInterpreter newInterpreter();

	PythonInterpreter getInterpreter(String key);

	void registerInterpreter(String key, PythonInterpreter interpreter);

	void unregisterInterpreter(String key);
}


text:
#include <libcgc.h>
#include <stdint.h>
#include "list.h"
#include "malloc.h"

typedef struct node block_meta_t;

struct list allocated_list;
struct list free_list;

char init_heap_done = FALSE;
size_t remaining = 0;
block_meta_t *last = NULL;

static void set_block_size(block_meta_t *block, size_t size) {
	block->data = (void *)size;
}

static void init_heap() {
	if (FALSE == init_heap_done) {
		list_init(&allocated_list, NULL);
		list_init(&free_list, NULL);
		init_heap_done = TRUE;
	}
}

static unsigned char is_enough_room(const void *free_sz, void *new_sz) {
	if (free_sz >= new_sz) {
		return TRUE;
	}

	return FALSE;
}

void *malloc(size_t size) {

	if (0 == size) {
		return NULL;
	}

	size += sizeof(block_meta_t); // size requested + size of block_meta_t is total size required
	block_meta_t *ret = NULL;

	init_heap();

	// check for a block on the free_list of sufficient size
	ret = (block_meta_t *)list_find_node_with_data(&free_list, &is_enough_room, (void *)size);

	// found room on free_list
	if (NULL != ret) {
		list_remove_node(&free_list, ret);

	// no room on free_list
	} else {
		// is there room on the last partially-used page?
		if (size <= remaining) {
			ret = last;
			remaining -= size;
		} else { // no room anywhere, get new page(s)

			// Allocate creates new page(s), so the memory from a prevoius page where
			// last and remaining refer should be saved to the free_list.
			//
			// Only save if that space can fit a block_meta_t + some bytes
			// else let it become dangling/unusable memory.
			if (remaining > sizeof(block_meta_t)) {
				set_block_size(last, remaining);
				list_insert_node_at_end(&free_list, last);
				last = NULL;
				remaining = 0;
			}

			if (0 != allocate(size, 0, (void **)&ret)) {
				return NULL;
			}

			remaining = PAGE_SZ - (size % PAGE_SZ);
		}

		set_block_size(ret, size);

		last = (block_meta_t *)((unsigned char *)ret + size);

	}

	// add block to allocated_list
	list_insert_node_at_end(&allocated_list, ret);

	// need casting to make the math work correctly.
	return (void *)((unsigned char*)ret + sizeof(block_meta_t));
}

void free(void *ptr) {
	// get block_meta for this memory
	ptr -= sizeof(block_meta_t);

	// rm block from allocated_list
	list_remove_node(&allocated_list, (block_meta_t *)ptr);

	// add block to free_list
	list_insert_node_at_end(&free_list, (block_meta_t *)ptr);
}


text:
class IgnitionCommon0 < Formula
  desc "Common libraries for robotics applications"
  homepage "https://github.com/gazebosim/gz-common"
  url "https://osrf-distributions.s3.amazonaws.com/ign-common/releases/ignition-common-0.5.0~pre4.tar.bz2"
  version "0.5.0~pre4"
  sha256 "4e9c5507a2f480a2e2dc8dd2aaa22e91905791f87745e69f918ab67304ef39a7"
  license "Apache-2.0"

  head "https://github.com/gazebosim/gz-common.git", branch: "ign-common0"

  deprecate! date: "2019-09-01", because: "is past end-of-life date"

  depends_on "cmake"
  depends_on "ffmpeg"
  depends_on "freeimage"
  depends_on "gts"
  depends_on "ignition-math4"
  depends_on "ossp-uuid"
  depends_on "pkg-config"
  depends_on "tinyxml2"

  def install
    system "cmake", ".", *std_cmake_args
    system "make", "install"
  end

  test do
    (testpath/"test.cpp").write <<-EOS
      #include <iostream>
      #include <ignition/common.hh>
      int main() {
        igndbg << "debug" << std::endl;
        ignwarn << "warn" << std::endl;
        ignerr << "error" << std::endl;
        // // this example code doesn't compile
        // try {
        //   ignthrow("An example exception that is caught.");
        // }
        // catch(const ignition::common::exception &_e) {
        //   std::cerr << "Caught a runtime error " << _e.what() << std::endl;
        // }
        // ignassert(0 == 0);
        return 0;
      }
    EOS
    (testpath/"CMakeLists.txt").write <<-EOS
      cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
      find_package(ignition-common0 QUIET REQUIRED)
      add_executable(test_cmake test.cpp)
      target_link_libraries(test_cmake ${IGNITION-COMMON_LIBRARIES})
    EOS
    system "pkg-config", "ignition-common0"
    cflags = `pkg-config --cflags ignition-common0`.split
    system ENV.cc, "test.cpp",
                   *cflags,
                   "-L#{lib}",
                   "-lignition-common0",
                   "-lc++",
                   "-o", "test"
    system "./test"
    # test building with cmake
    mkdir "build" do
      ENV.append "LIBRARY_PATH", Formula["gettext"].opt_lib
      system "cmake", ".."
      system "make"
      system "./test_cmake"
    end
  end
end


text:
        code \
        BM_POP_IGNORE_WARNING

#define BM_IGNORE_DEPRECATION_WARNING(code) BM_PUSH_IGNORE_DEPRECATION_WARNING \
        code \
        BM_POP_IGNORE_WARNING

#define BM_IGNORE_UNDECLARED_SELECTOR_WARNING(code) BM_PUSH_IGNORE_UNDECLARED_SELECTOR_WARNING \
        code \
        BM_POP_IGNORE_WARNING

#endif


text:
import { merge } from "../fp";
export = merge;


text:
@interface MNavigationPresenting()
@property (nonatomic, strong) UIPercentDrivenInteractiveTransition *transitioning;

@end

@implementation MNavigationPresenting {
    CGFloat _scrollViewBeginContentOffsetY;
}

- (void) transitionEnable {

}

- (CGFloat) heightRatio {
    if (_heightRatio <= 0) {
        _heightRatio = 0.7;
    }
    return _heightRatio;
}

- (void (^)(id<UIViewControllerContextTransitioning> transitionContext, MNavigationTransitioning *trans)) block {

    __weak __typeof(self)weakSelf = self;
    return ^(id<UIViewControllerContextTransitioning> transitionContext, MNavigationTransitioning *trans)
    {

        CGSize size = trans.containerView.bounds.size;
        trans.toView.frame = CGRectMake(0, size.height, size.width, size.height * self.heightRatio);

        UIView *snapView = [trans.fromView snapshotViewAfterScreenUpdates:NO];
        snapView.tag = 20210408;
        snapView.frame = self.containerView.frame;
        [trans.containerView insertSubview:snapView belowSubview:trans.toView];

        UIView *bgView = [[UIView alloc] initWithFrame:self.containerView.frame];
        bgView.tag = 20210409;
        bgView.alpha = 0;
        bgView.backgroundColor = [UIColor blackColor];
        [trans.containerView insertSubview:bgView belowSubview:trans.toView];

        [bgView addGestureRecognizer: [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(backgroundTapAction:)]];
        trans.fromView.hidden = YES;

         [UIView animateWithDuration:[trans transitionDuration:transitionContext]
                         animations:^
         {
             bgView.alpha = 0.4;
             trans.toView.frame = CGRectMake(0, size.height * (1 - weakSelf.heightRatio), size.width, size.height * weakSelf.heightRatio);

         }
                         completion:^(BOOL finished)
         {
            [transitionContext completeTransition:!transitionContext.transitionWasCancelled];
            if ([transitionContext transitionWasCancelled]) {
                trans.fromView.hidden = NO;
                [snapView removeFromSuperview];
                [bgView removeFromSuperview];
            }
         }];
    };
}

- (void (^)(id<UIViewControllerContextTransitioning> transitionContext, MNavigationTransitioning *trans)) endBlock {
    __weak __typeof(self)weakSelf = self;
    return ^(id<UIViewControllerContextTransitioning> transitionContext, MNavigationTransitioning *trans) {

        CGRect transFrame = trans.containerView.frame;
        __block UIView *snapView = [trans.containerView viewWithTag:20210408];
        __block UIView *bgView = [trans.containerView viewWithTag:20210409];
        [UIView animateWithDuration:[trans transitionDuration:transitionContext]
                         animations:^
         {
            bgView.alpha = 0;
            trans.fromView.frame = CGRectMake(0, CGRectGetHeight(transFrame), CGRectGetWidth(transFrame), CGRectGetHeight(transFrame));
         }
                         completion:^(BOOL finished)
         {
            [transitionContext completeTransition:!transitionContext.transitionWasCancelled];
            if (![transitionContext transitionWasCancelled]) {
                trans.toView.hidden = NO;
                [snapView removeFromSuperview];
                snapView = nil;
                [bgView removeFromSuperview];
                bgView = nil;
                !weakSelf.completeTransitionBlock?:weakSelf.completeTransitionBlock();
            }
         }];
    };
}

- (void) backgroundTapAction:(UIGestureRecognizer *) recognizer {
    !self.backViewTapedBlock?:self.backViewTapedBlock();
}

- (UIPanGestureRecognizer *)panGesture {
    if (!_panGesture) {
        _panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self
                                                              action:@selector(handlePanRecognizer:)];
        [_panGesture requireGestureRecognizerToFail:self.viewController.navigationController.interactivePopGestureRecognizer];
    }
    return _panGesture;
}

- (void)handlePanRecognizer:(UIPanGestureRecognizer*)recognizer {
    CGFloat progress = MIN(1.0, MAX(0.0, ([recognizer translationInView:recognizer.view].y - _scrollViewBeginContentOffsetY) / CGRectGetHeight(recognizer.view.bounds)));

    UIScrollView *scrollView;
    if ([recognizer.view isKindOfClass: [UIScrollView class]]) {
        scrollView = (UIScrollView *)recognizer.view;
        if (scrollView.contentOffset.y <= 0 || (_transitioning && progress > 0)) {
            [scrollView setContentOffset:CGPointZero];
        }
    }
    NSLog(@"progress = %.2f",progress);
    switch (recognizer.state) {
        case UIGestureRecognizerStateBegan:
        {
            _transitioning = [[UIPercentDrivenInteractiveTransition alloc] init];
            _transitioning.completionCurve = UIViewAnimationCurveEaseOut;
            [_transitioning updateInteractiveTransition:0];
            [self backgroundTapAction:nil];
            _scrollViewBeginContentOffsetY = scrollView.contentOffset.y;
        }
            break;
        case UIGestureRecognizerStateChanged:
        {
            [_transitioning updateInteractiveTransition:progress];
        }
            break;

        default:
        {
            if (progress > 0.25) {
                [_transitioning finishInteractiveTransition];
            }
            else {
                [_transitioning cancelInteractiveTransition];
            }
            _scrollViewBeginContentOffsetY = 0;
            _transitioning = nil;
        }
            break;
    }
}

#pragma mark -- UIViewControllerTransitioningDelegate

- (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented
                                                                            presentingController:(UIViewController *)presenting
                                                                                sourceController:(UIViewController *)source
{
    return self;
}

- (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed {
    return self;
}

- (nullable id <UIViewControllerInteractiveTransitioning>)interactionControllerForPresentation:(id <UIViewControllerAnimatedTransitioning>)animator {
    return nil;
}

- (nullable id <UIViewControllerInteractiveTransitioning>)interactionControllerForDismissal:(id <UIViewControllerAnimatedTransitioning>)animator {
    return self.transitioning;
}

@end