text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="shortcut icon" href="https://newsblur.com/media/img/favicon.ico" type="image/png" />
  <link rel="icon" href="https://newsblur.com/media/img/favicon_32.png" sizes="32x32"/>
  <link rel="icon" href="https://newsblur.com/media/img/favicon_64.png" sizes="64x64"/>
  <link rel="alternate" type="application/rss+xml"
  title="The NewsBlur Blog RSS feed"
  href="/feed.xml" />
<title>Reply to shared stories that have no comment | The NewsBlur Blog</title>
<meta name="generator" content="Jekyll v4.2.0" />
<meta property="og:title" content="Reply to shared stories that have no comment" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="Used to be that a friend shares a story without commenting on it and you'd be out of luck in trying to reply or thank them for sharing it." />
<meta property="og:description" content="Used to be that a friend shares a story without commenting on it and you'd be out of luck in trying to reply or thank them for sharing it." />
<link rel="canonical" href="https://blog.newsblur.com/2015/06/02/reply-to-shared-stories-that-have-no-comment/" />
<meta property="og:url" content="https://blog.newsblur.com/2015/06/02/reply-to-shared-stories-that-have-no-comment/" />
<meta property="og:site_name" content="The NewsBlur Blog" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2015-06-02T05:30:28-04:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="Reply to shared stories that have no comment" />

<link rel="stylesheet" href="/assets/main.css">
  <link rel="stylesheet" type="text/css" href="https://cloud.typography.com/6565292/711824/css/fonts.css" />
   <link rel="stylesheet" type="text/css" href="https://cloud.typography.com/6565292/731824/css/fonts.css" /><link type="application/atom+xml" rel="alternate" href="https://blog.newsblur.com/feed.xml" title="The NewsBlur Blog" />

The NewsBlur Blog

        <input type="checkbox" id="nav-trigger" class="nav-trigger" />

            <svg viewBox="0 0 18 15" width="18px" height="15px">
              <path d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.032C17.335,0,18,0.665,18,1.484L18,1.484z M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.032C17.335,6.031,18,6.696,18,7.516L18,7.516z M18,13.516C18,14.335,17.335,15,16.516,15H1.484 C0.665,15,0,14.335,0,13.516l0,0c0-0.82,0.665-1.483,1.484-1.483h15.032C17.335,12.031,18,12.695,18,13.516L18,13.516z"/>
            </svg>

Visit NewsBlur ➤

      NewsBlur is a personal news reader that brings people together to talk about the world.

      A new sound of an old instrument.

Reply to shared stories that have no comment

      <time class="dt-published" datetime="2015-06-02T05:30:28-04:00" itemprop="datePublished">Jun 2, 2015
      </time>

Used to be that a friend shares a story without commenting on it and you'd be out of luck in trying to reply or thank them for sharing it.

Not anymore! Comment-less shares now have the ability to be replied to and favorited. Take a look at this recent story on The People Have Spoken.

These new comments are immediately available on the web and will be coming to iOS and Android shortly.

  <data class="u-url" href="/"></data>

The NewsBlur Blog

<svg class="svg-icon"><use xlink:href="/assets/minima-social-icons.svg#github"></use></svg> samuelclay

<svg class="svg-icon"><use xlink:href="/assets/minima-social-icons.svg#twitter"></use></svg> newsblur

<svg class="svg-icon"><use xlink:href="/assets/minima-social-icons.svg#email"></use></svg> blog@newsblur.com

NewsBlur is a personal news reader that brings people together to talk about the world.

A new sound of an old instrument.


text:
package org.seleniumhq.selenium.fluent.elements;

import org.junit.Test;
import org.openqa.selenium.By;
import org.seleniumhq.selenium.fluent.BaseTest;
import org.seleniumhq.selenium.fluent.FluentExecutionStopped;
import org.seleniumhq.selenium.fluent.FluentWebElements;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.when;

public class h6 extends BaseTest {

    @Test
    public void h6_functionality() {

        setupExpectationsSingle("h6");

        FluentWebElements fe = fwd.h6()
                .h6(By.xpath("@foo = 'bar'"))
                .h6(By.cssSelector("baz"))
                .h6s();

        assertThat(fe, notNullValue());
        verificationsSingle("h6");
    }

    @Test
    public void h6_case_functionality() {

        setupExpectationsSingle("h6","h6");

        FluentWebElements fe = fwd.h6()
                .h6(By.xpath("@foo = 'bar'"))
                .h6(By.cssSelector("baz"))
                .h6s();

        assertThat(fe, notNullValue());
        verificationsSingle("h6");
    }

    @Test
    public void h6s_functionality() {

        setupExpectationsMultiple("h6");

        FluentWebElements fe = fwd.h6()
                .h6s(By.name("qux"));

        assertThat(fe, notNullValue());

        verificationsMultiple("h6");

    }

    @Test
    public void h6s_case_functionality() {

        setupExpectationsMultiple("h6","h6");

        FluentWebElements fe = fwd.h6()
                .h6s(By.name("qux"));

        assertThat(fe, notNullValue());

        verificationsMultiple("h6");

    }

    @Test
    public void h6_mismatched() {

        when(wd.findElement(By.linkText("mismatching_tag_name"))).thenReturn(we);
        when(we.getTagName()).thenReturn("boo");

        try {
            fwd.h6(By.linkText("mismatching_tag_name"))
                    .clearField();
            fail("should have barfed");
        } catch (FluentExecutionStopped e) {
            assertThat(e.getMessage(), equalTo("AssertionError during invocation of: ?.h6(By.linkText: mismatching_tag_name)"));
            assertThat(e.getCause().getMessage(), equalTo("tag was incorrect, should have been h6 but was boo"));
        }

    }

}

redpajama_set_name: RedPajamaGithub


text:
package com.intellij.build;

import com.intellij.build.events.BuildEvent;
import com.intellij.build.events.OutputBuildEvent;
import com.intellij.execution.impl.ConsoleViewImpl;
import com.intellij.execution.process.AnsiEscapeDecoder;
import com.intellij.execution.process.ProcessOutputTypes;
import com.intellij.execution.ui.ConsoleViewContentType;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Key;
import org.jetbrains.annotations.NotNull;

/**
 * @author Vladislav.Soroka
 */
public class BuildTextConsoleView extends ConsoleViewImpl implements BuildConsoleView, AnsiEscapeDecoder.ColoredTextAcceptor {
  private final AnsiEscapeDecoder myAnsiEscapeDecoder = new AnsiEscapeDecoder();

  public BuildTextConsoleView(Project project) {
    this(project, false);
  }

  public BuildTextConsoleView(@NotNull Project project, boolean viewer) {
    super(project, viewer);
  }

  @Override
  public void onEvent(BuildEvent event) {
    Key outputType = event instanceof OutputBuildEvent && !((OutputBuildEvent)event).isStdOut()
                     ? ProcessOutputTypes.STDERR : ProcessOutputTypes.STDOUT;
    myAnsiEscapeDecoder.escapeText(event.getMessage(), outputType, this);
  }

  @Override
  public void coloredTextAvailable(@NotNull String text, @NotNull Key attributes) {
    print(text, ConsoleViewContentType.getConsoleViewType(attributes));
  }
}


text:
package org.zendesk.client.v2.model.schedules;

import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonProperty;

public class Holiday implements Serializable {

    private static final long serialVersionUID = 1L;

    private String name;
    private Long id;
    private String startDate;
    private String endDate;

    /*
     * Name of the holiday
     */
    public String getName() {
        return name;
    }

    public void setName( String name ) {
        this.name = name;
    }

    /*
     * Automatically assigned upon creation
     */
    public Long getId() {
        return id;
    }

    public void setId( Long id ) {
        this.id = id;
    }

    @JsonProperty("start_date")
    public String getStartDate() {
        return startDate;
    }

    public void setStartDate( String startDate ) {
        this.startDate = startDate;
    }

    @JsonProperty("end_date")
    public String getEndDate() {
        return endDate;
    }

    public void setEndDate( String endDate ) {
        this.endDate = endDate;
    }
}


text:
<?php

class SchemaTableColumn extends SchemaComponentModel implements SchemaComponentInterface {

    private $type;
    private $length;
    private $signed;
    private $null;
    private $autoincrement;
    private $comment;

    public function __construct () {

        //TODO

    }

}

?>


text:
@import Foundation;
#import "PLAppDelegate.h"
#import <PLForm/PLFormTextField.h>
#import <PLForm/PLFloatingLabelTextField.h>
#import <PLForm/PLFloatingLabelDateField.h>
#import <PLForm/PLFloatingLabelSelectField.h>
#import <PLForm/PLFloatingLabelTextView.h>
#import <PLForm/PLFloatingLabelAutoCompleteField.h>
#import <PLForm/PLFormPinField.h>
#import <PLForm/PLFormSwitchField.h>

