text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>cn.javaer.platform</groupId>
    <artifactId>platform-bom-extension</artifactId>
    <version>1.1.1-SNAPSHOT</version>
    <packaging>pom</packaging>

    <name>platform-bom-extension</name>
    <description>platform bom extension</description>
    <url>https://github.com/cn-src/platform-bom-extension</url>

    <properties>
        <aliyun-java-sdk-dysmsapi.version>1.1.0</aliyun-java-sdk-dysmsapi.version>
        <aliyun-sdk-oss.version>3.1.0</aliyun-sdk-oss.version>
        <aliyun-spring-boot-starter-oss.version>1.0.0</aliyun-spring-boot-starter-oss.version>
        <assertj-core.version>3.10.0</assertj-core.version>
        <byte-buddy.version>1.8.15</byte-buddy.version>
        <commons-collections4.version>4.2</commons-collections4.version>
        <commons-crypto.version>1.0.0</commons-crypto.version>
        <commons-csv.version>1.5</commons-csv.version>
        <commons-email.version>1.5</commons-email.version>
        <commons-io.version>2.6</commons-io.version>
        <commons-lang3.version>3.7</commons-lang3.version>
        <cucumber.version>1.2.5</cucumber.version>
        <dalesbred.version>1.3.0</dalesbred.version>
        <druid.version>1.1.10</druid.version>
        <emoji-java.version>4.0.0</emoji-java.version>
        <fastjson.version>1.2.47</fastjson.version>
        <fastutil.version>8.2.1</fastutil.version>
        <findbugs.annotations.version>3.0.1u2</findbugs.annotations.version>
        <groovy-all.version>2.5.1</groovy-all.version>
        <guava.version>26.0-jre</guava.version>
        <javaparser-core.version>3.6.15</javaparser-core.version>
        <javatuples.version>1.2</javatuples.version>
        <jcaptcha-core.version>2.0.0</jcaptcha-core.version>
        <jetbrains.annotations.version>16.0.2</jetbrains.annotations.version>
        <jodd.version>5.0.3</jodd.version>
        <jsch.version>0.1.54</jsch.version>
        <juniversalchardet.version>2.1.0</juniversalchardet.version>
        <mybatis-ehcache.version>1.1.0</mybatis-ehcache.version>
        <mybatis-spring-boot.version>1.3.2</mybatis-spring-boot.version>
        <mybatis-typehandlers-jsr310.version>1.0.2</mybatis-typehandlers-jsr310.version>
        <mybatis.version>3.4.6</mybatis.version>
        <objenesis.version>2.6</objenesis.version>
        <okhttp3.version>3.11.0</okhttp3.version>
        <pagehelper-spring-boot-starter.version>1.2.5</pagehelper-spring-boot-starter.version>
        <pagehelper.version>5.1.4</pagehelper.version>
        <qrgen.version>2.5.0</qrgen.version>
        <retrofit2.version>2.4.0</retrofit2.version>
        <spock.version>1.1-groovy-2.4</spock.version>
        <spring-boot-admin.version>1.5.7</spring-boot-admin.version>
        <spring-boot-starter-swagger.version>1.5.1.RELEASE</spring-boot-starter-swagger.version>
        <springfox.version>2.9.2</springfox.version>
        <sshj.version>0.26.0</sshj.version>
        <super-csv.version>2.4.0</super-csv.version>
        <vavr.version>0.9.2</vavr.version>
        <wiremock.version>2.18.0</wiremock.version>
        <aliyun-sms.version>1.1.0</aliyun-sms.version>
    </properties>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <scm>
        <url>https://github.com/cn-src/platform-bom-extension.git</url>
        <connection>scm:git:ssh://github.com/cn-src/platform-bom-extension.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/cn-src/platform-bom-extension.git
        </developerConnection>
        <tag>HEAD</tag>
    </scm>
    <developers>
        <developer>
            <name>cn-src</name>
            <email>public@javaer.cn</email>
        </developer>
    </developers>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>cn.javaer</groupId>
                <artifactId>aliyun-spring-boot-starter-oss</artifactId>
                <version>${aliyun-spring-boot-starter-oss.version}</version>
            </dependency>
            <dependency>
                <groupId>cn.javaer.aliyun</groupId>
                <artifactId>aliyun-sms</artifactId>
                <version>${aliyun-sms.version}</version>
            </dependency>
            <dependency>
                <groupId>cn.javaer.aliyun</groupId>
                <artifactId>aliyun-spring-boot-starter-sms</artifactId>
                <version>${aliyun-sms.version}</version>
            </dependency>
            <!-- 部分第三方工具性质的依赖提供了新的不兼容版,故旧版只作为 runtime -->
            <dependency>
                <artifactId>commons-lang</artifactId>
                <groupId>commons-lang</groupId>
                <version>2.6</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>commons-collections</groupId>
                <artifactId>commons-collections</artifactId>
                <version>3.2.2</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-io</artifactId>
                <version>1.3.2</version>
                <scope>runtime</scope>
            </dependency>
            <!-- 对 platform-bom 已有的部分依赖进行版本升级 -->
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj-core.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
                <exclusions>
                    <exclusion>
                        <artifactId>animal-sniffer-annotations</artifactId>
                        <groupId>org.codehaus.mojo</groupId>
                    </exclusion>
                    <exclusion>
                        <artifactId>error_prone_annotations</artifactId>
                        <groupId>com.google.errorprone</groupId>
                    </exclusion>
                    <exclusion>
                        <artifactId>j2objc-annotations</artifactId>
                        <groupId>com.google.j2objc</groupId>
                    </exclusion>
                    <exclusion>
                        <artifactId>jsr305</artifactId>
                        <groupId>com.google.code.findbugs</groupId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- 扩展 platform-bom 中没有的依赖 -->
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-collections4</artifactId>
                <version>${commons-collections4.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-email</artifactId>
                <version>${commons-email.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-crypto</artifactId>
                <version>${commons-crypto.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-csv</artifactId>
                <version>${commons-csv.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons-lang3.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io.version}</version>
            </dependency>

            <dependency>
                <groupId>io.vavr</groupId>
                <artifactId>vavr</artifactId>
                <version>${vavr.version}</version>
            </dependency>

            <dependency>
                <groupId>com.jcraft</groupId>
                <artifactId>jsch</artifactId>
                <version>${jsch.version}</version>
            </dependency>

            <dependency>
                <groupId>net.sf.supercsv</groupId>
                <artifactId>super-csv</artifactId>
                <version>${super-csv.version}</version>
            </dependency>

            <dependency>
                <groupId>io.springfox</groupId>
                <artifactId>springfox-swagger-ui</artifactId>
                <version>${springfox.version}</version>
            </dependency>
            <dependency>
                <groupId>io.springfox</groupId>
                <artifactId>springfox-swagger2</artifactId>
                <version>${springfox.version}</version>
            </dependency>
            <dependency>
                <groupId>com.spring4all</groupId>
                <artifactId>spring-boot-starter-swagger</artifactId>
                <version>${spring-boot-starter-swagger.version}</version>
            </dependency>

            <dependency>
                <groupId>org.mybatis</groupId>
                <artifactId>mybatis</artifactId>
                <version>${mybatis.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mybatis</groupId>
                <artifactId>mybatis-typehandlers-jsr310</artifactId>
                <version>${mybatis-typehandlers-jsr310.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mybatis.caches</groupId>
                <artifactId>mybatis-ehcache</artifactId>
                <version>${mybatis-ehcache.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mybatis.spring.boot</groupId>
                <artifactId>mybatis-spring-boot-starter</artifactId>
                <version>${mybatis-spring-boot.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mybatis.spring.boot</groupId>
                <artifactId>mybatis-spring-boot-starter-test</artifactId>
                <version>${mybatis-spring-boot.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.pagehelper</groupId>
                <artifactId>pagehelper</artifactId>
                <version>${pagehelper.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.pagehelper</groupId>
                <artifactId>pagehelper-spring-boot-starter</artifactId>
                <version>${pagehelper-spring-boot-starter.version}</version>
            </dependency>

            <dependency>
                <groupId>de.codecentric</groupId>
                <artifactId>spring-boot-admin-server</artifactId>
                <version>${spring-boot-admin.version}</version>
                <exclusions>
                    <exclusion>
                        <artifactId>commons-logging</artifactId>
                        <groupId>commons-logging</groupId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>de.codecentric</groupId>
                <artifactId>spring-boot-admin-server-ui</artifactId>
                <version>${spring-boot-admin.version}</version>
            </dependency>
            <dependency>
                <groupId>de.codecentric</groupId>
                <artifactId>spring-boot-admin-server-ui-login</artifactId>
                <version>${spring-boot-admin.version}</version>
            </dependency>
            <dependency>
                <groupId>de.codecentric</groupId>
                <artifactId>spring-boot-admin-starter-client</artifactId>
                <version>${spring-boot-admin.version}</version>
            </dependency>

            <dependency>
                <groupId>com.squareup.retrofit2</groupId>
                <artifactId>retrofit</artifactId>
                <version>${retrofit2.version}</version>
            </dependency>
            <dependency>
                <groupId>com.squareup.retrofit2</groupId>
                <artifactId>converter-jackson</artifactId>
                <version>${retrofit2.version}</version>
            </dependency>
            <dependency>
                <groupId>com.squareup.retrofit2</groupId>
                <artifactId>retrofit-mock</artifactId>
                <version>${retrofit2.version}</version>
            </dependency>
            <dependency>
                <groupId>com.squareup.okhttp3</groupId>
                <artifactId>mockwebserver</artifactId>
                <version>${okhttp3.version}</version>
            </dependency>

            <dependency>
                <groupId>org.jodd</groupId>
                <artifactId>jodd-core</artifactId>
                <version>${jodd.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jodd</groupId>
                <artifactId>jodd-bean</artifactId>
                <version>${jodd.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jodd</groupId>
                <artifactId>jodd-vtor</artifactId>
                <version>${jodd.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jodd</groupId>
                <artifactId>jodd-mail</artifactId>
                <version>${jodd.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jodd</groupId>
                <artifactId>jodd-madvoc</artifactId>
                <version>${jodd.version}</version>
            </dependency>

            <dependency>
                <groupId>info.cukes</groupId>
                <artifactId>cucumber-java8</artifactId>
                <version>${cucumber.version}</version>
            </dependency>
            <dependency>
                <groupId>info.cukes</groupId>
                <artifactId>cucumber-java</artifactId>
                <version>${cucumber.version}</version>
            </dependency>
            <dependency>
                <groupId>info.cukes</groupId>
                <artifactId>cucumber-junit</artifactId>
                <version>${cucumber.version}</version>
            </dependency>

            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
                <version>${fastjson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>druid</artifactId>
                <version>${druid.version}</version>
                <exclusions>
                    <exclusion>
                        <artifactId>jconsole</artifactId>
                        <groupId>com.alibaba</groupId>
                    </exclusion>
                    <exclusion>
                        <artifactId>tools</artifactId>
                        <groupId>com.alibaba</groupId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>druid-spring-boot-starter</artifactId>
                <version>${druid.version}</version>
            </dependency>
            <dependency>
                <groupId>com.aliyun.oss</groupId>
                <artifactId>aliyun-sdk-oss</artifactId>
                <version>${aliyun-sdk-oss.version}</version>
                <exclusions>
                    <exclusion>
                        <artifactId>commons-logging</artifactId>
                        <groupId>commons-logging</groupId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.aliyun</groupId>
                <artifactId>aliyun-java-sdk-dysmsapi</artifactId>
                <version>${aliyun-java-sdk-dysmsapi.version}</version>
            </dependency>

            <dependency>
                <groupId>org.dalesbred</groupId>
                <artifactId>dalesbred</artifactId>
                <version>${dalesbred.version}</version>
            </dependency>
            <dependency>
                <groupId>org.dalesbred</groupId>
                <artifactId>dalesbred-junit</artifactId>
                <version>${dalesbred.version}</version>
            </dependency>

            <dependency>
                <groupId>io.leopard.thirdparty</groupId>
                <artifactId>jcaptcha-core</artifactId>
                <version>${jcaptcha-core.version}</version>
            </dependency>

            <dependency>
                <groupId>it.unimi.dsi</groupId>
                <artifactId>fastutil</artifactId>
                <version>${fastutil.version}</version>
            </dependency>

            <dependency>
                <!--jitpack.io-->
                <groupId>com.github.kenglxn.qrgen</groupId>
                <artifactId>javase</artifactId>
                <version>${qrgen.version}</version>
            </dependency>

            <dependency>
                <groupId>com.github.javaparser</groupId>
                <artifactId>javaparser-core</artifactId>
                <version>${javaparser-core.version}</version>
            </dependency>

            <dependency>
                <groupId>com.vdurmont</groupId>
                <artifactId>emoji-java</artifactId>
                <version>${emoji-java.version}</version>
            </dependency>

            <dependency>
                <groupId>com.hierynomus</groupId>
                <artifactId>sshj</artifactId>
                <version>${sshj.version}</version>
            </dependency>

            <dependency>
                <groupId>org.javatuples</groupId>
                <artifactId>javatuples</artifactId>
                <version>${javatuples.version}</version>
            </dependency>

            <dependency>
                <!-- 字符集编码检测工具包 -->
                <groupId>com.github.albfernandez</groupId>
                <artifactId>juniversalchardet</artifactId>
                <version>${juniversalchardet.version}</version>
            </dependency>

            <dependency>
                <groupId>org.jetbrains</groupId>
                <artifactId>annotations</artifactId>
                <version>${jetbrains.annotations.version}</version>
            </dependency>

            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>annotations</artifactId>
                <version>${findbugs.annotations.version}</version>
            </dependency>

            <dependency>
                <groupId>com.github.tomakehurst</groupId>
                <artifactId>wiremock</artifactId>
                <version>${wiremock.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.tomakehurst</groupId>
                <artifactId>wiremock-standalone</artifactId>
                <version>${wiremock.version}</version>
            </dependency>

            <!-- Mandatory dependencies for using Spock -->
            <dependency>
                <groupId>org.spockframework</groupId>
                <artifactId>spock-core</artifactId>
                <version>${spock.version}</version>
            </dependency>
            <dependency>
                <groupId>org.spockframework</groupId>
                <artifactId>spock-guice</artifactId>
                <version>${spock.version}</version>
            </dependency>
            <dependency>
                <groupId>org.spockframework</groupId>
                <artifactId>spock-spring</artifactId>
                <version>${spock.version}</version>
            </dependency>
            <dependency>
                <groupId>org.spockframework</groupId>
                <artifactId>spock-tapestry</artifactId>
                <version>${spock.version}</version>
            </dependency>
            <dependency>
                <groupId>org.spockframework</groupId>
                <artifactId>spock-unitils</artifactId>
                <version>${spock.version}</version>
                <exclusions>
                    <exclusion>
                        <artifactId>commons-logging</artifactId>
                        <groupId>commons-logging</groupId>
                    </exclusion>
                </exclusions>
            </dependency>
            <!-- Optional dependencies for using Spock -->
            <dependency>
                <!-- use a specific Groovy version rather than the one specified by spock-core -->
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-all</artifactId>
                <version>${groovy-all.version}</version>
            </dependency>
            <dependency>
                <!-- enables mocking of classes (in addition to interfaces) -->
                <groupId>net.bytebuddy</groupId>
                <artifactId>byte-buddy</artifactId>
                <version>${byte-buddy.version}</version>
            </dependency>
            <dependency>
                <!-- enables mocking of classes without default constructor (together with CGLIB) -->
                <groupId>org.objenesis</groupId>
                <artifactId>objenesis</artifactId>
                <version>${objenesis.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <rulesUri>file://${basedir}/rules.xml</rulesUri>
                    <generateBackupPoms>false</generateBackupPoms>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Android Emulator on Guowei Lv</title>
    <link>https://www.lvguowei.me/tags/android-emulator/</link>
    <description>Recent content in Android Emulator on Guowei Lv</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 12 Jul 2017 14:13:07 +0300</lastBuildDate>

	<atom:link href="https://www.lvguowei.me/tags/android-emulator/index.xml" rel="self" type="application/rss+xml" />

    <item>
      <title>Android Emulator Problem In Arch Linux</title>
      <link>https://www.lvguowei.me/post/android-emulator-problem-in-arch-linux/</link>
      <pubDate>Wed, 12 Jul 2017 14:13:07 +0300</pubDate>

      <guid>https://www.lvguowei.me/post/android-emulator-problem-in-arch-linux/</guid>
      <description>I don&rsquo;t remember since when, but now whenever I upgrade Android Studio from pacman, I cannot open my emulator, with some libGL error: unable to load driver: i965_dri.so error.
I tried to follow the solution online but found none of them is working out of the box, because Android Sdk changed some paths. Here is what actualy works now:
 cd ANDROID_SDK_PATH/emulator/lib64/libstdc++/ mv libstdc++.so.6 libstdc++.so.6.bak ln -s /usr/lib64/libstdc++.so.6 libstdc++.so.6  </description>
    </item>

  </channel>
</rss>

redpajama_set_name: RedPajamaGithub


text:
class ActiveStorage::VariantWithRecord
  attr_reader :blob, :variation

  def initialize(blob, variation)
    @blob, @variation = blob, ActiveStorage::Variation.wrap(variation)
  end

  def processed
    process
    self
  end

  def process
    transform_blob { |image| create_or_find_record(image: image) } unless processed?
  end

  def processed?
    record.present?
  end

  def image
    record&.image
  end

  def url(**options)
    image&.url(**options)
  end

  alias_method :service_url, :url
  deprecate service_url: :url

  private
    def transform_blob
      blob.open do |input|
        if blob.content_type.in?(ActiveStorage.web_image_content_types)
          variation.transform(input) do |output|
            yield io: output, filename: blob.filename, content_type: blob.content_type, service_name: blob.service.name
          end
        else
          variation.transform(input, format: "png") do |output|
            yield io: output, filename: "#{blob.filename.base}.png", content_type: "image/png", service_name: blob.service.name
          end
        end
      end
    end

    def create_or_find_record(image:)
      @record =
        ActiveRecord::Base.connected_to(role: ActiveRecord::Base.writing_role) do
          blob.variant_records.create_or_find_by!(variation_digest: variation.digest) do |record|
            record.image.attach(image)
          end
        end
    end

    def record
      @record ||= blob.variant_records.find_by(variation_digest: variation.digest)
    end
end


text:
@interface ThreadComunicate ()
@property(nonatomic,weak)UIImageView *imageView;
@end

@implementation ThreadComunicate

- (void)viewDidLoad {
    [super viewDidLoad];

    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 100, 200, 200)];
    [self.view addSubview:imageView];
    self.imageView = imageView;
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self performSelectorInBackground:@selector(download3) withObject:nil];
}

- (void)download3
{
    // 图片的网络路径
    NSURL *url = [NSURL URLWithString:@"http://www.photophoto.cn/m2/012/001/0120010123.jpg"];

    // 加载图片
    NSData *data = [NSData dataWithContentsOfURL:url];

    // 生成图片
    UIImage *image = [UIImage imageWithData:data];

    // 回到主线程,显示图片
    [self.imageView performSelector:@selector(setImage:) onThread:[NSThread mainThread] withObject:image waitUntilDone:NO];
    //    [self.imageView performSelectorOnMainThread:@selector(setImage:) withObject:image waitUntilDone:NO];
    //    [self performSelectorOnMainThread:@selector(showImage:) withObject:image waitUntilDone:YES];
}

//- (void)showImage:(UIImage *)image
//{
//    self.imageView.image = image;
//}

- (void)download2
{
    // 图片的网络路径
    NSURL *url = [NSURL URLWithString:@"http://img.pconline.com.cn/images/photoblog/9/9/8/1/9981681/200910/11/1255259355826.jpg"];

    CFTimeInterval begin = CFAbsoluteTimeGetCurrent();
    // 根据图片的网络路径去下载图片数据
    NSData *data = [NSData dataWithContentsOfURL:url];
    CFTimeInterval end = CFAbsoluteTimeGetCurrent();

    NSLog(@"%f", end - begin);

    // 显示图片
    self.imageView.image = [UIImage imageWithData:data];
}

- (void)download
{
    // 图片的网络路径
    NSURL *url = [NSURL URLWithString:@"http://www.photophoto.cn/m2/012/001/0120010123.jpg"];

    NSDate *begin = [NSDate date];
    // 根据图片的网络路径去下载图片数据
    NSData *data = [NSData dataWithContentsOfURL:url];
    NSDate *end = [NSDate date];

    NSLog(@"%f", [end timeIntervalSinceDate:begin]);

    // 显示图片
    self.imageView.image = [UIImage imageWithData:data];
}

@end


text:
from wptserve.utils import isomorphic_decode

def main(request, response):
    encoding = request.GET[b'encoding']
    tmpl = request.GET[b'tmpl']
    sheet = isomorphic_decode(tmpl) % u'\\0000E5'
    return [(b"Content-Type", b"text/css; charset=%s" % encoding)], sheet.encode(isomorphic_decode(encoding))


text:
{{ define "body" }}

Sign up

			    <form accept-charset="UTF-8" role="form" method="POST" action="/users/new">
            <fieldset>

			    		  <input class="form-control" placeholder="email" name="email" type="text">

			    			<input class="form-control" placeholder="Password" name="password" type="password" value="">

			    		<input class="btn btn-lg btn-success btn-block" type="submit" value="Sign Up">
			    	</fieldset>
			    </form>

{{ end }}


text:
package org.onosproject.driver.pipeline;

import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.RemovalCause;
import com.google.common.cache.RemovalNotification;

import org.onlab.osgi.ServiceDirectory;
import org.onlab.packet.Ethernet;
import org.onlab.packet.IPv4;
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
import org.onlab.util.KryoNamespace;
import org.onosproject.core.ApplicationId;
import org.onosproject.core.CoreService;
import org.onosproject.net.DeviceId;
import org.onosproject.net.behaviour.NextGroup;
import org.onosproject.net.behaviour.Pipeliner;
import org.onosproject.net.behaviour.PipelinerContext;
import org.onosproject.net.driver.AbstractHandlerBehaviour;
import org.onosproject.net.flow.DefaultFlowRule;
import org.onosproject.net.flow.DefaultTrafficSelector;
import org.onosproject.net.flow.DefaultTrafficTreatment;
import org.onosproject.net.flow.FlowRule;
import org.onosproject.net.flow.FlowRuleOperations;
import org.onosproject.net.flow.FlowRuleOperationsContext;
import org.onosproject.net.flow.FlowRuleService;
import org.onosproject.net.flow.TrafficSelector;
import org.onosproject.net.flow.TrafficTreatment;
import org.onosproject.net.flow.criteria.Criteria;
import org.onosproject.net.flow.criteria.Criterion;
import org.onosproject.net.flow.criteria.EthCriterion;
import org.onosproject.net.flow.criteria.EthTypeCriterion;
import org.onosproject.net.flow.criteria.IPCriterion;
import org.onosproject.net.flow.criteria.IPProtocolCriterion;
import org.onosproject.net.flow.criteria.PortCriterion;
import org.onosproject.net.flow.criteria.VlanIdCriterion;
import org.onosproject.net.flowobjective.FilteringObjective;
import org.onosproject.net.flowobjective.FlowObjectiveStore;
import org.onosproject.net.flowobjective.ForwardingObjective;
import org.onosproject.net.flowobjective.NextObjective;
import org.onosproject.net.flowobjective.Objective;
import org.onosproject.net.flowobjective.ObjectiveError;
import org.onosproject.net.group.DefaultGroupBucket;
import org.onosproject.net.group.DefaultGroupDescription;
import org.onosproject.net.group.DefaultGroupKey;
import org.onosproject.net.group.Group;
import org.onosproject.net.group.GroupBucket;
import org.onosproject.net.group.GroupBuckets;
import org.onosproject.net.group.GroupDescription;
import org.onosproject.net.group.GroupEvent;
import org.onosproject.net.group.GroupKey;
import org.onosproject.net.group.GroupListener;
import org.onosproject.net.group.GroupService;
import org.slf4j.Logger;

import java.util.Collection;
import java.util.Collections;
import java.util.Set;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

import static org.onlab.util.Tools.groupedThreads;
import static org.slf4j.LoggerFactory.getLogger;

/**
 * OpenvSwitch emulation of the Corsa pipeline handler.
 */
public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeliner {

    protected static final int MAC_TABLE = 0;
    protected static final int VLAN_MPLS_TABLE = 1;
    protected static final int VLAN_TABLE = 2;
    //protected static final int MPLS_TABLE = 3;
    protected static final int ETHER_TABLE = 4;
    protected static final int COS_MAP_TABLE = 5;
    protected static final int FIB_TABLE = 6;
    protected static final int LOCAL_TABLE = 9;

    protected static final int CONTROLLER_PRIORITY = 255;
    private static final int DROP_PRIORITY = 0;
    private static final int HIGHEST_PRIORITY = 0xffff;

    private final Logger log = getLogger(getClass());

    private ServiceDirectory serviceDirectory;
    protected FlowRuleService flowRuleService;
    private CoreService coreService;
    private GroupService groupService;
    private FlowObjectiveStore flowObjectiveStore;
    protected DeviceId deviceId;
    protected ApplicationId appId;

    private KryoNamespace appKryo = new KryoNamespace.Builder()
            .register(GroupKey.class)
            .register(DefaultGroupKey.class)
            .register(CorsaGroup.class)
            .register(byte[].class)
            .build();

    private Cache<GroupKey, NextObjective> pendingGroups;

    private ScheduledExecutorService groupChecker =
            Executors.newScheduledThreadPool(2, groupedThreads("onos/pipeliner",
                                                               "ovs-corsa-%d"));

    @Override
    public void init(DeviceId deviceId, PipelinerContext context) {
        this.serviceDirectory = context.directory();
        this.deviceId = deviceId;

        pendingGroups = CacheBuilder.newBuilder()
                .expireAfterWrite(20, TimeUnit.SECONDS)
                .removalListener((RemovalNotification<GroupKey, NextObjective> notification) -> {
                    if (notification.getCause() == RemovalCause.EXPIRED) {
                        fail(notification.getValue(), ObjectiveError.GROUPINSTALLATIONFAILED);
                    }
                }).build();

        groupChecker.scheduleAtFixedRate(new GroupChecker(), 0, 500, TimeUnit.MILLISECONDS);

        coreService = serviceDirectory.get(CoreService.class);
        flowRuleService = serviceDirectory.get(FlowRuleService.class);
        groupService = serviceDirectory.get(GroupService.class);
        flowObjectiveStore = context.store();

        groupService.addListener(new InnerGroupListener());

        appId = coreService.registerApplication(
                "org.onosproject.driver.OVSCorsaPipeline");

        initializePipeline();
    }

    @Override
    public void filter(FilteringObjective filteringObjective) {
        if (filteringObjective.type() == FilteringObjective.Type.PERMIT) {
            processFilter(filteringObjective,
                          filteringObjective.op() == Objective.Operation.ADD,
                          filteringObjective.appId());
        } else {
            fail(filteringObjective, ObjectiveError.UNSUPPORTED);
        }
    }

    @Override
    public void forward(ForwardingObjective fwd) {
        Collection<FlowRule> rules;
        FlowRuleOperations.Builder flowBuilder = FlowRuleOperations.builder();

        rules = processForward(fwd);
        switch (fwd.op()) {
            case ADD:
                rules.stream()
                        .filter(rule -> rule != null)
                        .forEach(flowBuilder::add);
                break;
            case REMOVE:
                rules.stream()
                        .filter(rule -> rule != null)
                        .forEach(flowBuilder::remove);
                break;
            default:
                fail(fwd, ObjectiveError.UNKNOWN);
                log.warn("Unknown forwarding type {}", fwd.op());
        }

        flowRuleService.apply(flowBuilder.build(new FlowRuleOperationsContext() {
            @Override
            public void onSuccess(FlowRuleOperations ops) {
                pass(fwd);
            }

            @Override
            public void onError(FlowRuleOperations ops) {
                fail(fwd, ObjectiveError.FLOWINSTALLATIONFAILED);
            }
        }));

    }

    @Override
    public void next(NextObjective nextObjective) {
        switch (nextObjective.type()) {
            case SIMPLE:
                Collection<TrafficTreatment> treatments = nextObjective.next();
                if (treatments.size() == 1) {
                    TrafficTreatment treatment = treatments.iterator().next();
                    GroupBucket bucket =
                            DefaultGroupBucket.createIndirectGroupBucket(treatment);
                    final GroupKey key = new DefaultGroupKey(appKryo.serialize(nextObjective.id()));
                    GroupDescription groupDescription
                            = new DefaultGroupDescription(deviceId,
                                    GroupDescription.Type.INDIRECT,
                                    new GroupBuckets(Collections
                                                             .singletonList(bucket)),
                                    key,
                                    null, // let group service determine group id
                                    nextObjective.appId());
                    groupService.addGroup(groupDescription);
                    pendingGroups.put(key, nextObjective);
                }
                break;
            case HASHED:
            case BROADCAST:
            case FAILOVER:
                fail(nextObjective, ObjectiveError.UNSUPPORTED);
                log.warn("Unsupported next objective type {}", nextObjective.type());
                break;
            default:
                fail(nextObjective, ObjectiveError.UNKNOWN);
                log.warn("Unknown next objective type {}", nextObjective.type());
        }

    }

    private Collection<FlowRule> processForward(ForwardingObjective fwd) {
        switch (fwd.flag()) {
            case SPECIFIC:
                return processSpecific(fwd);
            case VERSATILE:
                return processVersatile(fwd);
            default:
                fail(fwd, ObjectiveError.UNKNOWN);
                log.warn("Unknown forwarding flag {}", fwd.flag());
        }
        return Collections.emptySet();
    }

    private Collection<FlowRule> processVersatile(ForwardingObjective fwd) {
        log.debug("Processing versatile forwarding objective");
        TrafficSelector selector = fwd.selector();

        EthTypeCriterion ethType =
                (EthTypeCriterion) selector.getCriterion(Criterion.Type.ETH_TYPE);
        if (ethType == null) {
            log.error("Versatile forwarding objective must include ethType");
            fail(fwd, ObjectiveError.UNKNOWN);
            return Collections.emptySet();
        }
        if (ethType.ethType().toShort() == Ethernet.TYPE_ARP) {
            log.warn("Driver automatically handles ARP packets by punting to controller "
                    + " from ETHER table");
            pass(fwd);
            return Collections.emptySet();
        } else if (ethType.ethType().toShort() == Ethernet.TYPE_LLDP ||
                ethType.ethType().toShort() == Ethernet.TYPE_BSN) {
            log.warn("Driver currently does not currently handle LLDP packets");
            fail(fwd, ObjectiveError.UNSUPPORTED);
            return Collections.emptySet();
        } else if (ethType.ethType().toShort() == Ethernet.TYPE_IPV4) {
            IPCriterion ipSrc = (IPCriterion) selector
                    .getCriterion(Criterion.Type.IPV4_SRC);
            IPCriterion ipDst = (IPCriterion) selector
                    .getCriterion(Criterion.Type.IPV4_DST);
            IPProtocolCriterion ipProto = (IPProtocolCriterion) selector
                    .getCriterion(Criterion.Type.IP_PROTO);
            if (ipSrc != null) {
                log.warn("Driver does not currently handle matching Src IP");
                fail(fwd, ObjectiveError.UNSUPPORTED);
                return Collections.emptySet();
            }
            if (ipDst != null) {
                log.error("Driver handles Dst IP matching as specific forwarding "
                        + "objective, not versatile");
                fail(fwd, ObjectiveError.UNSUPPORTED);
                return Collections.emptySet();
            }
            if (ipProto != null && ipProto.protocol() == IPv4.PROTOCOL_TCP) {
                log.warn("Driver automatically punts all packets reaching the "
                        + "LOCAL table to the controller");
                pass(fwd);
                return Collections.emptySet();
            }
        }

        log.warn("Driver does not support given versatile forwarding objective");
        fail(fwd, ObjectiveError.UNSUPPORTED);
        return Collections.emptySet();
    }

    private Collection<FlowRule> processSpecific(ForwardingObjective fwd) {
        log.debug("Processing specific forwarding objective");
        TrafficSelector selector = fwd.selector();
        EthTypeCriterion ethType =
                (EthTypeCriterion) selector.getCriterion(Criterion.Type.ETH_TYPE);
        if (ethType == null || ethType.ethType().toShort() != Ethernet.TYPE_IPV4) {
            fail(fwd, ObjectiveError.UNSUPPORTED);
            return Collections.emptySet();
        }

        TrafficSelector filteredSelector =
                DefaultTrafficSelector.builder()
                        .matchEthType(Ethernet.TYPE_IPV4)
                        .matchIPDst(
                                ((IPCriterion)
                                        selector.getCriterion(Criterion.Type.IPV4_DST)).ip())
                        .build();

        TrafficTreatment.Builder tb = DefaultTrafficTreatment.builder();

        if (fwd.nextId() != null) {
            NextGroup next = flowObjectiveStore.getNextGroup(fwd.nextId());
            GroupKey key = appKryo.deserialize(next.data());
            Group group = groupService.getGroup(deviceId, key);
            if (group == null) {
                log.warn("The group left!");
                fail(fwd, ObjectiveError.GROUPMISSING);
                return Collections.emptySet();
            }
            tb.group(group.id());
        }

        FlowRule.Builder ruleBuilder = DefaultFlowRule.builder()
                .fromApp(fwd.appId())
                .withPriority(fwd.priority())
                .forDevice(deviceId)
                .withSelector(filteredSelector)
                .withTreatment(tb.build());

        if (fwd.permanent()) {
            ruleBuilder.makePermanent();
        } else {
            ruleBuilder.makeTemporary(fwd.timeout());
        }

        ruleBuilder.forTable(FIB_TABLE);

        return Collections.singletonList(ruleBuilder.build());

    }

    private void processFilter(FilteringObjective filt, boolean install,
                                             ApplicationId applicationId) {
        // This driver only processes filtering criteria defined with switch
        // ports as the key
        PortCriterion p;
        if (!filt.key().equals(Criteria.dummy()) &&
                filt.key().type() == Criterion.Type.IN_PORT) {
            p = (PortCriterion) filt.key();
        } else {
            log.warn("No key defined in filtering objective from app: {}. Not"
                    + "processing filtering objective", applicationId);
            fail(filt, ObjectiveError.UNKNOWN);
            return;
        }
        // convert filtering conditions for switch-intfs into flowrules
        FlowRuleOperations.Builder ops = FlowRuleOperations.builder();
        for (Criterion c : filt.conditions()) {
            if (c.type() == Criterion.Type.ETH_DST) {
                EthCriterion e = (EthCriterion) c;
                log.debug("adding rule for MAC: {}", e.mac());
                TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
                TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
                selector.matchEthDst(e.mac());
                treatment.transition(VLAN_MPLS_TABLE);
                FlowRule rule = DefaultFlowRule.builder()
                        .forDevice(deviceId)
                        .withSelector(selector.build())
                        .withTreatment(treatment.build())
                        .withPriority(CONTROLLER_PRIORITY)
                        .fromApp(applicationId)
                        .makePermanent()
                        .forTable(MAC_TABLE).build();
                ops =  install ? ops.add(rule) : ops.remove(rule);
            } else if (c.type() == Criterion.Type.VLAN_VID) {
                VlanIdCriterion v = (VlanIdCriterion) c;
                log.debug("adding rule for VLAN: {}", v.vlanId());
                TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
                TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
                selector.matchVlanId(v.vlanId());
                selector.matchInPort(p.port());
                treatment.transition(ETHER_TABLE);
                treatment.deferred().popVlan();
                FlowRule rule = DefaultFlowRule.builder()
                        .forDevice(deviceId)
                        .withSelector(selector.build())
                        .withTreatment(treatment.build())
                        .withPriority(CONTROLLER_PRIORITY)
                        .fromApp(applicationId)
                        .makePermanent()
                        .forTable(VLAN_TABLE).build();
                ops = install ? ops.add(rule) : ops.remove(rule);
            } else if (c.type() == Criterion.Type.IPV4_DST) {
                IPCriterion ip = (IPCriterion) c;
                log.debug("adding rule for IP: {}", ip.ip());
                TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
                TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
                selector.matchEthType(Ethernet.TYPE_IPV4);
                selector.matchIPDst(ip.ip());
                treatment.transition(LOCAL_TABLE);
                FlowRule rule = DefaultFlowRule.builder()
                        .forDevice(deviceId)
                        .withSelector(selector.build())
                        .withTreatment(treatment.build())
                        .withPriority(HIGHEST_PRIORITY)
                        .fromApp(applicationId)
                        .makePermanent()
                        .forTable(FIB_TABLE).build();

                ops = install ? ops.add(rule) : ops.remove(rule);
            } else {
                log.warn("Driver does not currently process filtering condition"
                        + " of type: {}", c.type());
                fail(filt, ObjectiveError.UNSUPPORTED);
            }
        }
        // apply filtering flow rules
        flowRuleService.apply(ops.build(new FlowRuleOperationsContext() {
            @Override
            public void onSuccess(FlowRuleOperations ops) {
                pass(filt);
                log.info("Applied filtering rules");
            }

            @Override
            public void onError(FlowRuleOperations ops) {
                fail(filt, ObjectiveError.FLOWINSTALLATIONFAILED);
                log.info("Failed to apply filtering rules");
            }
        }));
    }

    private void pass(Objective obj) {
        if (obj.context().isPresent()) {
            obj.context().get().onSuccess(obj);
        }
    }

    private void fail(Objective obj, ObjectiveError error) {
        if (obj.context().isPresent()) {
            obj.context().get().onError(obj, error);
        }
    }

    private void initializePipeline() {
        processMacTable(true);
        processVlanMplsTable(true);
        processVlanTable(true);
        processEtherTable(true);
        processCosTable(true);
        processFibTable(true);
        processLocalTable(true);
    }

    private void processMacTable(boolean install) {
        TrafficSelector.Builder selector;
        TrafficTreatment.Builder treatment;

        // Bcast rule
        selector = DefaultTrafficSelector.builder();
        treatment = DefaultTrafficTreatment.builder();

        selector.matchEthDst(MacAddress.BROADCAST);
        treatment.transition(VLAN_MPLS_TABLE);

        FlowRule rule = DefaultFlowRule.builder()
                .forDevice(deviceId)
                .withSelector(selector.build())
                .withTreatment(treatment.build())
                .withPriority(CONTROLLER_PRIORITY)
                .fromApp(appId)
                .makePermanent()
                .forTable(MAC_TABLE).build();

        FlowRuleOperations.Builder ops = FlowRuleOperations.builder();

        ops = install ? ops.add(rule) : ops.remove(rule);

        //Drop rule
        selector = DefaultTrafficSelector.builder();
        treatment = DefaultTrafficTreatment.builder();

        treatment.drop();

        rule = DefaultFlowRule.builder()
                .forDevice(deviceId)
                .withSelector(selector.build())
                .withTreatment(treatment.build())
                .withPriority(DROP_PRIORITY)
                .fromApp(appId)
                .makePermanent()
                .forTable(MAC_TABLE).build();

        ops = install ? ops.add(rule) : ops.remove(rule);

        flowRuleService.apply(ops.build(new FlowRuleOperationsContext() {
            @Override
            public void onSuccess(FlowRuleOperations ops) {
                log.info("Provisioned mac table");
            }

            @Override
            public void onError(FlowRuleOperations ops) {
                log.info("Failed to provision mac table");
            }
        }));

    }

    protected void processVlanMplsTable(boolean install) {
        TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
        TrafficTreatment.Builder treatment = DefaultTrafficTreatment
                .builder();
        FlowRuleOperations.Builder ops = FlowRuleOperations.builder();
        FlowRule rule;

        selector.matchVlanId(VlanId.ANY);
        treatment.transition(VLAN_TABLE);

        rule = DefaultFlowRule.builder()
                .forDevice(deviceId)
                .withSelector(selector.build())
                .withTreatment(treatment.build())
                .withPriority(CONTROLLER_PRIORITY)
                .fromApp(appId)
                .makePermanent()
                .forTable(VLAN_MPLS_TABLE).build();

        ops = install ? ops.add(rule) : ops.remove(rule);

        flowRuleService.apply(ops.build(new FlowRuleOperationsContext() {
            @Override
            public void onSuccess(FlowRuleOperations ops) {
                log.info("Provisioned vlan/mpls table");
            }

            @Override
            public void onError(FlowRuleOperations ops) {
                log.info(
                        "Failed to provision vlan/mpls table");
            }
        }));

    }

    private void processVlanTable(boolean install) {
        TrafficSelector.Builder selector;
        TrafficTreatment.Builder treatment;
        FlowRuleOperations.Builder ops = FlowRuleOperations.builder();
        FlowRule rule;

        //Drop rule
        selector = DefaultTrafficSelector.builder();
        treatment = DefaultTrafficTreatment.builder();

        treatment.drop();

        rule = DefaultFlowRule.builder()
                .forDevice(deviceId)
                .withSelector(selector.build())
                .withTreatment(treatment.build())
                .withPriority(DROP_PRIORITY)
                .fromApp(appId)
                .makePermanent()
                .forTable(VLAN_TABLE).build();

        ops = install ? ops.add(rule) : ops.remove(rule);

        flowRuleService.apply(ops.build(new FlowRuleOperationsContext() {
            @Override
            public void onSuccess(FlowRuleOperations ops) {
                log.info("Provisioned vlan table");
            }

            @Override
            public void onError(FlowRuleOperations ops) {
                log.info("Failed to provision vlan table");
            }
        }));
    }

    private void processEtherTable(boolean install) {
        TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
        TrafficTreatment.Builder treatment = DefaultTrafficTreatment
                .builder();
        FlowRuleOperations.Builder ops = FlowRuleOperations.builder();
        FlowRule rule;

        selector.matchEthType(Ethernet.TYPE_ARP);
        treatment.punt();

        rule = DefaultFlowRule.builder()
                .forDevice(deviceId)
                .withSelector(selector.build())
                .withTreatment(treatment.build())
                .withPriority(CONTROLLER_PRIORITY)
                .fromApp(appId)
                .makePermanent()
                .forTable(ETHER_TABLE).build();

        ops = install ? ops.add(rule) : ops.remove(rule);

        selector = DefaultTrafficSelector.builder();
        treatment = DefaultTrafficTreatment.builder();

        selector.matchEthType(Ethernet.TYPE_IPV4);
        treatment.transition(COS_MAP_TABLE);

        rule = DefaultFlowRule.builder()
                .forDevice(deviceId)
                .withPriority(CONTROLLER_PRIORITY)
                .withSelector(selector.build())
                .withTreatment(treatment.build())
                .fromApp(appId)
                .makePermanent()
                .forTable(ETHER_TABLE).build();

        ops = install ? ops.add(rule) : ops.remove(rule);

        //Drop rule
        selector = DefaultTrafficSelector.builder();
        treatment = DefaultTrafficTreatment.builder();

        treatment.drop();

        rule = DefaultFlowRule.builder()
                .forDevice(deviceId)
                .withSelector(selector.build())
                .withTreatment(treatment.build())
                .withPriority(DROP_PRIORITY)
                .fromApp(appId)
                .makePermanent()
                .forTable(ETHER_TABLE).build();

        ops = install ? ops.add(rule) : ops.remove(rule);

        flowRuleService.apply(ops.build(new FlowRuleOperationsContext() {
            @Override
            public void onSuccess(FlowRuleOperations ops) {
                log.info("Provisioned ether table");
            }

            @Override
            public void onError(FlowRuleOperations ops) {
                log.info("Failed to provision ether table");
            }
        }));

    }

    private void processCosTable(boolean install) {
        TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
        TrafficTreatment.Builder treatment = DefaultTrafficTreatment
                .builder();
        FlowRuleOperations.Builder ops = FlowRuleOperations.builder();
        FlowRule rule;

        treatment.transition(FIB_TABLE);

        rule = DefaultFlowRule.builder()
                .forDevice(deviceId)
                .withSelector(selector.build())
                .withTreatment(treatment.build())
                .withPriority(DROP_PRIORITY)
                .fromApp(appId)
                .makePermanent()
                .forTable(COS_MAP_TABLE).build();

        ops = install ? ops.add(rule) : ops.remove(rule);

        flowRuleService.apply(ops.build(new FlowRuleOperationsContext() {
            @Override
            public void onSuccess(FlowRuleOperations ops) {
                log.info("Provisioned cos table");
            }

            @Override
            public void onError(FlowRuleOperations ops) {
                log.info("Failed to provision cos table");
            }
        }));

    }

    private void processFibTable(boolean install) {
        TrafficSelector.Builder selector;
        TrafficTreatment.Builder treatment;
        FlowRuleOperations.Builder ops = FlowRuleOperations.builder();
        FlowRule rule;

        //Drop rule
        selector = DefaultTrafficSelector.builder();
        treatment = DefaultTrafficTreatment.builder();

        treatment.drop();

        rule = DefaultFlowRule.builder()
                .forDevice(deviceId)
                .withSelector(selector.build())
                .withTreatment(treatment.build())
                .withPriority(DROP_PRIORITY)
                .fromApp(appId)
                .makePermanent()
                .forTable(FIB_TABLE).build();

        ops = install ? ops.add(rule) : ops.remove(rule);

        flowRuleService.apply(ops.build(new FlowRuleOperationsContext() {
            @Override
            public void onSuccess(FlowRuleOperations ops) {
                log.info("Provisioned FIB table");
            }

            @Override
            public void onError(FlowRuleOperations ops) {
                log.info("Failed to provision FIB table");
            }
        }));
    }

    private void processLocalTable(boolean install) {
        TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
        TrafficTreatment.Builder treatment = DefaultTrafficTreatment
                .builder();
        FlowRuleOperations.Builder ops = FlowRuleOperations.builder();
        FlowRule rule;

        treatment.punt();

        rule = DefaultFlowRule.builder()
                .forDevice(deviceId)
                .withSelector(selector.build())
                .withTreatment(treatment.build())
                .withPriority(CONTROLLER_PRIORITY)
                .fromApp(appId)
                .makePermanent()
                .forTable(LOCAL_TABLE).build();

        ops = install ? ops.add(rule) : ops.remove(rule);

        flowRuleService.apply(ops.build(new FlowRuleOperationsContext() {
            @Override
            public void onSuccess(FlowRuleOperations ops) {
                log.info("Provisioned Local table");
            }

            @Override
            public void onError(FlowRuleOperations ops) {
                log.info("Failed to provision Local table");
            }
        }));
    }

    private class InnerGroupListener implements GroupListener {
        @Override
        public void event(GroupEvent event) {
            if (event.type() == GroupEvent.Type.GROUP_ADDED) {
                GroupKey key = event.subject().appCookie();

                NextObjective obj = pendingGroups.getIfPresent(key);
                if (obj != null) {
                    flowObjectiveStore.putNextGroup(obj.id(), new CorsaGroup(key));
                    pass(obj);
                    pendingGroups.invalidate(key);
                }
            }
        }
    }

    private class GroupChecker implements Runnable {

        @Override
        public void run() {
            Set<GroupKey> keys = pendingGroups.asMap().keySet().stream()
                    .filter(key -> groupService.getGroup(deviceId, key) != null)
                    .collect(Collectors.toSet());

            keys.stream().forEach(key -> {
                NextObjective obj = pendingGroups.getIfPresent(key);
                if (obj == null) {
                    return;
                }
                pass(obj);
                pendingGroups.invalidate(key);
                log.info("Heard back from group service for group {}. "
                        + "Applying pending forwarding objectives", obj.id());
                flowObjectiveStore.putNextGroup(obj.id(), new CorsaGroup(key));
            });
        }
    }

    private class CorsaGroup implements NextGroup {

        private final GroupKey key;

        public CorsaGroup(GroupKey key) {
            this.key = key;
        }

        @SuppressWarnings("unused")
        public GroupKey key() {
            return key;
        }

        @Override
        public byte[] data() {
            return appKryo.serialize(key);
        }

    }
}


text:
package org.apache.spark.internal.config

private[spark] object R {

  val R_BACKEND_CONNECTION_TIMEOUT = ConfigBuilder("spark.r.backendConnectionTimeout")
    .version("2.1.0")
    .intConf
    .createWithDefault(6000)

  val R_NUM_BACKEND_THREADS = ConfigBuilder("spark.r.numRBackendThreads")
    .version("1.4.0")
    .intConf
    .createWithDefault(2)

  val R_HEARTBEAT_INTERVAL = ConfigBuilder("spark.r.heartBeatInterval")
    .version("2.1.0")
    .intConf
    .createWithDefault(100)

  val SPARKR_COMMAND = ConfigBuilder("spark.sparkr.r.command")
    .version("1.5.3")
    .stringConf
    .createWithDefault("Rscript")

  val R_COMMAND = ConfigBuilder("spark.r.command")
    .version("1.5.3")
    .stringConf
    .createOptional
}


text:
package com.azure.resourcemanager.connectedvmware.implementation;

import com.azure.core.management.Region;
import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.connectedvmware.fluent.models.MachineExtensionInner;
import com.azure.resourcemanager.connectedvmware.models.MachineExtension;
import com.azure.resourcemanager.connectedvmware.models.MachineExtensionPropertiesInstanceView;
import com.azure.resourcemanager.connectedvmware.models.MachineExtensionUpdate;
import java.util.Collections;
import java.util.Map;

public final class MachineExtensionImpl
    implements MachineExtension, MachineExtension.Definition, MachineExtension.Update {
    private MachineExtensionInner innerObject;

    private final com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager;

    public String id() {
        return this.innerModel().id();
    }

    public String name() {
        return this.innerModel().name();
    }

    public String type() {
        return this.innerModel().type();
    }

    public String location() {
        return this.innerModel().location();
    }

    public Map<String, String> tags() {
        Map<String, String> inner = this.innerModel().tags();
        if (inner != null) {
            return Collections.unmodifiableMap(inner);
        } else {
            return Collections.emptyMap();
        }
    }

    public SystemData systemData() {
        return this.innerModel().systemData();
    }

    public String forceUpdateTag() {
        return this.innerModel().forceUpdateTag();
    }

    public String publisher() {
        return this.innerModel().publisher();
    }

    public String typePropertiesType() {
        return this.innerModel().typePropertiesType();
    }

    public String typeHandlerVersion() {
        return this.innerModel().typeHandlerVersion();
    }

    public Boolean enableAutomaticUpgrade() {
        return this.innerModel().enableAutomaticUpgrade();
    }

    public Boolean autoUpgradeMinorVersion() {
        return this.innerModel().autoUpgradeMinorVersion();
    }

    public Object settings() {
        return this.innerModel().settings();
    }

    public Object protectedSettings() {
        return this.innerModel().protectedSettings();
    }

    public String provisioningState() {
        return this.innerModel().provisioningState();
    }

    public MachineExtensionPropertiesInstanceView instanceView() {
        return this.innerModel().instanceView();
    }

    public Region region() {
        return Region.fromName(this.regionName());
    }

    public String regionName() {
        return this.location();
    }

    public String resourceGroupName() {
        return resourceGroupName;
    }

    public MachineExtensionInner innerModel() {
        return this.innerObject;
    }

    private com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager() {
        return this.serviceManager;
    }

    private String resourceGroupName;

    private String name;

    private String extensionName;

    private MachineExtensionUpdate updateExtensionParameters;

    public MachineExtensionImpl withExistingVirtualMachine(String resourceGroupName, String name) {
        this.resourceGroupName = resourceGroupName;
        this.name = name;
        return this;
    }

    public MachineExtension create() {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getMachineExtensions()
                .createOrUpdate(resourceGroupName, name, extensionName, this.innerModel(), Context.NONE);
        return this;
    }

    public MachineExtension create(Context context) {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getMachineExtensions()
                .createOrUpdate(resourceGroupName, name, extensionName, this.innerModel(), context);
        return this;
    }

    MachineExtensionImpl(String name, com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) {
        this.innerObject = new MachineExtensionInner();
        this.serviceManager = serviceManager;
        this.extensionName = name;
    }

    public MachineExtensionImpl update() {
        this.updateExtensionParameters = new MachineExtensionUpdate();
        return this;
    }

    public MachineExtension apply() {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getMachineExtensions()
                .update(resourceGroupName, name, extensionName, updateExtensionParameters, Context.NONE);
        return this;
    }

    public MachineExtension apply(Context context) {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getMachineExtensions()
                .update(resourceGroupName, name, extensionName, updateExtensionParameters, context);
        return this;
    }

    MachineExtensionImpl(
        MachineExtensionInner innerObject,
        com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) {
        this.innerObject = innerObject;
        this.serviceManager = serviceManager;
        this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
        this.name = Utils.getValueFromIdByName(innerObject.id(), "virtualMachines");
        this.extensionName = Utils.getValueFromIdByName(innerObject.id(), "extensions");
    }

    public MachineExtension refresh() {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getMachineExtensions()
                .getWithResponse(resourceGroupName, name, extensionName, Context.NONE)
                .getValue();
        return this;
    }

    public MachineExtension refresh(Context context) {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getMachineExtensions()
                .getWithResponse(resourceGroupName, name, extensionName, context)
                .getValue();
        return this;
    }

    public MachineExtensionImpl withRegion(Region location) {
        this.innerModel().withLocation(location.toString());
        return this;
    }

    public MachineExtensionImpl withRegion(String location) {
        this.innerModel().withLocation(location);
        return this;
    }

    public MachineExtensionImpl withTags(Map<String, String> tags) {
        if (isInCreateMode()) {
            this.innerModel().withTags(tags);
            return this;
        } else {
            this.updateExtensionParameters.withTags(tags);
            return this;
        }
    }

    public MachineExtensionImpl withForceUpdateTag(String forceUpdateTag) {
        if (isInCreateMode()) {
            this.innerModel().withForceUpdateTag(forceUpdateTag);
            return this;
        } else {
            this.updateExtensionParameters.withForceUpdateTag(forceUpdateTag);
            return this;
        }
    }

    public MachineExtensionImpl withPublisher(String publisher) {
        if (isInCreateMode()) {
            this.innerModel().withPublisher(publisher);
            return this;
        } else {
            this.updateExtensionParameters.withPublisher(publisher);
            return this;
        }
    }

    public MachineExtensionImpl withTypePropertiesType(String typePropertiesType) {
        this.innerModel().withTypePropertiesType(typePropertiesType);
        return this;
    }

    public MachineExtensionImpl withTypeHandlerVersion(String typeHandlerVersion) {
        if (isInCreateMode()) {
            this.innerModel().withTypeHandlerVersion(typeHandlerVersion);
            return this;
        } else {
            this.updateExtensionParameters.withTypeHandlerVersion(typeHandlerVersion);
            return this;
        }
    }

    public MachineExtensionImpl withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) {
        if (isInCreateMode()) {
            this.innerModel().withEnableAutomaticUpgrade(enableAutomaticUpgrade);
            return this;
        } else {
            this.updateExtensionParameters.withEnableAutomaticUpgrade(enableAutomaticUpgrade);
            return this;
        }
    }

    public MachineExtensionImpl withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) {
        if (isInCreateMode()) {
            this.innerModel().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion);
            return this;
        } else {
            this.updateExtensionParameters.withAutoUpgradeMinorVersion(autoUpgradeMinorVersion);
            return this;
        }
    }

    public MachineExtensionImpl withSettings(Object settings) {
        if (isInCreateMode()) {
            this.innerModel().withSettings(settings);
            return this;
        } else {
            this.updateExtensionParameters.withSettings(settings);
            return this;
        }
    }

    public MachineExtensionImpl withProtectedSettings(Object protectedSettings) {
        if (isInCreateMode()) {
            this.innerModel().withProtectedSettings(protectedSettings);
            return this;
        } else {
            this.updateExtensionParameters.withProtectedSettings(protectedSettings);
            return this;
        }
    }

    public MachineExtensionImpl withInstanceView(MachineExtensionPropertiesInstanceView instanceView) {
        this.innerModel().withInstanceView(instanceView);
        return this;
    }

    public MachineExtensionImpl withType(String type) {
        this.updateExtensionParameters.withType(type);
        return this;
    }

    private boolean isInCreateMode() {
        return this.innerModel().id() == null;
    }
}


text:
#ifndef _GLOB_H_
#define	_GLOB_H_

#include <_types.h>
#include <sys/cdefs.h>
#include <Availability.h>
#include <sys/_types/_size_t.h>

#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
struct dirent;
struct stat;
#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
typedef struct {
	size_t gl_pathc;	/* Count of total paths so far. */
	int gl_matchc;		/* Count of paths matching pattern. */
	size_t gl_offs;		/* Reserved at beginning of gl_pathv. */
	int gl_flags;		/* Copy of flags parameter to glob. */
	char **gl_pathv;	/* List of paths matching pattern. */
				/* Copy of errfunc parameter to glob. */
#ifdef __BLOCKS__
	union {
#endif /* __BLOCKS__ */
		int (*gl_errfunc)(const char *, int);
#ifdef __BLOCKS__
		int (^gl_errblk)(const char *, int);
	};
#endif /* __BLOCKS__ */

	/*
	 * Alternate filesystem access methods for glob; replacement
	 * versions of closedir(3), readdir(3), opendir(3), stat(2)
	 * and lstat(2).
	 */
	void (*gl_closedir)(void *);
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
	struct dirent *(*gl_readdir)(void *);
#else /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
	void *(*gl_readdir)(void *);
#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
	void *(*gl_opendir)(const char *);
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
	int (*gl_lstat)(const char *, struct stat *);
	int (*gl_stat)(const char *, struct stat *);
#else /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
	int (*gl_lstat)(const char *, void *);
	int (*gl_stat)(const char *, void *);
#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
} glob_t;

/* Believed to have been introduced in 1003.2-1992 */
#define	GLOB_APPEND	0x0001	/* Append to output from previous call. */
#define	GLOB_DOOFFS	0x0002	/* Use gl_offs. */
#define	GLOB_ERR	0x0004	/* Return on error. */
#define	GLOB_MARK	0x0008	/* Append / to matching directories. */
#define	GLOB_NOCHECK	0x0010	/* Return pattern itself if nothing matches. */
#define	GLOB_NOSORT	0x0020	/* Don't sort. */
#define	GLOB_NOESCAPE	0x2000	/* Disable backslash escaping. */

/* Error values returned by glob(3) */
#define	GLOB_NOSPACE	(-1)	/* Malloc call failed. */
#define	GLOB_ABORTED	(-2)	/* Unignored error. */
#define	GLOB_NOMATCH	(-3)	/* No match and GLOB_NOCHECK was not set. */
#define	GLOB_NOSYS	(-4)	/* Obsolete: source comptability only. */

#define	GLOB_ALTDIRFUNC	0x0040	/* Use alternately specified directory funcs. */
#define	GLOB_BRACE	0x0080	/* Expand braces ala csh. */
#define	GLOB_MAGCHAR	0x0100	/* Pattern had globbing characters. */
#define	GLOB_NOMAGIC	0x0200	/* GLOB_NOCHECK without magic chars (csh). */
#define	GLOB_QUOTE	0x0400	/* Quote special chars with \. */
#define	GLOB_TILDE	0x0800	/* Expand tilde names from the passwd file. */
#define	GLOB_LIMIT	0x1000	/* limit number of returned paths */
#ifdef __BLOCKS__
#define	_GLOB_ERR_BLOCK	0x80000000 /* (internal) error callback is a block */
#endif /* __BLOCKS__ */

/* source compatibility, these are the old names */
#define GLOB_MAXPATH	GLOB_LIMIT
#define	GLOB_ABEND	GLOB_ABORTED

__BEGIN_DECLS
int	glob(const char * __restrict, int, int (*)(const char *, int),
	     glob_t * __restrict) __DARWIN_INODE64(glob);
#ifdef __BLOCKS__
#if __has_attribute(noescape)
#define __glob_noescape __attribute__((__noescape__))
#else
#define __glob_noescape
#endif
int	glob_b(const char * __restrict, int, int (^)(const char *, int) __glob_noescape,
	     glob_t * __restrict) __DARWIN_INODE64(glob_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
#endif /* __BLOCKS__ */
void	globfree(glob_t *);
__END_DECLS

#endif /* !_GLOB_H_ */


text:
@interface SFBLEDeviceFinder () {
  __block SMDelayedBlockHandle _scanTimeoutBlock;
}

@property (nonatomic) NSMutableDictionary* discoveredDevices;
@property (nonatomic, copy) NSUUID* identifierToScanFor;
@property (nonatomic, copy) NSString* nameToScanFor;
@property (nonatomic) BOOL stopAfterFirstDevice;
@property (atomic) BOOL shouldScan;
@property (nonatomic) NSTimeInterval scanTimeout;

@property (nonatomic) NSDictionary* servicesAndCharacteristics;
@property (nonatomic, copy) NSArray* advertisedServices;
@property (nonatomic) SFBLECentralManagerDelegate* centralDelegate;

@property (atomic) BOOL bluetoothIsNotAvailable;

// Private Methods for Pod-Internal Use
// ====================================

+ (dispatch_queue_t)bleQueue;
// SFBLECentralManagerDelegate
- (void)didDiscoverPeripheral:(CBPeripheral*)peripheral RSSI:(NSNumber*)RSSI;
- (void)bluetoothNotAvailable;
- (void)bluetoothAvailableAgain;

@end


text:
Updated `sheetsee-tables` to allow you to re-use a template (rather than duplicating it for each different table you wanted to create). Previously it assumed your HTML table `div` id matched your script template `id`. This means that you can pass in an extra key/value pair in your table options into `Sheetsee.maketable()`. The new pair it takes is: `"templateID" : "yourtemplateid"`. Example below, full `sheetsee-tables` documentation [here](docs/sheetsee-tables.html).

```JavaScript
var tableOptions = {
                    "data": gData,
                    "pagination": 10,
                    "tableDiv": "#fullTable",
                    "filterDiv": "#fullTableFilter",
                    "templateID": "tableTemplte"
                    }
Sheetsee.makeTable(tableOptions)
```

## May 2014
### Important Google Spreadsheets & Tabletop News

Google recently updated their Google Spreadsheets and the API. For a bit this was breaking things using the old API, including Tabletop. This has been fixed and the latest version of tabletop.js works on both old and new spreadsheets. **Be sure to include at least version 1.3.4 in your project.**

## August 13, 2013
### Charting Intake

D3 charts need an array of objects, and something to chart: the thing itself (aka labels) and the corresponding value (aka units). Your data usually contains more than D3 needs to make the chart, so you have to tell it what to chart from your data to chart.

Previously Sheetsee required you pass your data through a function, `addUnitsAndLabels()` which took in your data and the things you wanted to chart, reformatted your data for you so that you could pass it into one of the d3 charts. This is one more step than actually needs to happen.

Now Sheetsee just asks for what you want your _labels_ and _units_ to be in the options you give it when calling the chart function. It then sorts the data correctly on the inside of the chart function. Yay, easier!

```javascript
var options = {
  labels: "name",
  units: "cuddleability",
  m: [60, 60, 30, 150],
  w: 600, h: 400,
  div: "#barChart",
  xaxis: "no. of pennies",
  hiColor: "#FF317D"
}
```

Thanks @maxogden for the help with this.

### Started doing this changelong pretty late in the game.


text:
cask "crypter" do
  version "5.0.0"
  sha256 "ed136dbfacae87d52493e56e0e225d13203de997c54e7ac5f159feeadfcd4b7a"

  url "https://github.com/HR/Crypter/releases/download/v#{version}/Crypter-#{version}.dmg"
  appcast "https://github.com/HR/Crypter/releases.atom"
  name "Crypter"
  desc "Innovative, convenient and secure cross-platform encryption app"
  homepage "https://github.com/HR/Crypter"

  app "Crypter.app"
end


text:
package org.dspace.sort;

import org.apache.log4j.Logger;
import org.dspace.text.filter.TextFilter;
import org.dspace.sort.OrderFormatDelegate;

/**
 * Helper class for creating order delegates.
 *
 * To configure the filters create a subclass and, in an object initializer,
 * create an array of classes that implement TextFilter:
 *
 * class MyLocaleDelegate extends AbstractTextFilterOFD {
 *   {
 *      filters = new TextFilter[] { new LocaleOrderingFilter(); }
 *   }
 * }
 *
 * The order they are in the array, is the order that they are executed.
 * (this may be important for some filters - read their documentation!)
 *
 * Example configurations that could be used:
 * { new DecomposeDiactritics(), new StripDiacritics(), new LowerCaseAndTrim() }
 *    - Decompose and then strip the diacritics, lowercase and trim the string.
 *
 * { new MARC21InitialArticleWord(), new DecomposeDiactritics(), new LowerCaseTrim() }
 *    - Parse the initial article words based on the Library of Congress list of
 *      definite/indefinite article words, decompose diacritics, and lowercase/trim.
 *
 * { new LowerCaseTrim(), new LocaleOrderingFilter() }
 *    - Lowercase the string, then make a locale dependent sort text
 *      (note that the sort text is not human readable)
 *
 * @author Graham Triggs
 */
public abstract class AbstractTextFilterOFD implements OrderFormatDelegate
{
	private static final Logger log = Logger.getLogger(AbstractTextFilterOFD.class);

	// Initialised in subclass in an object initializer
	protected TextFilter[] filters;

	/**
	 * Prepare the appropriate sort string for the given value in the
	 * given language.  Language should be supplied with the ISO-6390-1
	 * or ISO-639-2 standards.  For example "en" or "eng".
	 *
	 * @param	value	the string value
	 * @param	language	the language to interpret in
	 */
	public String makeSortString(String value, String language)
	{
		if (filters == null)
		{
			// Log an error if the class is not configured correctly
			log.error("No filters defined for " + this.getClass().getName());
		}
		else
		{
			// Normalize language into a two or three character code
	        if (language != null)
	        {
	            if (language.length() > 2 && language.charAt(2) == '_')
                {
                    language = language.substring(0, 2);
                }

	            if (language.length() > 3)
                {
                    language = language.substring(0, 3);
                }
	        }

	        // Iterate through filters, applying each in turn
	        for (int idx = 0; idx < filters.length; idx++)
	        {
	            if (language != null)
                {
                    value = filters[idx].filter(value, language);
                }
	            else
                {
                    value = filters[idx].filter(value);
                }
	        }
		}

        return value;
    }
}


text:
Variant Calling
===============

Our variant calling pipeline has three major components:

* SNV calling
* Structural Variant calling
* Effect prediction

SNV Calling
-----------

We use Freebayes.  See: https://github.com/ekg/freebayes.

Structural Variant Calling
--------------------------

TODO

Effect Prediction
-----------------

UPSTREAM/DOWNSTREAM - We set a default of 50bp to look for upstream/downstream
effects.


text:
namespace WindowsCEDemoForm
{
   partial class WindowsCEDemoForm
   {
      /// <summary>
      /// Erforderliche Designervariable.
      /// </summary>
      private System.ComponentModel.IContainer components = null;

      /// <summary>
      /// Verwendete Ressourcen bereinigen.
      /// </summary>
      /// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
      protected override void Dispose(bool disposing)
      {
         if (disposing && (components != null))
         {
            components.Dispose();
         }
         base.Dispose(disposing);
      }

      #region Vom Windows Form-Designer generierter Code

      private void InitializeComponent()
      {
         this.labDuration = new System.Windows.Forms.Label();
         this.btnSelectBarcodeImageFileForDecoding = new System.Windows.Forms.Button();
         this.txtContent = new System.Windows.Forms.TextBox();
         this.labContent = new System.Windows.Forms.Label();
         this.txtType = new System.Windows.Forms.TextBox();
         this.labBarcodeType = new System.Windows.Forms.Label();
         this.picBarcode = new System.Windows.Forms.PictureBox();
         this.btnStartDecoding = new System.Windows.Forms.Button();
         this.txtBarcodeImageFile = new System.Windows.Forms.TextBox();
         this.labBarcodeImageFile = new System.Windows.Forms.Label();
         this.btnStartEncoding = new System.Windows.Forms.Button();
         this.SuspendLayout();
         //
         // labDuration
         //
         this.labDuration.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                     | System.Windows.Forms.AnchorStyles.Right)));
         this.labDuration.Location = new System.Drawing.Point(132, 52);
         this.labDuration.Name = "labDuration";
         this.labDuration.Size = new System.Drawing.Size(106, 22);
         //
         // btnSelectBarcodeImageFileForDecoding
         //
         this.btnSelectBarcodeImageFileForDecoding.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
         this.btnSelectBarcodeImageFileForDecoding.Location = new System.Drawing.Point(265, 23);
         this.btnSelectBarcodeImageFileForDecoding.Name = "btnSelectBarcodeImageFileForDecoding";
         this.btnSelectBarcodeImageFileForDecoding.Size = new System.Drawing.Size(35, 21);
         this.btnSelectBarcodeImageFileForDecoding.TabIndex = 18;
         this.btnSelectBarcodeImageFileForDecoding.Text = "...";
         this.btnSelectBarcodeImageFileForDecoding.Click += new System.EventHandler(this.btnSelectBarcodeImageFileForDecoding_Click);
         //
         // txtContent
         //
         this.txtContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                     | System.Windows.Forms.AnchorStyles.Left)
                     | System.Windows.Forms.AnchorStyles.Right)));
         this.txtContent.Location = new System.Drawing.Point(132, 137);
         this.txtContent.Multiline = true;
         this.txtContent.Name = "txtContent";
         this.txtContent.Size = new System.Drawing.Size(168, 46);
         this.txtContent.TabIndex = 17;
         //
         // labContent
         //
         this.labContent.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                     | System.Windows.Forms.AnchorStyles.Right)));
         this.labContent.Location = new System.Drawing.Point(132, 120);
         this.labContent.Name = "labContent";
         this.labContent.Size = new System.Drawing.Size(168, 14);
         this.labContent.Text = "Content";
         //
         // txtType
         //
         this.txtType.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                     | System.Windows.Forms.AnchorStyles.Right)));
         this.txtType.Location = new System.Drawing.Point(132, 94);
         this.txtType.Name = "txtType";
         this.txtType.Size = new System.Drawing.Size(168, 23);
         this.txtType.TabIndex = 16;
         //
         // labBarcodeType
         //
         this.labBarcodeType.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                     | System.Windows.Forms.AnchorStyles.Right)));
         this.labBarcodeType.Location = new System.Drawing.Point(132, 74);
         this.labBarcodeType.Name = "labBarcodeType";
         this.labBarcodeType.Size = new System.Drawing.Size(168, 17);
         this.labBarcodeType.Text = "Barcode Type";
         //
         // picBarcode
         //
         this.picBarcode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                     | System.Windows.Forms.AnchorStyles.Left)));
         this.picBarcode.Location = new System.Drawing.Point(3, 52);
         this.picBarcode.Name = "picBarcode";
         this.picBarcode.Size = new System.Drawing.Size(123, 130);
         //
         // btnStartDecoding
         //
         this.btnStartDecoding.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
         this.btnStartDecoding.Location = new System.Drawing.Point(244, 50);
         this.btnStartDecoding.Name = "btnStartDecoding";
         this.btnStartDecoding.Size = new System.Drawing.Size(56, 21);
         this.btnStartDecoding.TabIndex = 15;
         this.btnStartDecoding.Text = "Decode";
         this.btnStartDecoding.Click += new System.EventHandler(this.btnStartDecoding_Click);
         //
         // txtBarcodeImageFile
         //
         this.txtBarcodeImageFile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                     | System.Windows.Forms.AnchorStyles.Right)));
         this.txtBarcodeImageFile.Location = new System.Drawing.Point(0, 23);
         this.txtBarcodeImageFile.Name = "txtBarcodeImageFile";
         this.txtBarcodeImageFile.Size = new System.Drawing.Size(257, 23);
         this.txtBarcodeImageFile.TabIndex = 14;
         this.txtBarcodeImageFile.TextChanged += new System.EventHandler(this.txtBarcodeImageFile_TextChanged);
         //
         // labBarcodeImageFile
         //
         this.labBarcodeImageFile.Location = new System.Drawing.Point(0, 0);
         this.labBarcodeImageFile.Name = "labBarcodeImageFile";
         this.labBarcodeImageFile.Size = new System.Drawing.Size(151, 20);
         this.labBarcodeImageFile.Text = "Barcode Image File";
         //
         // btnStartEncoding
         //
         this.btnStartEncoding.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
         this.btnStartEncoding.Location = new System.Drawing.Point(182, 50);
         this.btnStartEncoding.Name = "btnStartEncoding";
         this.btnStartEncoding.Size = new System.Drawing.Size(56, 21);
         this.btnStartEncoding.TabIndex = 23;
         this.btnStartEncoding.Text = "Encode";
         this.btnStartEncoding.Click += new System.EventHandler(this.btnStartEncoding_Click);
         //
         // WindowsCEDemoForm
         //
         this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
         this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
         this.AutoScroll = true;
         this.ClientSize = new System.Drawing.Size(318, 194);
         this.Controls.Add(this.btnStartEncoding);
         this.Controls.Add(this.labDuration);
         this.Controls.Add(this.btnSelectBarcodeImageFileForDecoding);
         this.Controls.Add(this.txtContent);
         this.Controls.Add(this.labContent);
         this.Controls.Add(this.txtType);
         this.Controls.Add(this.labBarcodeType);
         this.Controls.Add(this.picBarcode);
         this.Controls.Add(this.btnStartDecoding);
         this.Controls.Add(this.txtBarcodeImageFile);
         this.Controls.Add(this.labBarcodeImageFile);
         this.Name = "WindowsCEDemoForm";
         this.Text = "WindowsCEDemo";
         this.ResumeLayout(false);

      }

      #endregion

      private System.Windows.Forms.Label labDuration;
      private System.Windows.Forms.Button btnSelectBarcodeImageFileForDecoding;
      private System.Windows.Forms.TextBox txtContent;
      private System.Windows.Forms.Label labContent;
      private System.Windows.Forms.TextBox txtType;
      private System.Windows.Forms.Label labBarcodeType;
      private System.Windows.Forms.PictureBox picBarcode;
      private System.Windows.Forms.Button btnStartDecoding;
      private System.Windows.Forms.TextBox txtBarcodeImageFile;
      private System.Windows.Forms.Label labBarcodeImageFile;
      private System.Windows.Forms.Button btnStartEncoding;
   }
}