@implementation PLAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.

    // set some appearance
    [[PLFormTextField appearance] setBackgroundColor:[UIColor whiteColor]];
    [[PLFormTextField appearance] setCornerRadius:2];
    [[PLFormTextField appearance] setFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:14]];
    [[PLFormTextField appearance] setTextColor:[UIColor blackColor]];
    [[PLFormTextField appearance] setPlaceholderFont:[UIFont fontWithName:@"HelveticaNeue-Bold" size:14]];
    [[PLFormTextField appearance] setPlaceholderColor:[UIColor blueColor]];
    [[PLFormTextField appearance] setContentInsets:UIEdgeInsetsMake(2, 2, 2, 2)];

    [[PLFloatingLabelTextField appearance] setFloatingFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:12]];
    [[PLFloatingLabelTextField appearance] setFloatingColor:[UIColor blueColor]];

    [[PLFormDateField appearance] setBackgroundColor:[UIColor whiteColor]];
    [[PLFormDateField appearance] setCornerRadius:2];
    [[PLFormDateField appearance] setFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:14]];
    [[PLFormDateField appearance] setTextColor:[UIColor blueColor]];
    [[PLFormDateField appearance] setValueFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:14]];
    [[PLFormDateField appearance] setValueColor:[UIColor blackColor]];
    [[PLFormDateField appearance] setContentInsets:UIEdgeInsetsMake(2, 2, 2, 2)];

    [[PLFloatingLabelDateField appearance] setFloatingFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:12]];
    [[PLFloatingLabelDateField appearance] setFloatingColor:[UIColor blueColor]];

    [[PLFormSelectField appearance] setBackgroundColor:[UIColor whiteColor]];
    [[PLFormSelectField appearance] setCornerRadius:2];
    [[PLFormSelectField appearance] setFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:14]];
    [[PLFormSelectField appearance] setTextColor:[UIColor blueColor]];
    [[PLFormSelectField appearance] setValueFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:14]];
    [[PLFormSelectField appearance] setValueColor:[UIColor blackColor]];
    [[PLFormSelectField appearance] setContentInsets:UIEdgeInsetsMake(2, 2, 2, 2)];

    [[PLFloatingLabelSelectField appearance] setFloatingFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:12]];
    [[PLFloatingLabelSelectField appearance] setFloatingColor:[UIColor blueColor]];

    [[PLFormTextView appearance] setBackgroundColor:[UIColor whiteColor]];
    [[PLFormTextView appearance] setCornerRadius:2];
    [[PLFormTextView appearance] setPlaceholderColor:[UIColor blueColor]];
    [[PLFormTextView appearance] setFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:14]];
    [[PLFormTextView appearance] setTextColor:[UIColor blackColor]];
    [[PLFormTextView appearance] setContentInsets:UIEdgeInsetsMake(10, 2, 2, 2)];

    [[PLFloatingLabelTextView appearance] setFloatingFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:12]];
    [[PLFloatingLabelTextView appearance] setFloatingColor:[UIColor blueColor]];

    [[PLFormAutoCompleteField appearance] setBackgroundColor:[UIColor whiteColor]];
    [[PLFormAutoCompleteField appearance] setCornerRadius:2];
    [[PLFormAutoCompleteField appearance] setPlaceholderColor:[UIColor blueColor]];
    [[PLFormAutoCompleteField appearance] setFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:14]];
    [[PLFormAutoCompleteField appearance] setTextColor:[UIColor blackColor]];
    [[PLFormAutoCompleteField appearance] setContentInsets:UIEdgeInsetsMake(2, 2, 2, 2)];

    [[PLFloatingLabelAutoCompleteField appearance] setFloatingFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:12]];
    [[PLFloatingLabelAutoCompleteField appearance] setFloatingColor:[UIColor blueColor]];

    [[PLFormPinField appearance] setBackgroundColor:[UIColor whiteColor]];
    [[PLFormPinField appearance] setCornerRadius:2];
    [[PLFormPinDot appearance] setUnselectedBorderColor:[UIColor blackColor]];
    [[PLFormPinDot appearance] setHighlightedBorderColor:[UIColor lightGrayColor]];
    [[PLFormPinDot appearance] setSelectedBorderColor:[UIColor blueColor]];
    [[PLFormPinDot appearance] setUnselectedColor:[UIColor clearColor]];
    [[PLFormPinDot appearance] setHighlightedColor:[UIColor clearColor]];
    [[PLFormPinDot appearance] setSelectedColor:[UIColor whiteColor]];

    [[PLFormSwitchField appearance] setBackgroundColor:[UIColor whiteColor]];
    [[PLFormSwitchField appearance] setCornerRadius:2];

    [[PLFormSelectFieldItemCell appearance] setBackgroundColor:[UIColor lightGrayColor]];

    return YES;
}

- (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 throttle down OpenGL ES frame rates. 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 inactive 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:
PainterDialog::PainterDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::PainterDialog)
{

    ui->setupUi(this);

}

PainterDialog::~PainterDialog()
{
    delete ui;
}

void PainterDialog::paintEvent(QPaintEvent *)
{
    QPainter painter(this);

    painter.setRenderHint(QPainter::Antialiasing,true);
    painter.setPen(QPen(Qt::blue,2,Qt::DashDotLine,Qt::RoundCap));
    painter.setBrush(QBrush(Qt::green,Qt::SolidPattern));
    painter.drawLine(10,10,100,100);
}


text:
export * from './apis.model';
export * from './base.model';
export * from './kong.model';
export * from './menu.model';
export * from './status.model';
export * from './plugins.model';
export * from './consumers.model';
export * from './plugins';


text:
namespace Dx.Runtime.Tests.Data
{
    public class SynchronisedSimpleFieldTest
    {
        [Synchronised]
        private int Private;

        [Synchronised]
        protected int Protected;

        [Synchronised]
        public int Public;

        public int GetPrivate() { return this.Private; }
        public void SetPrivate(int value) { this.Private = value; }
        public int GetProtected() { return this.Protected; }
        public void SetProtected(int value) { this.Protected = value; }
    }
}


text:
Data acces library with a focus on portability, SQL generation and schema management.