text:
package org.drools.testcoverage.functional;

import java.util.Collection;

import org.assertj.core.api.Assertions;
import org.drools.testcoverage.common.model.Person;
import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
import org.drools.testcoverage.common.util.KieBaseUtil;
import org.drools.testcoverage.common.util.KieUtil;
import org.drools.testcoverage.common.util.TestParametersUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.kie.api.KieBase;
import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.Message.Level;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.rule.QueryResults;

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

/**
 * Tests bad using and accessing to queries.
 */
@RunWith(Parameterized.class)
public class QueryBadResultTest {

    private final KieBaseTestConfiguration kieBaseTestConfiguration;

    public QueryBadResultTest(final KieBaseTestConfiguration kieBaseTestConfiguration) {
        this.kieBaseTestConfiguration = kieBaseTestConfiguration;
    }

    @Parameterized.Parameters(name = "KieBase type={0}")
    public static Collection<Object[]> getParameters() {
        return TestParametersUtil.getKieBaseConfigurations();
    }

    @Test
    public void testQueriesWithSameNameInOneFile() {
        final KieBuilder kieBuilder =
                KieUtil.getKieBuilderFromClasspathResources(kieBaseTestConfiguration, getClass(), false, "query-two-same-names.drl");
        Assertions.assertThat(kieBuilder.getResults().getMessages(Level.ERROR).isEmpty()).isFalse();
    }