[![Build status](https://ci.appveyor.com/api/projects/status/mtl928g1po4pmt74?svg=true)](https://ci.appveyor.com/project/okhosting/okhosting-sql)

[![Join the chat at https://gitter.im/okhosting/OKHOSTING.SQL](https://badges.gitter.im/okhosting/OKHOSTING.SQL.svg)](https://gitter.im/okhosting/OKHOSTING.SQL?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

## Download

```
PM> Install-Package OKHOSTING.SQL
PM> Install-Package OKHOSTING.SQL.Hosting
PM> Install-Package OKHOSTING.SQL.DbProviders.PostgreSQL
PM> Install-Package OKHOSTING.SQL.DbProviders.MySql
PM> Install-Package OKHOSTING.SQL.DbProviders.MySql.Hosting
PM> Install-Package OKHOSTING.SQL.DbProviders.Odbc
PM> Install-Package OKHOSTING.SQL.DbProviders.SQLite
PM> Install-Package OKHOSTING.SQL.DbProviders.SqlServer
PM> Install-Package OKHOSTING.SQL.DbProviders.SqlServer.Hosting
PM> Install-Package OKHOSTING.SQL.UI
```

## netstandard2, usable from any device

* Generate SQL code for Create and Drop tables, columns, indexes, and foreign keys
* Generate SQL code for Insert, Select, Delete, Update, Create & Drop operations, without writing SQL code yourself
* Select operation is capable of using joins, aggregation, group by, sort, limit, pretty much everything supported
* Generate SQL code specific for MySQL
* Generate SQL code specific for SQLite
* Generate SQL code specific for SqlServer
* Generate SQL code specific for PostgreSQL
* Execute commands and read data from MySql
* Execute commands and read data from SQLite
* Execute commands and read data from SqlServer
* Execute commands and read data from PostgreSQL

## Examples

This examples are taken from https://github.com/okhosting/OKHOSTING.SQL/tree/master/test/OKHOSTING.SQL.Tests

### Create the schema (tables, indexes and foreign keys) from code

```csharp
var db = new DbProviders.MySql.DataBase() { ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["mysql"].ConnectionString };

var generator = new DbProviders.MySql.SqlGenerator();

// create customer table
Table customer = new Table("customer");
customer.Columns.Add(new Column() { Name = "Id", DbType = DbType.Int32, IsPrimaryKey = true, IsAutoNumber = true, Table = customer });
customer.Columns.Add(new Column() { Name = "Name", DbType = DbType.AnsiString, Length = 100, IsNullable = false, Table = customer });
customer.Columns.Add(new Column() { Name = "Country", DbType = DbType.Int32, IsNullable = false, Table = customer });

// create country table
Table country = new Table("country");
country.Columns.Add(new Column() { Name = "Id", DbType = DbType.Int32, IsPrimaryKey = true, IsAutoNumber = true, Table = country });
country.Columns.Add(new Column() { Name = "Name", DbType = DbType.AnsiString, Length = 100, IsNullable = false, Table = country });

// create a foreign key
ForeignKey countryFK = new ForeignKey();
countryFK.Table = customer;
countryFK.RemoteTable = country;
countryFK.Name = "FK_customer_country";
countryFK.Columns.Add(new Tuple<Column, Column>(customer["Country"], country["id"]));
countryFK.DeleteAction = countryFK.UpdateAction = ConstraintAction.Restrict;

// get SQL code for creating customer table
var sql = generator.Create(customer);

// execute that code and actually create table in DB
db.Execute(sql);

// same for country
sql = generator.Create(country);
db.Execute(sql);

// same for foreigk key
sql = generator.Create(countryFK);
db.Execute(sql);
```
### Reade the schema from the DataBase (Net4 only, thanks to DatabaseSchemaReader)

```csharp
//this way you can just read the existing tables from DB and then perform Insert, Select, Update or Delete operations
//on the tables without the need to manually creating schema like in the previous sample
DbProviders.MySql.DataBase db = new DbProviders.MySql.DataBase() { ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["mysql"].ConnectionString };
db.LoadSchema();
DataBaseSchema schema = db.Schema;
Table customerTable = schema["cuctomer"];
```

### Insert

```csharp
Insert insert2 = new Insert();
insert2.Table = country;
insert2.Values.Add(new ColumnValue(country["Id"], 1));
insert2.Values.Add(new ColumnValue(country["Name"], "Mexico"));

sql = generator.Insert(insert2);
int affectedRows2 = db.Execute(sql);
Assert.AreEqual(affectedRows2, 1);

Insert insert = new Insert();
insert.Table = customer;
insert.Values.Add(new ColumnValue(customer["Id"], 1));
insert.Values.Add(new ColumnValue(customer["Name"], "Angel"));
insert.Values.Add(new ColumnValue(customer["Country"], 1));

sql = generator.Insert(insert);
int affectedRows = db.Execute(sql);
Assert.AreEqual(affectedRows, 1);
```

### Select

```csharp
Select select = new Select();
select.Table = customer;
select.Columns.Add(new SelectColumn(customer["id"]));
select.Columns.Add(new SelectColumn(customer["Name"]));

// create a join between customer and country
SelectJoin join = new SelectJoin();
join.Table = country;
join.On.Add(new ColumnCompareFilter() { Column = customer["country"], ColumnToCompare = country["id"], Operator = Data.CompareOperator.Equal });
join.Columns.Add(new SelectColumn(country["name"], "countryName"));
join.JoinType = SelectJoinType.Inner;

select.Joins.Add(join);

sql = generator.Select(select);
var result = db.GetDataTable(sql);

// get results
foreach (IDataRow row in result)
{
	foreach (object obj in row)
	{
		Console.Write(obj);
	}
}
```

### Select Max (or any aggregation function)

```csharp

SelectAggregate selectMax = new SelectAggregate();
selectMax.Table = customer;
selectMax.AggregateColumns.Add(new SelectAggregateColumn(customer["Id"], SelectAggregateFunction.Maximum));

sql = generator.Select(selectMax);
int max = (int) db.GetScalar(sql);
```

### Update

```csharp
Update update = new Update();
update.Table = customer;
update.Set.Add(new ColumnValue(customer["Name"], "New company name"));
update.Where.Add(new ValueCompareFilter() { Column = customer["id"], ValueToCompare = 1 });

sql = generator.Update(update);
affectedRows = db.Execute(sql);
```

### Delete

```csharp
Delete delete = new Delete();
delete.Table = table;
delete.Where.Add(new ValueCompareFilter() { Column = table["Company"], ValueToCompare = "Monsters Inc. Corporate", Operator = Data.CompareOperator.Equal });

sql = generator.Delete(delete);
affectedRows = db.Execute(sql);
```

## Add automatic UI generation for CRUD

OKHOSTING.ORM.UI is the sum of the ORM and the UI framework to bring you autogenerated CRUD applications that work on any device, any database and with any class.

https://github.com/okhosting/OKHOSTING.UI


text:
import abc

from neutron_lib.db import api as db_api
from neutron_lib.plugins import constants
from neutron_lib.plugins import directory
from oslo_config import cfg
from oslo_log import log
from oslo_utils import excutils
from sqlalchemy import exc as sql_exc
from sqlalchemy.orm import session as se

from neutron._i18n import _
from neutron.conf import quota as quota_conf
from neutron.db.quota import api as quota_api

LOG = log.getLogger(__name__)

def _count_resource(context, collection_name, project_id):
    count_getter_name = "get_%s_count" % collection_name
    getter_name = "get_%s" % collection_name

    plugins = directory.get_plugins()
    for pname in sorted(plugins,
                        # inspect core plugin first
                        key=lambda n: n != constants.CORE):
        # Some plugins support a count method for particular resources, using a
        # DB's optimized counting features. We try to use that one if present.
        # Otherwise just use regular getter to retrieve all objects and count
        # in python, allowing older plugins to still be supported
        try:
            obj_count_getter = getattr(plugins[pname], count_getter_name)
            return obj_count_getter(
                context, filters={'project_id': [project_id]})
        except (NotImplementedError, AttributeError):
            try:
                obj_getter = getattr(plugins[pname], getter_name)
                obj_list = obj_getter(
                    context, filters={'project_id': [project_id]})
                return len(obj_list) if obj_list else 0
            except (NotImplementedError, AttributeError):
                pass
    raise NotImplementedError(
        _('No plugins that support counting %s found.') % collection_name)

class BaseResource(object, metaclass=abc.ABCMeta):
    """Describe a single resource for quota checking."""

    def __init__(self, name, flag, plural_name=None):
        """Initializes a resource.

        :param name: The name of the resource, i.e., "instances".
        :param flag: The name of the flag or configuration option
        :param plural_name: Plural form of the resource name. If not
                            specified, it is generated automatically by
                            appending an 's' to the resource name, unless
                            it ends with a 'y'. In that case the last
                            letter is removed, and 'ies' is appended.
                            Dashes are always converted to underscores.
        """

        self.name = name
        # If a plural name is not supplied, default to adding an 's' to
        # the resource name, unless the resource name ends in 'y', in which
        # case remove the 'y' and add 'ies'. Even if the code should not fiddle
        # too much with English grammar, this is a rather common and easy to
        # implement rule.
        if plural_name:
            self.plural_name = plural_name
        elif self.name[-1] == 'y':
            self.plural_name = "%sies" % self.name[:-1]
        else:
            self.plural_name = "%ss" % self.name
        # always convert dashes to underscores
        self.plural_name = self.plural_name.replace('-', '_')
        self.flag = flag

    @property
    def default(self):
        """Return the default value of the quota."""
        # Any negative value will be interpreted as an infinite quota,
        # and stored as -1 for compatibility with current behaviour
        value = getattr(cfg.CONF.QUOTAS,
                        self.flag,
                        cfg.CONF.QUOTAS.default_quota)
        return max(value, quota_api.UNLIMITED_QUOTA)

    @property
    @abc.abstractmethod
    def dirty(self):
        """Return the current state of the Resource instance.

        :returns: True if the resource count is out of sync with actual date,
                  False if it is in sync, and None if the resource instance
                  does not track usage.
        """

    @abc.abstractmethod
    def count(self, context, plugin, project_id, **kwargs):
        """Return the total count of this resource"""

class CountableResource(BaseResource):
    """Describe a resource where the counts are determined by a function."""

    def __init__(self, name, count, flag=None, plural_name=None):
        """Initializes a CountableResource.

        Countable resources are those resources which directly
        correspond to objects in the database, i.e., network, subnet,
        etc.,.  A CountableResource must be constructed with a counting
        function, which will be called to determine the current counts
        of the resource.

        The counting function will be passed the context, along with
        the extra positional and keyword arguments that are passed to
        Quota.count().  It should return an integer specifying the
        count.

        :param name: The name of the resource, i.e., "instances".
        :param count: A callable which returns the count of the
                      resource. The arguments passed are as described
                      above.
        :param flag: The name of the flag or configuration option
                     which specifies the default value of the quota
                     for this resource.
        :param plural_name: Plural form of the resource name. If not
                            specified, it is generated automatically by
                            appending an 's' to the resource name, unless
                            it ends with a 'y'. In that case the last
                            letter is removed, and 'ies' is appended.
                            Dashes are always converted to underscores.
        """

        super(CountableResource, self).__init__(
            name, flag=flag, plural_name=plural_name)
        self._count_func = count

    @property
    def dirty(self):
        return

    def count(self, context, plugin, project_id, **kwargs):
        # NOTE(ihrachys) _count_resource doesn't receive plugin
        return self._count_func(context, self.plural_name, project_id)

class TrackedResource(BaseResource):
    """Resource which keeps track of its usage data."""

    def __init__(self, name, model_class, flag, plural_name=None):
        """Initializes an instance for a given resource.

        TrackedResource are directly mapped to data model classes.
        Resource usage is tracked in the database, and the model class to
        which this resource refers is monitored to ensure always "fresh"
        usage data are employed when performing quota checks.

        This class operates under the assumption that the model class
        describing the resource has a project identifier attribute.

        :param name: The name of the resource, i.e., "networks".
        :param model_class: The sqlalchemy model class of the resource for
                            which this instance is being created
        :param flag: The name of the flag or configuration option
                     which specifies the default value of the quota
                     for this resource.
        :param plural_name: Plural form of the resource name. If not
                            specified, it is generated automatically by
                            appending an 's' to the resource name, unless
                            it ends with a 'y'. In that case the last
                            letter is removed, and 'ies' is appended.
                            Dashes are always converted to underscores.

        """
        super(TrackedResource, self).__init__(
            name, flag=flag, plural_name=plural_name)
        # Register events for addition/removal of records in the model class
        # As project_id is immutable for all Neutron objects there is no need
        # to register a listener for update events
        self._model_class = model_class
        self._dirty_projects = set()
        self._out_of_sync_projects = set()
        # NOTE(ralonsoh): "DbQuotaNoLockDriver" driver does not need to track
        # the DB events or resync the resource quota usage.
        if cfg.CONF.QUOTAS.quota_driver == quota_conf.QUOTA_DB_DRIVER:
            self._track_resource_events = False
        else:
            self._track_resource_events = True

    @property
    def dirty(self):
        if not self._track_resource_events:
            return
        return self._dirty_projects

    def mark_dirty(self, context):
        if not self._dirty_projects or not self._track_resource_events:
            return
        with db_api.CONTEXT_WRITER.using(context):
            # It is not necessary to protect this operation with a lock.
            # Indeed when this method is called the request has been processed
            # and therefore all resources created or deleted.
            # dirty_projects will contain all the projects for which the
            # resource count is changed. The list might contain also projects
            # for which resource count was altered in other requests, but this
            # won't be harmful.
            dirty_projects_snap = self._dirty_projects.copy()
            for project_id in dirty_projects_snap:
                quota_api.set_quota_usage_dirty(context, self.name, project_id)
        self._out_of_sync_projects |= dirty_projects_snap
        self._dirty_projects -= dirty_projects_snap

    def _db_event_handler(self, mapper, _conn, target):
        try:
            project_id = target['project_id']
        except AttributeError:
            with excutils.save_and_reraise_exception():
                LOG.error("Model class %s does not have a project_id "
                          "attribute", target)
        self._dirty_projects.add(project_id)

    # Retry the operation if a duplicate entry exception is raised. This
    # can happen is two or more workers are trying to create a resource of a
    # give kind for the same project concurrently. Retrying the operation will
    # ensure that an UPDATE statement is emitted rather than an INSERT one
    @db_api.retry_if_session_inactive()
    def _set_quota_usage(self, context, project_id, in_use):
        return quota_api.set_quota_usage(
            context, self.name, project_id, in_use=in_use)

    def _resync(self, context, project_id, in_use):
        # Update quota usage
        usage_info = self._set_quota_usage(context, project_id, in_use)

        self._dirty_projects.discard(project_id)
        self._out_of_sync_projects.discard(project_id)
        LOG.debug(("Unset dirty status for project:%(project_id)s on "
                   "resource:%(resource)s"),
                  {'project_id': project_id, 'resource': self.name})
        return usage_info

    def resync(self, context, project_id):
        if (project_id not in self._out_of_sync_projects or
                not self._track_resource_events):
            return
        LOG.debug(("Synchronizing usage tracker for project:%(project_id)s on "
                   "resource:%(resource)s"),
                  {'project_id': project_id, 'resource': self.name})
        in_use = context.session.query(
            self._model_class.project_id).filter_by(
                project_id=project_id).count()
        # Update quota usage
        return self._resync(context, project_id, in_use)

    @db_api.CONTEXT_WRITER
    def count_used(self, context, project_id, resync_usage=True):
        """Returns the current usage count for the resource.

        :param context: The request context.
        :param project_id: The ID of the project
        :param resync_usage: Default value is set to True. Syncs
            with in_use usage.
        """
        # Load current usage data, setting a row-level lock on the DB
        usage_info = quota_api.get_quota_usage_by_resource_and_project(
            context, self.name, project_id)

        # If dirty or missing, calculate actual resource usage querying
        # the database and set/create usage info data
        # NOTE: this routine "trusts" usage counters at service startup. This
        # assumption is generally valid, but if the database is tampered with,
        # or if data migrations do not take care of usage counters, the
        # assumption will not hold anymore
        if (project_id in self._dirty_projects or
                not usage_info or usage_info.dirty):
            LOG.debug(("Usage tracker for resource:%(resource)s and project:"
                       "%(project_id)s is out of sync, need to count used "
                       "quota"), {'resource': self.name,
                                  'project_id': project_id})
            in_use = context.session.query(
                self._model_class.project_id).filter_by(
                    project_id=project_id).count()

            # Update quota usage, if requested (by default do not do that, as
            # typically one counts before adding a record, and that would mark
            # the usage counter as dirty again)
            if resync_usage:
                usage_info = self._resync(context, project_id, in_use)
            else:
                resource = usage_info.resource if usage_info else self.name
                project_id = (usage_info.project_id if usage_info else
                              project_id)
                dirty = usage_info.dirty if usage_info else True
                usage_info = quota_api.QuotaUsageInfo(
                    resource, project_id, in_use, dirty)

            LOG.debug(("Quota usage for %(resource)s was recalculated. "
                       "Used quota:%(used)d."),
                      {'resource': self.name,
                       'used': usage_info.used})
        return usage_info.used

    def count_reserved(self, context, project_id):
        """Return the current reservation count for the resource."""
        # NOTE(princenana) Current implementation of reservations
        # is ephemeral and returns the default value
        reservations = quota_api.get_reservations_for_resources(
            context, project_id, [self.name])
        reserved = reservations.get(self.name, 0)
        return reserved

    def count(self, context, _plugin, project_id, resync_usage=True,
              count_db_registers=False):
        """Return the count of the resource.

        The _plugin parameter is unused but kept for
        compatibility with the signature of the count method for
        CountableResource instances.
        """
        if count_db_registers:
            count = self.count_db_registers(context, project_id)
        else:
            count = self.count_used(context, project_id, resync_usage)

        return count + self.count_reserved(context, project_id)

    def count_db_registers(self, context, project_id):
        """Return the existing resources (self._model_class) in a project.

        The query executed must be as fast as possible. To avoid retrieving all
        model backref relationship columns, only "project_id" is requested
        (this column always exists in the DB model because is used in the
        filter).
        """
        # TODO(ralonsoh): declare the OVO class instead the DB model and use
        # ``NeutronDbObject.count`` with the needed filters and fields to
        # retrieve ("project_id").
        admin_context = context.elevated()
        with db_api.CONTEXT_READER.using(admin_context):
            query = admin_context.session.query(self._model_class.project_id)
            query = query.filter(self._model_class.project_id == project_id)
            return query.count()

    def _except_bulk_delete(self, delete_context):
        if delete_context.mapper.class_ == self._model_class:
            raise RuntimeError(_("%s may not be deleted in bulk because "
                                 "it is tracked by the quota engine via "
                                 "SQLAlchemy event handlers, which are not "
                                 "compatible with bulk deletes.") %
                               self._model_class)

    def register_events(self):
        if not self._track_resource_events:
            return
        listen = db_api.sqla_listen
        listen(self._model_class, 'after_insert', self._db_event_handler)
        listen(self._model_class, 'after_delete', self._db_event_handler)
        listen(se.Session, 'after_bulk_delete', self._except_bulk_delete)

    def unregister_events(self):
        if not self._track_resource_events:
            return
        try:
            db_api.sqla_remove(self._model_class, 'after_insert',
                               self._db_event_handler)
            db_api.sqla_remove(self._model_class, 'after_delete',
                               self._db_event_handler)
            db_api.sqla_remove(se.Session, 'after_bulk_delete',
                               self._except_bulk_delete)
        except sql_exc.InvalidRequestError:
            LOG.warning("No sqlalchemy event for resource %s found",
                        self.name)


text:
module Zewo
  VERSION = "0.3".freeze
end


text:
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <fcntl.h>
#include <time.h>
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif

#include "ext2_fs.h"
#include "ext2fs.h"

/*
 * This routine sanity checks the group descriptors
 */
errcode_t ext2fs_check_desc(ext2_filsys fs)
{
	int i;
	blk_t block = fs->super->s_first_data_block;
	blk_t next;

	EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);

	for (i = 0; i < fs->group_desc_count; i++) {
		next = block + fs->super->s_blocks_per_group;
		/*
		 * Check to make sure block bitmap for group is
		 * located within the group.
		 */
		if (fs->group_desc[i].bg_block_bitmap < block ||
		    fs->group_desc[i].bg_block_bitmap >= next)
			return EXT2_ET_GDESC_BAD_BLOCK_MAP;
		/*
		 * Check to make sure inode bitmap for group is
		 * located within the group
		 */
		if (fs->group_desc[i].bg_inode_bitmap < block ||
		    fs->group_desc[i].bg_inode_bitmap >= next)
			return EXT2_ET_GDESC_BAD_INODE_MAP;
		/*
		 * Check to make sure inode table for group is located
		 * within the group
		 */
		if (fs->group_desc[i].bg_inode_table < block ||
		    ((fs->group_desc[i].bg_inode_table +
		      fs->inode_blocks_per_group) >= next))
			return EXT2_ET_GDESC_BAD_INODE_TABLE;

		block = next;
	}
	return 0;
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.03.23 at 01:49:06 PM CET
//

package org.sdmx.resources.sdmxml.schemas.v2_0.message;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.sdmx.resources.sdmxml.schemas.v2_0.compact.DataSetType;

/**
 * CompactDataType defines the contents of a CompactData message.
 *
 *
Java class for CompactDataType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="CompactDataType">
 *   <complexContent>
 *     <extension base="{http://www.SDMX.org/resources/SDMXML/schemas/v2_0/message}MessageType">
 *       <sequence>
 *         <element ref="{http://www.SDMX.org/resources/SDMXML/schemas/v2_0/compact}DataSet"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CompactDataType", propOrder = {
    "dataSet"
})
public class CompactDataType
    extends MessageType
{

    @XmlElement(name = "DataSet", namespace = "http://www.SDMX.org/resources/SDMXML/schemas/v2_0/compact", required = true)
    protected DataSetType dataSet;

    /**
     * Gets the value of the dataSet property.
     *
     * @return
     *     possible object is
     *     {@link DataSetType }
     *
     */
    public DataSetType getDataSet() {
        return dataSet;
    }

    /**
     * Sets the value of the dataSet property.
     *
     * @param value
     *     allowed object is
     *     {@link DataSetType }
     *
     */
    public void setDataSet(DataSetType value) {
        this.dataSet = value;
    }

}


text:
<!DOCTYPE HTML>
<style>
body { width: 450px }
select { font-size: 12px }
</style>
<!--
In a 450px container, the minimum font size at 15em per line is 30px.
This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
-->
<select size="3">
  <optgroup label="Counties">
    <option>Arlington
    <option>Fairfax
    <option>Loudon
    <option>Prince William
  <optgroup label="Cities">
    <option>Alexandria
    <option>Falls Church
    <option>Manassas
    <option>Manassas Park
</select>


text:
module Azure::ContainerInstance::Mgmt::V2018_10_01
  module Models
    #
    # Container group diagnostic information.
    #
    class ContainerGroupDiagnostics

      include MsRestAzure

      # @return [LogAnalytics] Container group log analytics information.
      attr_accessor :log_analytics

      #
      # Mapper for ContainerGroupDiagnostics class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'ContainerGroupDiagnostics',
          type: {
            name: 'Composite',
            class_name: 'ContainerGroupDiagnostics',
            model_properties: {
              log_analytics: {
                client_side_validation: true,
                required: false,
                serialized_name: 'logAnalytics',
                type: {
                  name: 'Composite',
                  class_name: 'LogAnalytics'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
package com.itjiehun.bootmanager.apk;

import java.io.ByteArrayOutputStream;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.graphics.Bitmap;

public class DbHelper extends SQLiteOpenHelper {

	private static final String CREATE_CACHE_TABLE = "CREATE TABLE cache_table (pkg TEXT PRIMARY KEY, appName TEXT, icon BLOB);";

	public static final String DATABASE_NAME = "uninstall.db";
	public static final int DATABASE_VERSION = 2;
	public static final String TABLE_CACHE = "cache_table";
	public static final String TABLE_LOG = "log_table";

	public DbHelper(Context paramContext) {
		super(paramContext, "uninstall.db", null, 2);
	}

	public Cursor getApkCacheCursor() {
		return getWritableDatabase().query("cache_table", null, null, null, null, null, null);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		onUpgrade(db, 0, 2);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		if (oldVersion < 1) {
			db.execSQL(CREATE_CACHE_TABLE);
		}
	}

	public long saveApkCache(ApkCacheHelper.ApkCache paramApkCache) {
		ContentValues localContentValues = new ContentValues();
		ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
		Bitmap localBitmap = Uitils.drawableToBitmap(paramApkCache.icon);
		if (localBitmap != null) {
			localBitmap.compress(Bitmap.CompressFormat.PNG, 100, localByteArrayOutputStream);
			localContentValues.put("icon", localByteArrayOutputStream.toByteArray());
		}
		localContentValues.put("pkg", paramApkCache.pkgName);
		localContentValues.put("appName", paramApkCache.appName);
		return getWritableDatabase().insert("cache_table", null, localContentValues);
	}
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<TITLE>Man page of MPROTECT</TITLE>

MPROTECT

Section: Linux Programmer's Manual (2)
Updated: 2014-01-05
Index
Return to Main Contents

NAME

mprotect - set protection on a region of memory

SYNOPSIS

#include <sys/mman.h>

int mprotect(void *addr, size_t len, int prot);

DESCRIPTION

mprotect()

changes protection for the calling process's memory page(s)
containing any part of the address range in the
interval [addr, addr+len-1].
addr

must be aligned to a page boundary.

If the calling process tries to access memory in a manner
that violates the protection, then the kernel generates a
SIGSEGV

signal for the process.

prot

is either
PROT_NONE

or a bitwise-or of the other values in the following list:

PROT_NONE

The memory cannot be accessed at all.

PROT_READ

The memory can be read.

PROT_WRITE

The memory can be modified.

PROT_EXEC

The memory can be executed.

RETURN VALUE

On success,
mprotect()

returns zero.
On error, -1 is returned, and
errno

is set appropriately.

ERRORS

EACCES

The memory cannot be given the specified access.
This can happen, for example, if you
mmap(2)

a file to which you have read-only access, then ask
mprotect()

to mark it
PROT_WRITE.

EINVAL

addr is not a valid pointer,
or not a multiple of the system page size.

ENOMEM

Internal kernel structures could not be allocated.

ENOMEM

Addresses in the range
[addr,

addr+len-1]

are invalid for the address space of the process,
or specify one or more pages that are not mapped.
(Before kernel 2.4.19, the error
EFAULT

was incorrectly produced for these cases.)

CONFORMING TO

SVr4, POSIX.1-2001.

POSIX says that the behavior of
mprotect()

is unspecified if it is applied to a region of memory that
was not obtained via
mmap(2).

NOTES

On Linux it is always permissible to call
mprotect()

on any address in a process's address space (except for the
kernel vsyscall area).
In particular it can be used
to change existing code mappings to be writable.

Whether
PROT_EXEC

has any effect different from
PROT_READ

is architecture- and kernel version-dependent.
On some hardware architectures (e.g., i386),
PROT_WRITE

implies
PROT_READ.

POSIX.1-2001 says that an implementation may permit access
other than that specified in
prot,

but at a minimum can allow write access only if
PROT_WRITE

has been set, and must not allow any access if
PROT_NONE

has been set.

EXAMPLE

The program below allocates four pages of memory, makes the third
of these pages read-only, and then executes a loop that walks upward
through the allocated region modifying bytes.

An example of what we might see when running the program is the
following:

$ ./a.out
Start of region:        0x804c000
Got SIGSEGV at address: 0x804e000

Program source

#include <unistd.h>
#include <signal.h>
#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/mman.h>

#define handle_error(msg) \
    do { perror(msg); exit(EXIT_FAILURE); } while (0)

static char *buffer;

static void
handler(int sig, siginfo_t *si, void *unused)
{
    printf("Got SIGSEGV at address: 0x%lx\n",
            (long) si->si_addr);
    exit(EXIT_FAILURE);
}

int
main(int argc, char *argv[])
{
    char *p;
    int pagesize;
    struct sigaction sa;

    sa.sa_flags = SA_SIGINFO;
    sigemptyset(&sa.sa_mask);
    sa.sa_sigaction = handler;
    if (sigaction(SIGSEGV, &sa, NULL) == -1)
        handle_error("sigaction");

    pagesize = sysconf(_SC_PAGE_SIZE);
    if (pagesize == -1)
        handle_error("sysconf");

    /* Allocate a buffer aligned on a page boundary;
       initial protection is PROT_READ | PROT_WRITE */

    buffer = memalign(pagesize, 4 * pagesize);
    if (buffer == NULL)
        handle_error("memalign");

    printf("Start of region:        0x%lx\n", (long) buffer);

    if (mprotect(buffer + pagesize * 2, pagesize,
                PROT_READ) == -1)
        handle_error("mprotect");

    for (p = buffer ; ; )
        *(p++) = 'a';

    printf("Loop completed\n");     /* Should never happen */
    exit(EXIT_SUCCESS);
}

SEE ALSO

mmap(2),

sysconf(3)

Index

NAME

SYNOPSIS

DESCRIPTION

RETURN VALUE

ERRORS

CONFORMING TO

NOTES

EXAMPLE

Program source

SEE ALSO

This document was created by
man2html,
using the manual pages.

Time: 02:54:49 GMT, September 18, 2014


text:
using System;
using System.Collections;
using NUnit.Framework.Internal;
using NUnit.Framework.Internal.Commands;
using UnityEngine.TestRunner.NUnitExtensions.Runner;

namespace UnityEngine.TestTools
{
    internal class ImmediateEnumerableCommand : DelegatingTestCommand
    {
        public ImmediateEnumerableCommand(TestCommand innerCommand)
            : base(innerCommand) { }

        public override TestResult Execute(ITestExecutionContext context)
        {
            if (innerCommand is IEnumerableTestMethodCommand)
            {
                var executeEnumerable = ((IEnumerableTestMethodCommand)innerCommand).ExecuteEnumerable(context);
                foreach (var iterator in executeEnumerable)
                {
                    if (iterator != null)
                    {
                        throw new Exception("Only null can be yielded at this point.");
                    }
                }
                return context.CurrentResult;
            }

            return innerCommand.Execute(context);
        }
    }
}


text:
#!/usr/bin/env php
<?php
/**
 * Generic CLI parser tests.
 *
 * These are not unit tests. They are just plain parser tests.
 * @author M Butcher <matt@aleph-null.tv>
 * @license The GNU Lesser GPL (LGPL) or an MIT-like license.
 */
require '../src/QueryPath/QueryPath.php';
//$str = 'abc > def.g |: hi(jk)[lmn]*op';
//$str = '&abc.def';

/**
 * Testing harness for the CssEventHandler.
 * @ingroup querypath_tests
 */
class SimpleTestCssEventHandler implements CssEventHandler {
  var $stack = NULL;
  var $expect = array();

  public function __construct() {
    $this->stack = array();
  }

  public function getStack() {
    return $this->stack;
  }

  public function dumpStack() {
    print "\nExpected:\n";
    $format = "Element %d: %s\n";
    foreach ($this->expect as $item) {
      printf($format, $item->eventType(), implode(',', $item->params()));
    }

    print "Got:\n";
    foreach($this->stack as $item){
      printf($format, $item->eventType(), implode(',', $item->params()));
    }
  }

  public function expects($stack) {
    $this->expect = $stack;
  }

  public function success() {
    return ($this->expect == $this->stack);
  }

  public function elementID($id) {
    $this->stack[] = new TestEvent(TestEvent::elementID, $id);
  }
  public function element($name) {
    $this->stack[] = new TestEvent(TestEvent::element, $name);
  }
  public function elementNS($name, $namespace = NULL){
    $this->stack[] = new TestEvent(TestEvent::elementNS, $name, $namespace);
  }
  public function anyElement(){
    $this->stack[] = new TestEvent(TestEvent::anyElement);
  }
  public function anyElementInNS($ns){
    $this->stack[] = new TestEvent(TestEvent::anyElementInNS, $ns);
  }
  public function elementClass($name){
    $this->stack[] = new TestEvent(TestEvent::elementClass, $name);
  }
  public function attribute($name, $value = NULL, $operation = CssEventHandler::isExactly){
    $this->stack[] = new TestEvent(TestEvent::attribute, $name, $value, $operation);
  }
  public function attributeNS($name, $ns, $value = NULL, $operation = CssEventHandler::isExactly){
    $this->stack[] = new TestEvent(TestEvent::attributeNS, $name, $ns, $value, $operation);
  }
  public function pseudoClass($name, $value = NULL){
    $this->stack[] = new TestEvent(TestEvent::pseudoClass, $name, $value);
  }
  public function pseudoElement($name){
    $this->stack[] = new TestEvent(TestEvent::pseudoElement, $name);
  }
  public function directDescendant(){
    $this->stack[] = new TestEvent(TestEvent::directDescendant);
  }
  public function anyDescendant() {
    $this->stack[] = new TestEvent(TestEvent::anyDescendant);
  }
  public function adjacent(){
    $this->stack[] = new TestEvent(TestEvent::adjacent);
  }
  public function anotherSelector(){
    $this->stack[] = new TestEvent(TestEvent::anotherSelector);
  }
  public function sibling(){
    $this->stack[] = new TestEvent(TestEvent::sibling);
  }
}

/**
 * Simple utility object for use with the TestCssEventHandler.
 * @ingroup querypath_tests
 */
class TestEvent {
  const elementID = 0;
  const element = 1;
  const elementNS = 2;
  const anyElement = 3;
  const elementClass = 4;
  const attribute = 5;
  const attributeNS = 6;
  const pseudoClass = 7;
  const pseudoElement = 8;
  const directDescendant = 9;
  const adjacent = 10;
  const anotherSelector = 11;
  const sibling = 12;
  const anyElementInNS = 13;
  const anyDescendant = 14;

  var $type = NULL;
  var $params = NULL;

  public function __construct($event_type) {

    $this->type = $event_type;
    $args = func_get_args();
    array_shift($args);
    $this->params = $args;

    print "Event " . $event_type;
    print_r($args);
  }

  public function eventType() {
    return $this->type;
  }

  public function params() {
    return $this->params;
  }
}

print ord('"');
#$str = 'tag.class #id :test (test) + anotherElement > yetAnother[test] more[test="ing"]';
$str = 'tag.class #id :test (test)';
print "Now testing: $str\n";

$c = new SimpleTestCssEventHandler();

$p = new CssParser($str, $c);
$p->parse();


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Arc - XXXXXXXX</title>
    <meta name="description" content="Arc - .">
    <link href="css/bootstrap.css" rel="stylesheet" >
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">

    <link href="assets/styles.css" rel="stylesheet" type="text/css">

                                <button type="button" class="nav-button pull-right navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                                    Toggle navigation

                                </button>

Home

Services

                                                    Weld Overlay Cladding
                                                Lorem
ipsum
dolor emmet

                                                    Fabrication SpecialistsLorem
ipsum
dolor emmet

ASME U + U2 Stamp AccreditationsLorem
ipsum
dolor emmet

Design & ManagementLorem
ipsum
dolor emmet

Sectors

Accreditations

ISO 9001Lorem
ipsum
dolor emmet

ISO 14001Lorem
ipsum
dolor emmet

ISO 3834-2Lorem
ipsum
dolor emmet

OHSAS 18001Lorem
ipsum
dolor emmet

ASME U + U2 & UBLorem
ipsum
dolor emmet

IIP SILVERLorem
ipsum
dolor emmet

News

About us

Contact

Accreditations

We aim to produce a high quality product and to assure our customers
 that products have been produced to the desired standards

        Home > Accreditations

ISO 9001

                        Quality Managements

                        System

ISO 9001

                        Quality Management

                        System

ISO 9001

                        Quality Management

                        System

ISO 9001

                        Quality Management

                        System

ISO 9001

                        Quality Management

                        System

ISO 9001

                        Quality Management

                        System

ISO 9001

                        Quality Management

                        System

ISO 9001

                       Quality Management

                        System

ISO 9001

                        Quality Management

                        System

ISO 9001

                        Quality Management

                        System

ISO 9001

                        Quality Management

                        System

ISO 9001

                        Quality Management

                        System

Email us: sales@arcenergy.co.uk

Call us: +44(0) 1453 823 523

Copyright Arc Energy 2017|

Legal Information|

Privacy Policy|

Site Map

                            <address>
                                  Arc Energy Limited, Unit 12, Eastington Industrial Estate,
 Meadow Mill, Eastington, Gloucestershire, GL10 3RZ, UK
                            </address>


text:
namespace Newtonsoft.Json.Tests.TestObjects
{
    public class SetOnlyPropertyClass2
    {
        private object _value;

        public object SetOnlyProperty
        {
            set { _value = value; }
        }

        public object GetValue()
        {
            return _value;
        }
    }
}


text:
sap.ui.define([
	"jquery.sap.global",
	"sap/ui/base/Metadata",
	"sap/ui/core/CustomData",
	"./AnchorBar",
	"sap/m/Button",
	"sap/ui/core/IconPool"
], function (jQuery, Metadata, CustomData, AnchorBar, Button, IconPool) {
	"use strict";

	var ABHelper = Metadata.createClass("sap.uxap._helpers.AB", {
		/**
		 * @private
		 * @param {sap.uxap.ObjectPageLayout} oObjectPageLayout Object Page layout instance
		 */
		constructor: function (oObjectPageLayout) {
			this._oObjectPageLayout = oObjectPageLayout;
			this._iScrollDuration = oObjectPageLayout._iScrollToSectionDuration;
		}
	});

	ABHelper.prototype.getObjectPageLayout = function () {
		return this._oObjectPageLayout;
	};

	/**
	 * Lazy loads the hidden Aggregation "_anchorBar"
	 * @returns {sap.uxap.AnchorBar} AnchorBar
	 * @private
	 */
	ABHelper.prototype._getAnchorBar = function () {
		var oAnchorBar = this.getObjectPageLayout().getAggregation("_anchorBar");

		if (!oAnchorBar) {

			oAnchorBar = new AnchorBar({
				id: this.getObjectPageLayout().getId() + "-anchBar",
				showPopover: this.getObjectPageLayout().getShowAnchorBarPopover()
			});

			this.getObjectPageLayout().setAggregation("_anchorBar", oAnchorBar, true);
		}

		return oAnchorBar;
	};

	/**
	 * build the anchorBar and all the anchorBar buttons
	 * @private
	 */
	ABHelper.prototype._buildAnchorBar = function () {
		var aSections = this.getObjectPageLayout().getSections() || [],
			oAnchorBar = this._getAnchorBar();

		//tablet & desktop mechanism
		if (oAnchorBar && this.getObjectPageLayout().getShowAnchorBar()) {

			oAnchorBar._resetControl();

			//first level
			aSections.forEach(function (oSection) {

				if (!oSection.getVisible() || !oSection._getInternalVisible()) {
					return;
				}

				var oButtonClone,
					aSubSections = oSection.getSubSections() || [];

				oButtonClone = this._buildAnchorBarButton(oSection, true);

				if (oButtonClone) {
					oAnchorBar.addContent(oButtonClone);

					//second Level
					aSubSections.forEach(function (oSubSection) {

						if (!oSubSection.getVisible() || !oSubSection._getInternalVisible()) {
							return;
						}

						var oSecondLevelButtonClone = this._buildAnchorBarButton(oSubSection, false);

						if (oSecondLevelButtonClone) {
							oAnchorBar.addContent(oSecondLevelButtonClone);
						}

					}, this);
				}

			}, this);
		}
	};

	ABHelper.prototype._focusOnSectionWhenUsingKeyboard = function (oEvent) {
		var oSourceData = oEvent.srcControl.data(),
			oSection = sap.ui.getCore().byId(oSourceData.sectionId),
			oObjectPage = this.getObjectPageLayout();

		if (oSection && !oSourceData.bHasSubMenu && !oObjectPage.getUseIconTabBar()) {
			jQuery.sap.delayedCall(this._iScrollDuration, oSection.$(), "focus");
		}
	};

	/**
	 * build an sap.m.button equivalent to a section or sub section for insertion in the anchorBar
	 * also registers the section info for further dom position updates
	 * @param oSectionBase
	 * @param {boolean} bIsSection
	 * @returns {null}
	 * @private
	 */
	ABHelper.prototype._buildAnchorBarButton = function (oSectionBase, bIsSection) {
		var oButtonClone = null,
			oObjectPageLayout = this.getObjectPageLayout(),
			oButton,
			oAnchorBar = this._getAnchorBar(),
			sId,
			aSubSections = oSectionBase.getAggregation("subSections"),
			fnButtonKeyboardUseHandler = this._focusOnSectionWhenUsingKeyboard.bind(this),
			oEventDelegatesForkeyBoardHandler = {
				onsapenter: fnButtonKeyboardUseHandler,
				onsapspace: fnButtonKeyboardUseHandler
			};

		if (oSectionBase.getVisible() && oSectionBase._getInternalVisible()) {
			oButton = oSectionBase.getCustomAnchorBarButton();

			//by default we get create a button with the section title as text
			if (!oButton) {
				sId = oAnchorBar.getId() + "-" + oSectionBase.getId() + "-anchor";

				oButtonClone = new Button({
					ariaDescribedBy: oSectionBase,
					id: sId
				});

				oButtonClone.addEventDelegate(oEventDelegatesForkeyBoardHandler);
				//has a ux rule been applied that we need to reflect here?
				var sTitle = (oSectionBase._getInternalTitle() != "") ? oSectionBase._getInternalTitle() : oSectionBase.getTitle();
				oButtonClone.setText(sTitle);
			} else {
				oButtonClone = oButton.clone(); //keep original button parent control hierarchy
			}

			//update the section info
			oObjectPageLayout._oSectionInfo[oSectionBase.getId()].buttonId = oButtonClone.getId();

			//the anchorBar needs to know the sectionId for automatic horizontal scrolling
			oButtonClone.addCustomData(new CustomData({
				key: "sectionId",
				value: oSectionBase.getId()
			}));

			//the anchorBar needs to know whether the title is actually displayed or not (so the anchorBar is really reflecting the objactPage layout state)
			oButtonClone.addCustomData(new CustomData({
				key: "bTitleVisible",
				value: oSectionBase._getInternalTitleVisible()
			}));

			if (!bIsSection) {
				//the anchorBar needs to know that this is a second section because it will handle responsive scenarios
				oButtonClone.addCustomData(new CustomData({
					key: "secondLevel",
					value: true
				}));
			}

			if (aSubSections && aSubSections.length > 1) {
				var iVisibleSubSections = aSubSections.filter(function (oSubSection) {
					return oSubSection.getVisible();
				}).length;

				if (iVisibleSubSections > 1) {
					// the anchor bar need to know if the button has submenu for accessibility rules
					oButtonClone.addCustomData(new CustomData({
						key: "bHasSubMenu",
						value: true
					}));

					if (oObjectPageLayout.getShowAnchorBarPopover()) {
						// Add arrow icon-down in order to indicate that on click will open popover
						oButtonClone.setIcon(IconPool.getIconURI("slim-arrow-down"));
						oButtonClone.setIconFirst(false);
					}
				}
			}
		}

		return oButtonClone;
	};

	return ABHelper;

}, /* bExport= */ false);


text:
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;
/******/
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/*!**********************************!*\
  !*** ./parsing/context/index.js ***!
  \**********************************/
/***/ function(module, exports, __webpack_require__) {

	var require;var require;it("should be able to load a file with the require.context method", function() {
		__webpack_require__(/*! ./templates */ 1)("./tmpl").should.be.eql("test template");
		(__webpack_require__(/*! ./././templates */ 1))("./tmpl").should.be.eql("test template");
		(__webpack_require__(/*! ././templates/. */ 1)("./tmpl")).should.be.eql("test template");
		__webpack_require__(/*! ././templates */ 1) ( "./subdir/tmpl.js" ).should.be.eql("subdir test template");
		__webpack_require__(/*! ./templates */ 2)("xyz").should.be.eql("xyz");
	});

	it("should automatically create contexts", function() {
		var template = "tmpl", templateFull = "./tmpl.js";
		var mp = "mp", tmp = "tmp", mpl = "mpl";
		__webpack_require__(/*! ./templates */ 1)("./" + template).should.be.eql("test template");
		__webpack_require__(/*! ./templates */ 3)("./" + tmp + "l").should.be.eql("test template");
		__webpack_require__(/*! ./templates */ 4)("./t" + mpl).should.be.eql("test template");
		__webpack_require__(/*! ./templates */ 5)("./t" + mp + "l").should.be.eql("test template");
		__webpack_require__(/*! ./templates/templateLoader */ 8)(templateFull).should.be.eql("test template");
		__webpack_require__(/*! ./templates/templateLoaderIndirect */ 9)(templateFull).should.be.eql("test template");
	});

	it("should be able to require.resolve with automatical context", function() {
		var template = "tmpl";
		/*require.resolve*/(__webpack_require__(/*! ./templates */ 1).resolve("./" + template)).should.be.eql(/*require.resolve*/(/*! ./templates/tmpl */ 10));
	});

	it("should be able to use renaming combined with a context", function() {
		var renamedRequire = require;
		require = function () {};
		require("fail");
		var template = "tmpl";
		__webpack_require__(/*! ./templates */ 1)("./" + template).should.be.eql("test template");
	});

	it("should compile an empty context", function() {
		var x = "";
		(function() {
			!(function webpackMissingModule() { var e = new Error("Cannot find module \"./templates\""); e.code = 'MODULE_NOT_FOUND'; throw e; }());
		}).toString().should.not.match(/require/);
	});

	it("should execute an empty context", function() {
		var context;
		(function() {
			context = __webpack_require__(/*! ./templates/ */ 7);
		}).should.not.throw();
		(function() {
			context("");
		}).should.throw();
	});

/***/ },
/* 1 */
/*!********************************************!*\
  !*** ./parsing/context/templates ^\.\/.*$ ***!
  \********************************************/
/***/ function(module, exports, __webpack_require__) {

	var map = {
		"./subdir/tmpl": 12,
		"./subdir/tmpl.js": 12,
		"./templateLoader": 8,
		"./templateLoader.js": 8,
		"./templateLoaderIndirect": 9,
		"./templateLoaderIndirect.js": 9,
		"./tmpl": 10,
		"./tmpl.js": 10
	};
	function webpackContext(req) {
		return __webpack_require__(webpackContextResolve(req));
	};
	function webpackContextResolve(req) {
		return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }());
	};
	webpackContext.id = 1;
	webpackContext.keys = function webpackContextKeys() {
		return Object.keys(map);
	};
	webpackContext.resolve = webpackContextResolve;
	module.exports = webpackContext;

/***/ },
/* 2 */
/*!*************************************!*\
  !*** ./parsing/context/templates . ***!
  \*************************************/
/***/ function(module, exports, __webpack_require__) {

	var map = {
		"./subdir/tmpl": 12,
		"./subdir/tmpl.js": 12,
		"./templateLoader": 8,
		"./templateLoader.js": 8,
		"./templateLoaderIndirect": 9,
		"./templateLoaderIndirect.js": 9,
		"./tmpl": 10,
		"./tmpl.js": 10,
		"xyz": 13,
		"xyz.js": 13
	};
	function webpackContext(req) {
		return __webpack_require__(webpackContextResolve(req));
	};
	function webpackContextResolve(req) {
		return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }());
	};
	webpackContext.id = 2;
	webpackContext.keys = function webpackContextKeys() {
		return Object.keys(map);
	};
	webpackContext.resolve = webpackContextResolve;
	module.exports = webpackContext;

/***/ },
/* 3 */
/*!*********************************************!*\
  !*** ./parsing/context/templates ^\.\/.*l$ ***!
  \*********************************************/
/***/ function(module, exports, __webpack_require__) {

	var map = {
		"./subdir/tmpl": 12,
		"./tmpl": 10
	};
	function webpackContext(req) {
		return __webpack_require__(webpackContextResolve(req));
	};
	function webpackContextResolve(req) {
		return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }());
	};
	webpackContext.id = 3;
	webpackContext.keys = function webpackContextKeys() {
		return Object.keys(map);
	};
	webpackContext.resolve = webpackContextResolve;
	module.exports = webpackContext;

/***/ },
/* 4 */
/*!*********************************************!*\
  !*** ./parsing/context/templates ^\.\/t.*$ ***!
  \*********************************************/
/***/ function(module, exports, __webpack_require__) {

	var map = {
		"./templateLoader": 8,
		"./templateLoader.js": 8,
		"./templateLoaderIndirect": 9,
		"./templateLoaderIndirect.js": 9,
		"./tmpl": 10,
		"./tmpl.js": 10
	};
	function webpackContext(req) {
		return __webpack_require__(webpackContextResolve(req));
	};
	function webpackContextResolve(req) {
		return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }());
	};
	webpackContext.id = 4;
	webpackContext.keys = function webpackContextKeys() {
		return Object.keys(map);
	};
	webpackContext.resolve = webpackContextResolve;
	module.exports = webpackContext;