    @Test
    public void testQueriesWithSameNameInTwoFiles() {
        final KieBuilder kieBuilder =
                KieUtil.getKieBuilderFromClasspathResources(
                        kieBaseTestConfiguration,
                        getClass(),
                        false,
                        "query-same-name-1.drl",
                        "query-same-name-2.drl");

        Assertions.assertThat(kieBuilder.getResults().getMessages(Level.ERROR).isEmpty()).isFalse();
    }

    @Test
    public void testQueryWithoutName() {
        final KieBuilder kieBuilder =
                KieUtil.getKieBuilderFromClasspathResources(kieBaseTestConfiguration, getClass(), false, "query-without-name.drl");
        Assertions.assertThat(kieBuilder.getResults().getMessages(Level.ERROR).isEmpty()).isFalse();
    }

    @Test
    public void testQueryCalledWithoutParamsButItHasParams() {
        final KieBase kieBase = KieBaseUtil.getKieBaseFromClasspathResources(getClass(), kieBaseTestConfiguration, "query.drl");
        final KieSession ksession = kieBase.newKieSession();
        ksession.insert(new Person("Petr"));

        try {
            ksession.getQueryResults("personWithName");
            fail("invocation with wrong number of arguments must fail");
        } catch (RuntimeException e) {
            assertTrue( e.getMessage().contains( "wrong number of arguments" ) );
        }
    }

    @Test
    public void testBadAccessToParameterWithoutType() {
        final KieBuilder kieBuilder =
                KieUtil.getKieBuilderFromClasspathResources(kieBaseTestConfiguration, getClass(), false, "query-bad-parametr-access.drl");
        Assertions.assertThat(kieBuilder.getResults().getMessages(Level.ERROR).isEmpty()).isFalse();
    }

    @Test(expected = IllegalArgumentException.class)
    public void testAccessToNotExistingVariable() {
        final KieBase kieBase = KieBaseUtil.getKieBaseFromClasspathResources(getClass(), kieBaseTestConfiguration,"query.drl");
        final KieSession ksession = kieBase.newKieSession();
        ksession.insert(new Person("Petr"));

        final QueryResults results = ksession.getQueryResults("simple query with no parameters");
        results.iterator().next().get("bad");
    }
}


text:
layout: page
title: Small 35th Anniversary
date: 2016-05-24
author: Daniel Hood
tags: weekly links, java
status: published
summary: Etiam tristique sapien a bibendum tristique. Etiam quis faucibus lacus.
banner: images/banner/leisure-04.jpg
booking:
  startDate: 04/28/2017
  endDate: 04/30/2017
  ctyhocn: RSNLAHX
  groupCode: S3A
published: true
---
Nunc odio ante, mattis vulputate pretium sed, dapibus ac nibh. Maecenas euismod lacus nisi, a ornare eros volutpat et. Donec vel vestibulum orci. Mauris ut ullamcorper quam, non pharetra nisl. Phasellus hendrerit nulla augue, et lacinia nisl bibendum eget. Sed consequat urna justo, at facilisis enim mollis a. Etiam sed leo nec diam pretium scelerisque a a lectus. Sed id massa elit. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nullam pulvinar neque a leo vehicula consequat. Aliquam erat volutpat. Praesent tincidunt consectetur fermentum.