/***/ },
/* 5 */
/*!**********************************************!*\
  !*** ./parsing/context/templates ^\.\/t.*l$ ***!
  \**********************************************/
/***/ function(module, exports, __webpack_require__) {

	var map = {
		"./tmpl": 10
	};
	function webpackContext(req) {
		return __webpack_require__(webpackContextResolve(req));
	};
	function webpackContextResolve(req) {
		return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }());
	};
	webpackContext.id = 5;
	webpackContext.keys = function webpackContextKeys() {
		return Object.keys(map);
	};
	webpackContext.resolve = webpackContextResolve;
	module.exports = webpackContext;

/***/ },
/* 6 */
/*!*******************************************************!*\
  !*** ./parsing/context/templates ^\.\/notExisting.*$ ***!
  \*******************************************************/
/***/ function(module, exports, __webpack_require__) {

	function webpackContext(req) {
		throw new Error("Cannot find module '" + req + "'.");
	}
	webpackContext.resolve = webpackContext;
	webpackContext.keys = function() { return []; };
	module.exports = webpackContext;

/***/ },
/* 7 */
/*!****************************************************!*\
  !*** ./parsing/context/templates ^\.\/notExisting ***!
  \****************************************************/
/***/ function(module, exports, __webpack_require__) {

	function webpackContext(req) {
		throw new Error("Cannot find module '" + req + "'.");
	}
	webpackContext.resolve = webpackContext;
	webpackContext.keys = function() { return []; };
	module.exports = webpackContext;

/***/ },
/* 8 */
/*!*****************************************************!*\
  !*** ./parsing/context/templates/templateLoader.js ***!
  \*****************************************************/