* Phasellus non nisi vitae metus tempus efficitur
* Sed non orci et lorem gravida blandit
* Nam dignissim nisi in eleifend tincidunt.

Duis arcu nibh, placerat ac molestie non, lobortis a augue. Morbi feugiat enim rhoncus justo maximus fringilla. Morbi arcu purus, pulvinar ac mollis at, congue molestie purus. Maecenas aliquam, leo eget tempor viverra, nisi ex hendrerit ipsum, ac scelerisque arcu urna vel nisl. Praesent sodales turpis sem, eget dictum dui euismod varius. Praesent facilisis felis eu purus rhoncus dignissim. Donec dignissim metus et varius tempus. Nulla vel sem ante. Maecenas nunc ante, vestibulum non egestas ut, luctus sodales diam. Sed at ex sed metus luctus commodo. Morbi vitae porttitor diam, ac pharetra sem. Donec maximus dapibus nulla, venenatis dignissim neque lacinia at. Fusce at turpis lacus. In eu mollis felis. Cras tellus sapien, tempor quis leo quis, mattis suscipit purus.


text:
package behavioral.observer;

import model.Knight;

/**
 *
 * @author prvoslav
 *
 * Knight that has observer abilities
 *
 */
public interface KnightObserver extends Knight {

    void addObserver(Observer observer);