/***/ function(module, exports, __webpack_require__) {

	module.exports = function(name) {
		return __webpack_require__(/*! . */ 1)(name);
	}

/***/ },
/* 9 */
/*!*************************************************************!*\
  !*** ./parsing/context/templates/templateLoaderIndirect.js ***!
  \*************************************************************/
/***/ function(module, exports, __webpack_require__) {

	var require;module.exports = function(name) {
		var a = load(__webpack_require__(/*! . */ 1), name);
		var r = require;
		var b = __webpack_require__(/*! . */ 1)(name);
		if(a !== b) return "FAIL";
		return a;
	}

	function load(requireFunction, name) {
		return requireFunction(name);
	}

/***/ },
/* 10 */
/*!*******************************************!*\
  !*** ./parsing/context/templates/tmpl.js ***!
  \*******************************************/
/***/ function(module, exports, __webpack_require__) {

	module.exports = "test template";

/***/ },
/* 11 */,
/* 12 */
/*!**************************************************!*\
  !*** ./parsing/context/templates/subdir/tmpl.js ***!
  \**************************************************/
/***/ function(module, exports, __webpack_require__) {

	module.exports = "subdir test template";

/***/ },
/* 13 */
/*!********************************************!*\
  !*** ./parsing/context/templates/~/xyz.js ***!
  \********************************************/