    void update();

}


text:
package com.gentics.mesh.graphdb.orientdb;

import static org.junit.Assert.assertEquals;

import java.util.concurrent.CountDownLatch;

import org.junit.Test;

import com.tinkerpop.blueprints.impls.orient.OrientGraph;
import com.tinkerpop.blueprints.impls.orient.OrientGraphFactory;

public class NestedOrientDBTransactionTest {

	OrientGraphFactory factory = new OrientGraphFactory("memory:tinkerpop").setupPool(4, 10);

	/**
	 * Verify that nested transactions are handled correctly. The outer transaction should not commit when the inner transaction is started.
	 */
	@Test
	public void testNestedTransaction() {
		try {
			OrientGraph tx = factory.getTx();
			try {
				tx.addVertex(null);
				CountDownLatch latch = new CountDownLatch(1);

				new Thread(() -> {
					OrientGraph tx2 = factory.getTx();
					try {
						long count = tx.countVertices();
						System.out.println("Inner " + count);
					} finally {
						tx2.shutdown();
					}
					latch.countDown();
				}).start();
				latch.await();
				throw new RuntimeException();
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} finally {
				tx.rollback();
				tx.shutdown();
			}
		} catch (RuntimeException e) {
			e.printStackTrace();
		}
		OrientGraph tx = factory.getTx();
		try {
			long count = tx.countVertices();
			assertEquals("A runtime exception occured in the tx transaction. Nothing should have been comitted", 0, count);
		} finally {
			tx.shutdown();
		}

	}

	/**
	 * Verify that nested transactions are handled correctly. The outer transaction should not commit when the inner transaction is started.
	 */
	@Test
	public void testNestedTransaction2() {
		try {
			OrientGraph tx = factory.getTx();
			try {

				// 1. Add a vertex in the inner transaction
				tx.addVertex(null);

				OrientGraph tx2 = factory.getTx();
				try {
					// Verify that the inner count is 1
					long count = tx2.countVertices();
					System.out.println("Inner " + count);
				} finally {
					tx2.rollback();
					tx2.shutdown();
				}
				throw new RuntimeException();
			} finally {
				tx.rollback();
				tx.shutdown();
			}
		} catch (RuntimeException e) {
			e.printStackTrace();
		}
		OrientGraph tx = factory.getTx();
		try {
			long count = tx.countVertices();
			assertEquals("A runtime exception occured in the tx transaction. Nothing should have been comitted", 0, count);
		} finally {
			tx.shutdown();
		}

	}

}