/***/ function(module, exports, __webpack_require__) {

	module.exports = "xyz";

/***/ }
/******/ ])
/*
//@ sourceMappingURL=bundle.js.map
//# sourceMappingURL=bundle.js.map
*/


text:
<?xml version="1.0" encoding="UTF-8"?>

<rootTag>
  <Award>
    <AwardTitle>Science and Technology Policy Inst. Basic Contract</AwardTitle>
    <AwardEffectiveDate>08/01/2014</AwardEffectiveDate>
    <AwardExpirationDate>03/31/2015</AwardExpirationDate>
    <AwardAmount>0</AwardAmount>
    <AwardInstrument>
      <Value>BOA/Task Order</Value>
    </AwardInstrument>
    <Organization>
      01060000
      <Directorate>
        <LongName>Office Of The Director</LongName>
      </Directorate>
      <Division>
        <LongName>Office of Integrative Activities</LongName>
      </Division>
    </Organization>
    <ProgramOfficer>
      <SignBlockName>Bernice T. Anderson</SignBlockName>
    </ProgramOfficer>
    <AbstractNarration/>
    <MinAmdLetterDate>08/01/2014</MinAmdLetterDate>
    <MaxAmdLetterDate>09/11/2014</MaxAmdLetterDate>
    <ARRAAmount/>
    <AwardID>1455508</AwardID>
    <Investigator>
      <FirstName>Mark</FirstName>
      <LastName>Lewis</LastName>
      <EmailAddress>mjlewis@ida.org</EmailAddress>
      <StartDate>08/01/2014</StartDate>
      <EndDate/>
      <RoleCode>Principal Investigator</RoleCode>
    </Investigator>
    <Institution>
      <Name>Institute For Defense Analyses</Name>
      <CityName>ALEXANDRIA</CityName>
      <ZipCode>223111882</ZipCode>
      <PhoneNumber>7038452130</PhoneNumber>
      <StreetAddress>4850 MARK CENTER DRIVE</StreetAddress>
      <CountryName>United States</CountryName>
      <StateName>Virginia</StateName>
      <StateCode>VA</StateCode>
    </Institution>
  </Award>
</rootTag>


text:
package tabishfayyaz.apps.samples.diystarter.rest.model;

import java.util.List;

/**
 * Created by tabish on 3/17/15.
 */
public class Project
{
    private String id;
    private Maker maker;
    private String title;
    private List<Clip> clips;

    public Maker getMaker() {
        return maker;
    }

    public List<Clip> getClips() {
        return clips;
    }

    public String getTitle() {
        return title;
    }

    public String getId() {
        return id;
    }

}


text:
/**
 * GET /search
 */
exports.index = function (req, res) {

  return res.render('search', { title: 'Open Market | Search' });

};


text:
@echo off

set EMACSDIR="c:\Program Packages\emacs\emacs-24.2"

REM Copyright (C) 2008 by Oleksandr Gavenko <address@hidden>

REM View file in emacs buffer using emacsclientw.
REM If emacs not already running, run it.
REM Put this file (e.bat) in your PATH.
REM Name `e' because `edit'.

if "%1" == "-h"     goto usage
if "%1" == "-help"  goto usage
if "%1" == "--help" goto usage

%EMACSDIR%\bin\emacsclientw.exe -a %EMACSDIR%\bin\runemacs.exe -n "%*"
goto EOF

:usage
@echo Win emacs run script.
@echo Usage
@echo e [-h^|--help] ^<edit-files^>

:EOF


text:
using System;
using System.IO;
using Windows.Devices.Gpio;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Navigation;

namespace AlexTheAdventurous
{
    public sealed partial class MainPage : Page
    {
        private static GpioPin RfidReset;
        private static GpioPin RfidEvent;

        static MainPage()
        {
            try
            {
                GpioController gpio = GpioController.GetDefault();

                if (gpio != null)
                {
                    RfidEvent = gpio.OpenPin(22);
                    RfidEvent.SetDriveMode(GpioPinDriveMode.Input);

                    RfidReset = gpio.OpenPin(27);
                    RfidReset.SetDriveMode(GpioPinDriveMode.Output);
                }
            }
            catch (FileNotFoundException) { /* on desktop, IoT core is note available */ }
        }

        public MainPage()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            Frame.BackStack.Clear();

            if (RfidEvent != null)
            {
                // reset the SM130 module, which will start the seek for tag command in I2C mode
                RfidReset.Write(GpioPinValue.High);
                RfidReset.Write(GpioPinValue.Low);

                RfidEvent.ValueChanged += OnRfidEvent;
            }
        }

        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            // navigate to moderation page only from this page

            if (RfidEvent != null)
                RfidEvent.ValueChanged -= OnRfidEvent;
        }

        private void OnTileClicked(object sender, RoutedEventArgs e)
        {
            FrameworkElement button = (FrameworkElement)sender;
            AlexTask task = (AlexTask)button.DataContext;

            if (task == AlexTask.CreateNewTask)
                Frame.Navigate(typeof(NewTaskPage));
            else
                Frame.Navigate(typeof(CameraPage), new AlexPost { Task = task });
        }

        protected override void OnKeyDown(KeyRoutedEventArgs e)
        {
#if DEBUG
            if (e.Key == Windows.System.VirtualKey.M)
                Frame.Navigate(typeof(ModerationList)); // for testing moderation without RFID
#endif
        }

        private async void OnRfidEvent(GpioPin sender, GpioPinValueChangedEventArgs args)
        {
            // SM130 sends a high pulse when RFID tag was found
            // the navigation has to occur from the UI thread

            if (args.Edge == GpioPinEdge.RisingEdge)
                await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => Frame.Navigate(typeof(ModerationList)));
        }
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理系统</title>
<link rel="shortcut icon" href="favicon.ico" />
</head>
<frameset rows="75,*,22" cols="*" frameborder="no" border="0" framespacing="0">
	<frame src="?r=site/top" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" />
	<frameset id="bodyFrameset" cols="190,14,*" frameborder="no" border="0" framespacing="0">
            <frame src="?r=site/left&act=<?php echo $act?>" name="leftFrame" id="leftFrame" noresize="noresize" />
		<frame src="?r=site/change" name="changeFrame" noresize="noresize" id="changeFrame"  frameborder="no"  scrolling="no" marginwidth="0" marginheight="0"/>
		<frame src="?r=youhui/index" name="mainFrame" id="mainFrame"   frameborder="no"  scrolling="no" marginwidth="0" marginheight="0" />
	</frameset>
	<frame src="?r=site/footer" name="bottomFrame" scrolling="no" noresize="noresize" />
</frameset>
<noframes>
<body style="padding:0">
</body>
</noframes>
</html>


text:
require 'filterable/nil_filter'

module Filterable

  class FilterFactory

    def initialize
      @factories = {}
    end

    def register(filter_name, filter_class, *filter_args)
      @factories[filter_name] = [filter_class, *filter_args]
    end

    def build(filter_name, filter_options = {})
      filter_class, *filter_args = filter_class_and_args(filter_name)
      filter_class.new(filter_options, *filter_args)
    end

    private

    def filter_class_and_args(filter_name)
      @factories.fetch(filter_name) { [NilFilter, {}] }
    end

  end

end


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
	<string name="app_name">com.koushikdutta.twitter</string>
</resources>


text:
![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png) 0

To use the Space People skill, try saying...

* *Alexa Ask Space People How Many People Are In Space Right Now*

* *Alexa Ask Space People What Are The Names Of The People In Space Right Now*

* *Alexa Ask Space People Name The People In Space*

Simply ask Alexa "ask Space People How Many People are in Space right now?" or "ask Space People What are the Names of People in Space Right now?"

Alexa will respond with the number or names of the astronauts floating around in outer space!

***

### Skill Details

* **Invocation Name:** space people
* **Category:** null
* **ID:** amzn1.ask.skill.169b2be4-12fa-4521-a1cd-a4cbdefdb86a
* **ASIN:** B01M985535
* **Author:** Just Good Software
* **Release Date:** October 14, 2016 @ 01:46:04
* **In-App Purchasing:** No


text:
<?php namespace League\Fractal\Test\Resource;

use League\Fractal\Manager;
use League\Fractal\Resource\Collection;
use League\Fractal\Resource\Item;
use League\Fractal\Resource\NullResource;
use League\Fractal\Scope;
use League\Fractal\Serializer\DataArraySerializer;
use League\Fractal\Test\Stub\Serializer\RootSerializer;
use League\Fractal\Test\Stub\Transformer\GenericBookNoResourceKeyTransformer;
use League\Fractal\Test\Stub\Transformer\GenericBookTransformer;
use Mockery;
use PHPUnit\Framework\TestCase;

class DataArraySerializerTest extends TestCase
{
    public function testSerializingItemResource()
    {
        $manager = new Manager();
        $manager->parseIncludes('author');
        $manager->setSerializer(new DataArraySerializer());

        $bookData = [
            'title' => 'Foo',
            'year' => '1991',
            '_author' => [
                'name' => 'Dave',
            ],
        ];

        // Try without metadata
        $resource = new Item($bookData, new GenericBookTransformer(), 'book');
        $scope = new Scope($manager, $resource);

        $expected = [
            'data' => [
                'title' => 'Foo',
                'year' => 1991,
                'author' => [
                    'data' => [
                        'name' => 'Dave',
                    ],
                ],
            ],
        ];

        $this->assertSame($expected, $scope->toArray());

        //Test single field
        $manager->parseFieldsets(['book' => 'title']);
        $expected = [
            'data' => [
                'title' => 'Foo',
            ]
        ];
        $this->assertSame($expected, $scope->toArray());

        //Test multiple field
        $manager->parseFieldsets(['book' => 'title,year']);
        $expected = [
            'data' => [
                'title' => 'Foo',
                'year' => 1991
            ]
        ];
        $this->assertSame($expected, $scope->toArray());

        //Test with relationship field
        $manager->parseFieldsets(['book' => 'title,author', 'author' => 'name']);
        $expected = [
            'data' => [
                'title' => 'Foo',
                'author' => [
                    'data' => [
                        'name' => 'Dave'
                    ]
                ]
            ]
        ];
        $this->assertSame($expected, $scope->toArray());

        //Clear all sparse fieldsets
        $manager->parseFieldsets([]);

        // Same again with metadata
        $resource = new Item($bookData, new GenericBookTransformer(), 'book');
        $resource->setMetaValue('foo', 'bar');

        $scope = new Scope($manager, $resource);

        $expected = [
            'data' => [
                'title' => 'Foo',
                'year' => 1991,
                'author' => [
                    'data' => [
                        'name' => 'Dave',

                    ],
                ],
            ],
            'meta' => [
                'foo' => 'bar',
            ],
        ];

        $this->assertSame($expected, $scope->toArray());

        //Test with relationship field
        $manager->parseFieldsets(['book' => 'title,author', 'author' => 'name']);
        $expected = [
            'data' => [
                'title' => 'Foo',
                'author' => [
                    'data' => [
                        'name' => 'Dave'

                    ]
                ]
            ],
            'meta' => [
                'foo' => 'bar'
            ],
        ];
        $this->assertSame($expected, $scope->toArray());
    }

    public function testSerializingCollectionResource()
    {
        $manager = new Manager();
        $manager->parseIncludes('author');
        $manager->setSerializer(new DataArraySerializer());

        $booksData = [
            [
                'title' => 'Foo',
                'year' => '1991',
                '_author' => [
                    'name' => 'Dave',
                ],
            ],
            [
                'title' => 'Bar',
                'year' => '1997',
                '_author' => [
                    'name' => 'Bob',
                ],
            ],
        ];

        // Try without metadata
        $resource = new Collection($booksData, new GenericBookTransformer(), 'books');

        $scope = new Scope($manager, $resource);

        $expected = [
            'data' => [
                [
                    'title' => 'Foo',
                    'year' => 1991,
                    'author' => [
                        'data' => [
                            'name' => 'Dave',
                        ],
                    ],
                ],
                [
                    'title' => 'Bar',
                    'year' => 1997,
                    'author' => [
                        'data' => [
                            'name' => 'Bob',
                        ],
                    ],
                ],
            ],
        ];

        $this->assertSame($expected, $scope->toArray());

        $expectedJson = '{"data":[{"title":"Foo","year":1991,"author":{"data":{"name":"Dave"}}},{"title":"Bar","year":1997,"author":{"data":{"name":"Bob"}}}]}';
        $this->assertSame($expectedJson, $scope->toJson());

        //Test single field
        $manager->parseFieldsets(['books' => 'title']);
        $expected = [
            'data' => [
                ['title' => 'Foo'],
                ['title' => 'Bar']
            ],
        ];
        $this->assertSame($expected, $scope->toArray());

        //Test multiple field
        $manager->parseFieldsets(['books' => 'title,year']);
        $expected = [
            'data' => [
                [
                    'title' => 'Foo',
                    'year' => 1991
                ],
                [
                    'title' => 'Bar',
                    'year' => 1997
                ]
            ],
        ];
        $this->assertSame($expected, $scope->toArray());

        //Test with relationship field
        $manager->parseFieldsets(['books' => 'title,author', 'author' => 'name']);
        $expected = [
            'data' => [
                [
                    'title' => 'Foo',
                    'author' => [
                        'data' => [
                            'name' => 'Dave'
                        ]
                    ]
                ],
                [
                    'title' => 'Bar',
                    'author' => [
                        'data' => [
                            'name' => 'Bob'
                        ]
                    ]
                ]
            ]
        ];
        $this->assertSame($expected, $scope->toArray());

        //Clear all sparse fieldsets
        $manager->parseFieldsets([]);

        // Same again with meta
        $resource = new Collection($booksData, new GenericBookTransformer(), 'books');
        $resource->setMetaValue('foo', 'bar');

        $scope = new Scope($manager, $resource);

        $expected = [
            'data' => [
                [
                    'title' => 'Foo',
                    'year' => 1991,
                    'author' => [
                        'data' => [
                            'name' => 'Dave',
                        ],
                    ],
                ],
                [
                    'title' => 'Bar',
                    'year' => 1997,
                    'author' => [
                        'data' => [
                            'name' => 'Bob',
                        ],
                    ],
                ],
            ],
            'meta' => [
                'foo' => 'bar',
            ],
        ];

        $this->assertSame($expected, $scope->toArray());

        $expectedJson = '{"data":[{"title":"Foo","year":1991,"author":{"data":{"name":"Dave"}}},{"title":"Bar","year":1997,"author":{"data":{"name":"Bob"}}}],"meta":{"foo":"bar"}}';
        $this->assertSame($expectedJson, $scope->toJson());

        $manager->parseFieldsets(['books' => 'title,author', 'author' => 'name']);
        $expected = [
            'data' => [
                [
                    'title' => 'Foo',
                    'author' => [
                        'data' => [
                            'name' => 'Dave'
                        ]
                    ]
                ],
                [
                    'title' => 'Bar',
                    'author' => [
                        'data' => [
                            'name' => 'Bob'
                        ]
                    ]
                ]
            ],
            'meta' => [
                'foo' => 'bar'
            ]
        ];

        $this->assertSame($expected, $scope->toArray());
    }

    public function testSerializingNullResource()
    {
        $manager = new Manager();
        $manager->parseIncludes('author');
        $manager->setSerializer(new DataArraySerializer());

        $bookData = [
            'title' => 'Foo',
            'year' => '1991',
            '_author' => [
                'name' => 'Dave',
            ],
        ];

        // Try without metadata
        $resource = new NullResource($bookData, new GenericBookTransformer(), 'book');
        $scope = new Scope($manager, $resource);

        $expected = [
            'data' => [],
        ];
        $this->assertSame($expected, $scope->toArray());

        //Test single field
        $manager->parseFieldsets(['book' => 'title']);
        $this->assertSame($expected, $scope->toArray());

        //Test multiple fields
        $manager->parseFieldsets(['book' => 'title,year']);
        $this->assertSame($expected, $scope->toArray());

        //Test with relationship
        $manager->parseFieldsets(['book' => 'title,author', 'author' => 'name']);
        $this->assertSame($expected, $scope->toArray());

        //Clear all sparse fieldsets
        $manager->parseFieldsets([]);

        // Same again with metadata
        $resource = new NullResource($bookData, new GenericBookTransformer(), 'book');
        $resource->setMetaValue('foo', 'bar');

        $scope = new Scope($manager, $resource);

        $expected = [
            'data' => [],
            'meta' => [
                'foo' => 'bar',
            ],
        ];
        $this->assertSame($expected, $scope->toArray());

        //Test with relationship
        $manager->parseFieldsets(['book' => 'title,author', 'author' => 'name']);
        $this->assertSame($expected, $scope->toArray());
    }

    public function testCanPassNullValueToSerializer()
    {
        $testClass = new \stdClass();
        $testClass->name = 'test';
        $testClass->email = 'test@test.com';

    }

    public function tearDown(): void
    {
        Mockery::close();
    }
}


text:
package microtools.actions

import com.codahale.metrics.MetricRegistry
import microtools.logging.WithContextAwareLogger
import microtools.models._
import play.api.mvc._
import play.mvc.Http.HeaderNames

import scala.concurrent.{ExecutionContext, Future}
import scala.util.{Failure, Success}

trait TimedActions extends WithContextAwareLogger { self: AbstractController =>

  import TimedActions._

  def metricRegistry: MetricRegistry

  def TimedAction(
      actionId: String
  )(implicit ec: ExecutionContext): ActionBuilder[TimedRequest, AnyContent] =
    TimedAction(actionId, self.controllerComponents.parsers.default)

  def TimedAction[B](actionId: String, bodyParser: BodyParser[B])(
      implicit ec: ExecutionContext
  ): ActionBuilder[TimedRequest, B] = {
    val timer = metricRegistry.timer(s"${log.name}.$actionId")

    new ActionBuilder[TimedRequest, B] {
      override def parser: BodyParser[B] = bodyParser

      override protected def executionContext: ExecutionContext = ec

      override def invokeBlock[A](
          request: Request[A],
          block: (TimedRequest[A]) => Future[Result]
      ): Future[Result] = {
        val businessDebug = Helper.isBusinessDebug(request)
        val flowId        = Helper.getOrCreateFlowId(request)
        val ipAddress = request.headers
          .get(HeaderNames.X_FORWARDED_FOR)
          .getOrElse(request.remoteAddress)
        val userAgent = request.headers.get(HeaderNames.USER_AGENT)
        val organization =
          Organization(request.headers.get(ExtraHeaders.AUTH_ORGANIZATION_HEADER))
        val maybeSubject =
          request.headers.get(ExtraHeaders.AUTH_SUBJECT_HEADER).map(Subject.apply)
        val forwardedHost = ForwardedHost(request.headers.get(HeaderNames.X_FORWARDED_HOST))

        implicit val meteredRequest =
          new TimedRequest(
            businessDebug,
            flowId,
            ipAddress,
            userAgent,
            organization,
            maybeSubject,
            forwardedHost,
            request.uri,
            request
          )
        val timeCtx = timer.time()
        val result =
          block(meteredRequest).map(_.withHeaders(ExtraHeaders.FLOW_ID_HEADER -> flowId))

        result.onComplete {
          case Success(_) =>
            val nanos = timeCtx.stop()
            log.info(s"$actionId: Success", "millis" -> (nanos / 1000000.0).toString)
          case Failure(e) =>
            val nanos = timeCtx.stop()
            log.error(s"$actionId: Internal error", e, "millis" -> (nanos / 1000000.0).toString)
        }
        result
      }
    }
  }
}

object TimedActions {

  class TimedRequest[A](
      override val enableBusinessDebug: Boolean,
      override val flowId: String,
      override val ipAddress: String,
      override val userAgent: Option[String],
      override val organization: Organization,
      override val maybeSubject: Option[Subject],
      override val forwardedHost: ForwardedHost,
      requestUri: String,
      request: Request[A]
  ) extends WrappedRequest[A](request)
      with RequestContext {

    override def contextValues: Seq[(String, String)] = Seq(
      "flow_id"     -> flowId,
      "request_uri" -> requestUri
    )
  }
}