text:
package v1

import (
	v1 "github.com/openshift/origin/pkg/project/apis/project/v1"
	scheme "github.com/openshift/origin/pkg/project/generated/clientset/scheme"
	meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	types "k8s.io/apimachinery/pkg/types"
	watch "k8s.io/apimachinery/pkg/watch"
	rest "k8s.io/client-go/rest"
)

// ProjectsGetter has a method to return a ProjectResourceInterface.
// A group's client should implement this interface.
type ProjectsGetter interface {
	Projects() ProjectResourceInterface
}

// ProjectResourceInterface has methods to work with ProjectResource resources.
type ProjectResourceInterface interface {
	Create(*v1.Project) (*v1.Project, error)
	Update(*v1.Project) (*v1.Project, error)
	UpdateStatus(*v1.Project) (*v1.Project, error)
	Delete(name string, options *meta_v1.DeleteOptions) error
	DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
	Get(name string, options meta_v1.GetOptions) (*v1.Project, error)
	List(opts meta_v1.ListOptions) (*v1.ProjectList, error)
	Watch(opts meta_v1.ListOptions) (watch.Interface, error)
	Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Project, err error)
	ProjectResourceExpansion
}

// projects implements ProjectResourceInterface
type projects struct {
	client rest.Interface
}

// newProjects returns a Projects
func newProjects(c *ProjectV1Client) *projects {
	return &projects{
		client: c.RESTClient(),
	}
}

// Create takes the representation of a projectResource and creates it.  Returns the server's representation of the projectResource, and an error, if there is any.
func (c *projects) Create(projectResource *v1.Project) (result *v1.Project, err error) {
	result = &v1.Project{}
	err = c.client.Post().
		Resource("projects").
		Body(projectResource).
		Do().
		Into(result)
	return
}

// Update takes the representation of a projectResource and updates it. Returns the server's representation of the projectResource, and an error, if there is any.
func (c *projects) Update(projectResource *v1.Project) (result *v1.Project, err error) {
	result = &v1.Project{}
	err = c.client.Put().
		Resource("projects").
		Name(projectResource.Name).
		Body(projectResource).
		Do().
		Into(result)
	return
}

// UpdateStatus was generated because the type contains a Status member.
// Add a +genclientstatus=false comment above the type to avoid generating UpdateStatus().

func (c *projects) UpdateStatus(projectResource *v1.Project) (result *v1.Project, err error) {
	result = &v1.Project{}
	err = c.client.Put().
		Resource("projects").
		Name(projectResource.Name).
		SubResource("status").
		Body(projectResource).
		Do().
		Into(result)
	return
}

// Delete takes name of the projectResource and deletes it. Returns an error if one occurs.
func (c *projects) Delete(name string, options *meta_v1.DeleteOptions) error {
	return c.client.Delete().
		Resource("projects").
		Name(name).
		Body(options).
		Do().
		Error()
}

// DeleteCollection deletes a collection of objects.
func (c *projects) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
	return c.client.Delete().
		Resource("projects").
		VersionedParams(&listOptions, scheme.ParameterCodec).
		Body(options).
		Do().
		Error()
}

// Get takes name of the projectResource, and returns the corresponding projectResource object, and an error if there is any.
func (c *projects) Get(name string, options meta_v1.GetOptions) (result *v1.Project, err error) {
	result = &v1.Project{}
	err = c.client.Get().
		Resource("projects").
		Name(name).
		VersionedParams(&options, scheme.ParameterCodec).
		Do().
		Into(result)
	return
}

// List takes label and field selectors, and returns the list of Projects that match those selectors.
func (c *projects) List(opts meta_v1.ListOptions) (result *v1.ProjectList, err error) {
	result = &v1.ProjectList{}
	err = c.client.Get().
		Resource("projects").
		VersionedParams(&opts, scheme.ParameterCodec).
		Do().
		Into(result)
	return
}

// Watch returns a watch.Interface that watches the requested projects.
func (c *projects) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
	opts.Watch = true
	return c.client.Get().
		Resource("projects").
		VersionedParams(&opts, scheme.ParameterCodec).
		Watch()
}

// Patch applies the patch and returns the patched projectResource.
func (c *projects) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Project, err error) {
	result = &v1.Project{}
	err = c.client.Patch(pt).
		Resource("projects").
		SubResource(subresources...).
		Name(name).
		Body(data).
		Do().
		Into(result)
	return
}


text:
require 'test_helper'

class ActualiteTest < ActiveSupport::TestCase

  setup do
    @actu = build(:actualite)
  end

  test "une actualité sans titre est invalide" do
    @actu.titre = ''
    assert_not @actu.valid?
  end

  test "une actualité sans auteur est invalide" do
    @actu.animateur_id = nil
    assert_not @actu.valid?
  end

  test "une actualité sans image est invalide" do
    @actu.image = nil
    assert_not @actu.valid?
  end

  test "une actualité valide" do
    assert @actu.valid?
  end

  test "une actualité dont l'image ne commence pas par http n'est pas valide" do
    @actu.image = "monimage.png"
    assert_not @actu.valid?
  end

end

redpajama_set_name: RedPajamaGithub


text:
package io.netty.buffer;

import io.netty.util.Recycler.Handle;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

/**
 * Abstract base class for derived {@link ByteBuf} implementations.
 */
abstract class AbstractPooledDerivedByteBuf<T> extends AbstractReferenceCountedByteBuf {

    private final Handle<AbstractPooledDerivedByteBuf<T>> recyclerHandle;
    private AbstractByteBuf buffer;

    @SuppressWarnings("unchecked")
    AbstractPooledDerivedByteBuf(Handle<? extends AbstractPooledDerivedByteBuf<T>> recyclerHandle) {
        super(0);
        this.recyclerHandle = (Handle<AbstractPooledDerivedByteBuf<T>>) recyclerHandle;
    }

    @Override
    public final AbstractByteBuf unwrap() {
        return buffer;
    }

    final <U extends AbstractPooledDerivedByteBuf<T>> U init(
            AbstractByteBuf buffer, int readerIndex, int writerIndex, int maxCapacity) {

        buffer.retain();
        this.buffer = buffer;

        boolean success = false;
        try {
            maxCapacity(maxCapacity);
            setIndex(readerIndex, writerIndex);
            setRefCnt(1);

            @SuppressWarnings("unchecked")
            final U castThis = (U) this;
            success = true;
            return castThis;
        } finally {
            if (!success) {
                this.buffer = null;
                buffer.release();
            }
        }
    }

    @Override
    protected final void deallocate() {
        recyclerHandle.recycle(this);
        unwrap().release();
    }

    @Override
    public final ByteBufAllocator alloc() {
        return unwrap().alloc();
    }

    @Override
    @Deprecated
    public final ByteOrder order() {
        return unwrap().order();
    }

    @Override
    public boolean isReadOnly() {
        return unwrap().isReadOnly();
    }

    @Override
    public final boolean isDirect() {
        return unwrap().isDirect();
    }

    @Override
    public boolean hasArray() {
        return unwrap().hasArray();
    }

    @Override
    public byte[] array() {
        return unwrap().array();
    }

    @Override
    public boolean hasMemoryAddress() {
        return unwrap().hasMemoryAddress();
    }

    @Override
    public final int nioBufferCount() {
        return unwrap().nioBufferCount();
    }

    @Override
    public final ByteBuffer internalNioBuffer(int index, int length) {
        return nioBuffer(index, length);
    }

    @Override
    public final ByteBuf retainedDuplicate() {
        return PooledDuplicatedByteBuf.newInstance(this, readerIndex(), writerIndex());
    }

    @Override
    public final ByteBuf retainedSlice() {
        final int index = readerIndex();
        return retainedSlice(index, writerIndex() - index);
    }

    @Override
    public final ByteBuf retainedSlice(int index, int length) {
        return PooledSlicedByteBuf.newInstance(this, index, length, index);
    }
}


text:
using System.Xml.Linq;
using OrchardVNext.ContentManagement.MetaData.Models;
using OrchardVNext.DependencyInjection;

namespace OrchardVNext.ContentManagement.MetaData {
    public interface IContentDefinitionWriter : IDependency{
        XElement Export(ContentTypeDefinition typeDefinition);
        XElement Export(ContentPartDefinition partDefinition);
    }
}


text:
// -*- mode: csharp; encoding: utf-8; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
// $Id$

using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;

namespace XSpect.Yacq.Expressions
{
    partial class DispatchExpression
    {
        internal class Candidate
            : IComparable<Candidate>
        {
            private readonly Lazy<IList<String>> _filledArgumentNames;

            private readonly Lazy<IList<Tuple<Type, Expression>>> _parameterMap;

            public Expression Instance
            {
                get;
                private set;
            }

            public MemberInfo Member
            {
                get;
                private set;
            }

            public IDictionary<Type, Type> TypeArgumentMap
            {
                get;
                private set;
            }

            public IList<Type> TypeArguments
            {
                get
                {
                    return this.TypeArgumentMap.ToArgumentArray();
                }
                private set
                {
                    this.TypeArgumentMap = value != null && value.Any()
                        ? (this.Method.Null(m => m.TryGetGenericMethodDefinition()) ?? this.MethodBase)
                              .GetGenericArguments()
                              .Zip(value, Tuple.Create)
                              .ToDictionary()
                        : new Dictionary<Type, Type>();
                }
            }

            public IList<String> ArgumentNames
            {
                get;
                private set;
            }

            public IList<String> FilledArgumentNames
            {
                get
                {
                    return this._filledArgumentNames.Value;
                }
            }

            public IList<Expression> Arguments
            {
                get;
                private set;
            }

            public FieldInfo Field
            {
                get
                {
                    return this.Member as FieldInfo;
                }
            }

            public PropertyInfo Property
            {
                get
                {
                    return this.Member as PropertyInfo;
                }
            }

            public EventInfo Event
            {
                get
                {
                    return this.Member as EventInfo;
                }
            }

            public MethodBase MethodBase
            {
                get
                {
                    return this.Member as MethodBase;
                }
            }

            public MethodInfo Method
            {
                get
                {
                    return this.Member as MethodInfo;
                }
            }

            public ConstructorInfo Constructor
            {
                get
                {
                    return this.Member as ConstructorInfo;
                }
            }

            public Type Type
            {
                get
                {
                    return this.Member as Type;
                }
            }

            public IList<ParameterInfo> Parameters
            {
                get
                {
                    return this.MethodBase != null
                        ? this.MethodBase.GetParameters()
                        : this.Property != null
                              ? this.Property.GetIndexParameters()
                              : Arrays.Empty<ParameterInfo>();
                }
            }

            public IList<Tuple<Type, Expression>> ParameterMap
            {
                get
                {
                    return this._parameterMap.Value;
                }
            }

            public Boolean IsParamArray
            {
                get
                {
                    return this.Parameters.Any()
                        && Attribute.IsDefined(this.Parameters.Last(), typeof(ParamArrayAttribute));
                }
            }

            public Boolean IsParamArrayContext
            {
                get
                {
                    return this.IsParamArray &&
                        (this.Arguments.Any()
                            ? this.Arguments.Last().Let(e => e is YacqExpression
                                  // Suppress reducing by Type property (this test not indicates whether surely in ParamArray context)
                                  ? this.ArgumentNames.All(n => n == null) && this.Arguments.Count >= this.Parameters.Count - 1
                                  : !this.Parameters.Last().ParameterType.IsAssignableFrom(e.Type)
                              )
                            : this.Parameters.Count == 1
                        );
                }
            }

            private Candidate(
                Expression instance,
                MemberInfo member,
                IList<String> argumentNames,
                IList<Expression> arguments
            )
            {
                this._filledArgumentNames = new Lazy<IList<String>>(() => this.ArgumentNames
                    .TakeWhile(n => n == null)
                    .Count()
                    .Let(c => this.Parameters
                        .Select(p => p.Name)
                        .Take(c)
                        .Concat(this.ArgumentNames.Skip(c))
                    )
                    .ToArray()
                );
                this._parameterMap = new Lazy<IList<Tuple<Type, Expression>>>(() =>
                    (this.IsParamArrayContext
                        // Guard for irregular parameter names, such as T[]..ctor(int <null>)
                        || this.Parameters.Any(p => String.IsNullOrWhiteSpace(p.Name))
                        ? this.ArgumentNames.All(n => n == null)
                              ? this.Parameters
                                    .SkipLast(1)
                                    .Select(p => p.ParameterType)
                                    .Concat(Arrays.From(
                                        this.Parameters.Last().ParameterType.GetElementType()
                                    ).Repeat())
                                    .Zip(this.Arguments, Tuple.Create)
                              : null
                        : this.Arguments.Count <= this.Parameters.Count
                              && this.Parameters.All(p => this.FilledArgumentNames.Contains(p.Name) || p.IsOptional)
                              ? this.FilledArgumentNames
                                    .Zip(this.Arguments, Tuple.Create)
                                    .ToDictionary()
                                    .Let(d => this.Parameters.Select(p => Tuple.Create(
                                        p.ParameterType,
                                        d.GetValue(p.Name)
                                            ?? Constant(p.DefaultValue, p.ParameterType)
                                   )))
                              : null
                    )
                    .Null(_ => _.ToArray())
                );
                this.Instance = instance;
                this.Member = member;
                this.ArgumentNames = argumentNames ?? new String[this.Method.GetParameters().Length];
                this.Arguments = arguments;
            }

            public Candidate(
                Expression instance,
                MemberInfo member,
                IDictionary<Type, Type> typeArgumentMap,
                IList<String> argumentNames,
                IList<Expression> arguments
            )
                : this(instance, member, argumentNames, arguments)
            {
                this.TypeArgumentMap = typeArgumentMap ?? new Dictionary<Type, Type>();
            }

            public Candidate(
                Expression instance,
                MemberInfo member,
                IList<Type> typeArguments,
                IList<String> argumentNames,
                IList<Expression> arguments
            )
                : this(instance, member, argumentNames, arguments)
            {
                this.TypeArguments = typeArguments ?? Type.EmptyTypes;
            }

            public override String ToString()
            {
                return (this.Instance != null ? this.Instance + "." : "")
                    + this.Member
                    + (this.TypeArguments.Any()
                          ? "<" + this.TypeArguments.Stringify(t => t.Name, ", ") + ">"
                          : this.TypeArguments.Stringify(t => t.Name, ", ")
                      )
                    + "("
                    + this.ArgumentNames.Zip(this.Arguments, (n, a) => n != null
                          ? n + ": " + a
                          : a.ToString()
                      ).Stringify(", ")
                    + ")";
            }

            public Int32 CompareTo(Candidate other)
            {
                Int32 value;
                return this.Method != null
                    && other.Method != null
                    && (value = this.Method.IsExtensionMethod()
                           .CompareTo(other.Method.IsExtensionMethod())
                       ) != 0
                    ? value
                    : (value = this.IsParamArrayContext
                          .CompareTo(other.IsParamArrayContext)
                      ) != 0
                          ? value
                          : this.Parameters.Select(_ => _.ParameterType)
                                .Zip(other.Parameters.Select(_ => _.ParameterType), (l, r) =>
                                    l.GetConvertibleTypes().Let(ls =>
                                        r.GetConvertibleTypes().Let(rs =>
                                            ls.Contains(r)
                                                ? rs.Contains(l) ? 0 : -1
                                                : rs.Contains(l) ? 1 : 0
                                            )
                                        )
                                )
                                .FirstOrDefault(_ => _ != 0);
            }

            public Candidate Clone(
                Expression instance = null,
                MemberInfo member = null,
                IDictionary<Type, Type> typeArgumentMap = null,
                IList<Type> typeArguments = null,
                IList<String> argumentNames = null,
                IList<Expression> arguments = null
            )
            {
                return typeArgumentMap != null
                    ? new Candidate(
                          instance ?? this.Instance,
                          member ?? this.Member,
                          typeArgumentMap,
                          argumentNames ?? this.ArgumentNames,
                          arguments ?? this.Arguments
                      )
                    : new Candidate(
                          instance ?? this.Instance,
                          member ?? this.Member,
                          typeArguments ?? this.TypeArguments,
                          argumentNames ?? this.ArgumentNames,
                          arguments ?? this.Arguments
                      );
            }
        }
    }
}
// vim:set ft=cs fenc=utf-8 ts=4 sw=4 sts=4 et:


text:
package es.dit.gsi.rulesframework;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;

public class GestorWebViewActivity extends AppCompatActivity {

    WebView webView;
    String url;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_gestor_web_view);

        url = getIntent().getExtras().getString("url");

        webView = (WebView) findViewById(R.id.webView);
        webView.getSettings().setJavaScriptEnabled(true);
        /*webView.setWebViewClient(new WebViewClient(){
            public boolean shouldOverrideUrlLoading(WebView view,String url){
                view.loadUrl(url);
                return false;
            }
        });*/
        //Toast.makeText(getApplicationContext(),url,Toast.LENGTH_LONG).show();
        webView.loadUrl(url);
    }
}


text:
package org.apache.hadoop.hbase;

import java.io.IOException;
import java.util.Iterator;
import java.util.Optional;
import org.apache.hadoop.hbase.procedure2.Procedure;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.hbase.thirdparty.com.google.gson.JsonArray;
import org.apache.hbase.thirdparty.com.google.gson.JsonElement;
import org.apache.hbase.thirdparty.com.google.gson.JsonObject;
import org.apache.hbase.thirdparty.com.google.gson.JsonParser;

import org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureState;

public final class ProcedureTestUtil {

  private static final Logger LOG = LoggerFactory.getLogger(ProcedureTestUtil.class);

  private ProcedureTestUtil() {
  }

  private static Optional<JsonObject> getProcedure(HBaseTestingUtil util,
    Class<? extends Procedure<?>> clazz, JsonParser parser) throws IOException {
    JsonArray array = parser.parse(util.getAdmin().getProcedures()).getAsJsonArray();
    Iterator<JsonElement> iterator = array.iterator();
    while (iterator.hasNext()) {
      JsonElement element = iterator.next();
      JsonObject obj = element.getAsJsonObject();
      String className = obj.get("className").getAsString();
      if (className.equals(clazz.getName())) {
        return Optional.of(obj);
      }
    }
    return Optional.empty();
  }

  public static void waitUntilProcedureWaitingTimeout(HBaseTestingUtil util,
    Class<? extends Procedure<?>> clazz, long timeout) throws IOException {
    JsonParser parser = new JsonParser();
    util.waitFor(timeout,
      () -> getProcedure(util, clazz, parser)
        .filter(o -> ProcedureState.WAITING_TIMEOUT.name().equals(o.get("state").getAsString()))
        .isPresent());
  }

  public static void waitUntilProcedureTimeoutIncrease(HBaseTestingUtil util,
    Class<? extends Procedure<?>> clazz, int times) throws IOException, InterruptedException {
    JsonParser parser = new JsonParser();
    long oldTimeout = 0;
    int timeoutIncrements = 0;
    for (;;) {
      long timeout = getProcedure(util, clazz, parser).filter(o -> o.has("timeout"))
        .map(o -> o.get("timeout").getAsLong()).orElse(-1L);
      if (timeout > oldTimeout) {
        LOG.info("Timeout incremented, was {}, now is {}, increments={}", timeout, oldTimeout,
          timeoutIncrements);
        oldTimeout = timeout;
        timeoutIncrements++;
        if (timeoutIncrements > times) {
          break;
        }
      }
      Thread.sleep(1000);
    }
  }
}


text:
<?php
/*
 *
 */

namespace RDF\JobDefinitionFormatBundle\Model\JDF\Process\PrePress;

use Doctrine\OXM\Mapping as OXM;

/**
 * RDF\JobDefinitionFormatBundle\Model\JDF\Process\PrePress\Stripping
 *
 * @OXM\XmlEntity(xml="Stripping")
 */
class Stripping
{

}


text:
/*
 * Decompression.java
 * stream decompression via external program call
 *
 * created: mpichler, 19970414
 *
 * changed: mpichler, 19970414
 *
 * $Id: Decompression.java,v 1.4 1997/08/01 12:46:24 mpichler Exp $
 */

package iicm.vrml.pw;

import java.io.*;

// Decompression

abstract public class Decompression
{
  // no need ever to create an instance of this class
  private Decompression ()  { }

  /** magic number of compressed files */
  public final static int COMPRESSION_MAGIC = 0x1f;

  /**
   * check whether the InputStream contains compressed data. In this
   * case execute gunzip and return a stream of decompressed data.
   * If executing gunzip fails (e.g. not allowed for applets) or the
   * input data were not compressed, the original InputStream is
   * returned unchanged. Only works for standalone applications.
   */

  public static InputStream filterfile (String filename/*InputStream in*/) throws IOException
  {
    InputStream in = new BufferedInputStream (new FileInputStream (filename));
    return(filter(in));

  }

  public static InputStream filter (InputStream in, String tmp) throws IOException
  {
    DataInputStream in1 = new DataInputStream(in);

    in1.mark (64);
    int firstchar = in1.read();
    //System.out.print(firstchar+" "+COMPRESSION_MAGIC);
    in1.reset ();  // all that stuff to simulate ungetc

    if (firstchar != COMPRESSION_MAGIC)  // check for compression
    {
      //System.out.println ("ordinary file");
      return in;
    }
    // might also check for compression method
    // gunzip supports 0x8b and 0x9d (gzip and compress)
    System.out.println ("compressed file");
    File tmpfile = new File(tmp);
    //System.out.println("tmo="+tmp);

    try {
      DataOutputStream out1 = new DataOutputStream(new FileOutputStream(tmpfile));
      int c;
      while ((c = in1.read()) != -1) {
	out1.write(c);
      }
    }
    catch (IOException e) {
      System.out.print("[Decompression] [Error] write tmp error="+e+"\n");
    }

    Runtime runtime = Runtime.getRuntime ();

    String command = "/local/gnu/bin/gunzip -c " + tmp;

    try
    {
      Process gunzip = runtime.exec (command);

      InputStream filtered = gunzip.getInputStream ();
      // seems like it is not possible to redirect both process input and output
      // thus we need a file as input

      in.close ();  // gunzip reads from file itself
      //System.out.println ("+ " + cmdToString (command));
      return filtered;
    }
    catch (Exception e)
    {
      System.err.println ("[Decompression] [Error] could not execute command: " + cmdToString (command));
      System.err.println ("got exception: " + e);  // SecurityException or WriteError
      // e.printStackTrace ();
    }

    return in;

  } // filter

  public static InputStream filter (InputStream in) throws IOException
  {
    //if (filename.indexOf ('\'') >= 0)  // Unix: don't issue arbitrary sh commands
    //return new FileInputStream (filename);

    //InputStream in = new BufferedInputStream (new FileInputStream (filename));

    DataInputStream in1 = new DataInputStream(in);

    in1.mark (64);
    int firstchar = in1.read();
    //System.out.print(firstchar+" "+COMPRESSION_MAGIC);
    in1.reset ();  // all that stuff to simulate ungetc

    if (firstchar != COMPRESSION_MAGIC)  // check for compression
    {
      //System.out.println ("ordinary file");
      return in;
    }
    // might also check for compression method
    // gunzip supports 0x8b and 0x9d (gzip and compress)
    System.out.println ("compressed file");
    File tmp = new File("/home/wang/html/cgi/tools/tmp");

    try {
      DataOutputStream out1 = new DataOutputStream(new FileOutputStream(tmp));
      int c;
      while ((c = in1.read()) != -1) {
	out1.write(c);
      }
    }
    catch (IOException e) {
      System.out.print("[Decompression] [Error] write tmp error="+e);
    }

    Runtime runtime = Runtime.getRuntime ();

    // with the appropriate gunzip path this should work on other platforms too
    // String command = "/usr/local/bin/gunzip -c " + filename;  // only works with full path name
    //String[] command = { "/bin/sh", "-c", "gunzip -c '" + filename + "'" };  // Unix specific
    // String command = "/bin/echo hello world#VRML V2.0 utf8\nCube {}";
    //String command = "/bin/echo #VRML V2.0 utf8\nCube {}";  // not legal VRML 2.0
    //String command = "/bin/cat";
    String command = "/local/gnu/bin/gunzip -c /home/wang/html/cgi/tools/tmp";

    try
    {
      Process gunzip = runtime.exec (command);

      InputStream filtered = gunzip.getInputStream ();
      // seems like it is not possible to redirect both process input and output
      // thus we need a file as input

      in.close ();  // gunzip reads from file itself
      //System.out.println ("+ " + cmdToString (command));
      return filtered;
    }
    catch (Exception e)
    {
      System.err.println ("[Decompression] [Eerror] could not execute command: " + cmdToString (command));
      System.err.println ("got exception: " + e);  // SecurityException or WriteError
      // e.printStackTrace ();
    }

    return in;

  } // filter

  // tiny helper to print command line

  public static final String cmdToString (String[] arr)
  {
    StringBuffer buf = new StringBuffer ();
    int n = arr.length;
    for (int i = 0;  i < n;  i++)
    {
      buf.append (arr [i]);
      if (i < n-1)
        buf.append (" ");
    }
    return buf.toString ();
  }

  public static final String cmdToString (String s)
  {
    return s;
  }

} // Decompression


text:
import { Component, OnInit } from '@angular/core';
import { FormGroup, FormControl } from '@angular/forms';

@Component({
	selector: 'sand-date-input',
	templateUrl: './date-input.component.html'
})
export class DateInputComponent implements OnInit {
	date = new Date();
	form = new FormGroup({
		date: new FormControl(),
	});
	submit() {
		console.log(this.form.value);
	}
	ngOnInit() {
		this.form.valueChanges.subscribe(v => {
			const f = this.form;
		})
	}
}


text:
"""Scalar feature, e.g. tf.int32."""

from __future__ import annotations

from tensorflow_datasets.core.features import feature as feature_lib
from tensorflow_datasets.core.features import tensor_feature
from tensorflow_datasets.core.proto import feature_pb2
from tensorflow_datasets.core.utils import type_utils

class Scalar(tensor_feature.Tensor):
  """A scalar feature of a particular dtype (e.g.

  np.int64 or np.float).

  Equivalent to `tfds.features.Tensor(shape=(), dtype=dtype)`.

  """

  def __init__(
      self,
      dtype: type_utils.TfdsDType,
      *,
      doc: feature_lib.DocArg = None,
  ):
    super().__init__(shape=(), dtype=dtype, doc=doc)

  @classmethod
  def from_json_content(cls, value: feature_pb2.TensorFeature) -> 'Scalar':
    return cls(dtype=feature_lib.dtype_from_str(value.dtype))


text:
package com.xpeppers.phonebook.db;

import java.util.ArrayList;
import java.util.List;

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

import com.xpeppers.phonebook.model.Contact;

public class DatabaseHandler extends SQLiteOpenHelper {

	// All Static variables
	// Database Version
	private static final int DATABASE_VERSION = 1;

	// Database Name
	private static final String DATABASE_NAME = "contactsManager";

	// Contacts table name
	private static final String TABLE_CONTACTS = "contacts";

	// Contacts Table Columns names
	private static final String KEY_ID = "id";
	private static final String KEY_NAME = "name";
	private static final String KEY_SURNAME = "surname";
	private static final String KEY_PH_NO = "phone_number";

	public DatabaseHandler(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}

	// Creating Tables
	@Override
	public void onCreate(SQLiteDatabase db) {
		String CREATE_CONTACTS_TABLE = "CREATE TABLE " + TABLE_CONTACTS + "("
				+ KEY_ID + " INTEGER PRIMARY KEY," + KEY_NAME + " TEXT,"
				+ KEY_SURNAME + " TEXT," + KEY_PH_NO + " TEXT" + ")";
		db.execSQL(CREATE_CONTACTS_TABLE);
	}

	// Upgrading database
	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// Drop older table if existed
		db.execSQL("DROP TABLE IF EXISTS " + TABLE_CONTACTS);

		// Create tables again
		onCreate(db);
	}

	/**
	 * All CRUD(Create, Read, Update, Delete) Operations
	 */

	public// Adding new contact
	void addContact(Contact contact) {
		SQLiteDatabase db = this.getWritableDatabase();

		ContentValues values = new ContentValues();
		values.put(KEY_NAME, contact.getName());// Contact Name
		values.put(KEY_SURNAME, contact.getSurname());// Contact Surname
		values.put(KEY_PH_NO, contact.getPhoneNumber()); // Contact Phone

		// Inserting Row
		db.insert(TABLE_CONTACTS, null, values);
		db.close(); // Closing database connection
	}

	// Getting single contact
	Contact getContact(int id) {
		SQLiteDatabase db = this.getReadableDatabase();

		Cursor cursor = db.query(TABLE_CONTACTS, new String[] { KEY_ID,
				KEY_NAME, KEY_SURNAME, KEY_PH_NO }, KEY_ID + "=?",
				new String[] { String.valueOf(id) }, null, null, null, null);
		if (cursor != null)
			cursor.moveToFirst();

		Contact contact = new Contact(Integer.parseInt(cursor.getString(0)),
				cursor.getString(1), cursor.getString(2), cursor.getString(3));
		// return contact
		return contact;
	}

	// Getting All Contacts
	public List<Contact> getAllContacts() {
		List<Contact> contactList = new ArrayList<Contact>();
		// Select All Query
		String selectQuery = "SELECT  * FROM " + TABLE_CONTACTS;

		SQLiteDatabase db = this.getWritableDatabase();
		Cursor cursor = db.rawQuery(selectQuery, null);

		// looping through all rows and adding to list
		if (cursor.moveToFirst()) {
			do {
				Contact contact = new Contact();
				contact.setID(Integer.parseInt(cursor.getString(0)));
				contact.setName(cursor.getString(1));
				contact.setSurname(cursor.getString(2));
				contact.setPhoneNumber(cursor.getString(3));
				// Adding contact to list
				contactList.add(contact);
			} while (cursor.moveToNext());
		}

		// return contact list
		return contactList;
	}

	// Updating single contact
	public int updateContact(Contact contact) {
		SQLiteDatabase db = this.getWritableDatabase();

		ContentValues values = new ContentValues();
		values.put(KEY_NAME, contact.getName());
		values.put(KEY_SURNAME, contact.getSurname());
		values.put(KEY_PH_NO, contact.getPhoneNumber());

		// updating row
		return db.update(TABLE_CONTACTS, values, KEY_ID + " = ?",
				new String[] { String.valueOf(contact.getID()) });
	}

	// Deleting single contact
	public void deleteContact(Contact contact) {
		SQLiteDatabase db = this.getWritableDatabase();
		db.delete(TABLE_CONTACTS, KEY_ID + " = ?",
				new String[] { String.valueOf(contact.getID()) });
		db.close();
	}

	// Getting contacts Count
	public int getContactsCount() {
		String countQuery = "SELECT  * FROM " + TABLE_CONTACTS;
		SQLiteDatabase db = this.getReadableDatabase();
		Cursor cursor = db.rawQuery(countQuery, null);
		cursor.close();

		// return count
		return cursor.getCount();
	}

}


text:
package griffon.javafx.artifact;

import griffon.annotations.core.Nonnull;
import javafx.scene.Node;

/**
 * @author Andres Almiray
 * @since 2.13.0
 */
public interface ContentProvider {
    @Nonnull
    Node getContent();
}


text:
Recuperar Login

Informe o e-mail cadastrado e o CPF para recuperar os dados de login.

		Obs. Somente é possível receber dados de login de cadastros ativos.

   <?php
    echo validation_errors();
    echo form_open(base_url('cadastro/recuperar_login'),array('id'=>'form_recuperar_login')) .
    form_input(array('id'=>'email','name'=>'email','Placeholder'=>'E-mail','value'=>set_value('email'))) .
    form_input(array('id'=>'cpf','name'=>'cpf','Placeholder'=>'CPF')) .
    form_submit("btnLogin","Recuperar Login") .
    form_close() .
    anchor(base_url('login'),"Efetuar Login");
   ?>


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:c="http://www.springframework.org/schema/c"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:task="http://www.springframework.org/schema/task"
       xmlns:util="http://www.springframework.org/schema/util"
       xmlns:jdbc="http://www.springframework.org/schema/jdbc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
       http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
       http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd">

    <task:scheduler id="taskScheduler" pool-size="10" />
    <task:executor id="taskExecutor" pool-size="5" />
    <task:annotation-driven scheduler="taskScheduler" executor="taskExecutor" />

    <!-- Schedule the token service and approved site service to clear out expired tokens and sites every 5 minutes -->
    <task:scheduled-tasks scheduler="taskScheduler">
        <task:scheduled ref="defaultOAuth2ProviderTokenService" method="clearExpiredTokens" fixed-delay="300000" initial-delay="600000"/>
        <task:scheduled ref="defaultApprovedSiteService" method="clearExpiredSites" fixed-delay="300000" initial-delay="600000"/>
        <task:scheduled ref="defaultOAuth2AuthorizationCodeService" method="clearExpiredAuthorizationCodes" fixed-delay="300000" initial-delay="600000"/>
        <task:scheduled ref="defaultDeviceCodeService" method="clearExpiredDeviceCodes" fixed-delay="300000" initial-delay="600000"/>
    </task:scheduled-tasks>

</beans>


text:
package ca.chrisbarrett.bubblecount.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.Button;

import ca.chrisbarrett.bubblecount.util.FontCache;

/**
 * Generates a custom {@link Button}, using the TypeFace font defined by {@link
 * FontCache#getFont(Context)}. Color will be set to the "colorPrimary" value defined in
 * the color XML file. The button background will be set to the "buttonBackground"value defined in
 * the color XML file.
 *
 * @author Chris Barrett
 * @see android.view.SurfaceView;
 * @since Jun 26, 2016
 */
public class BubbleTextView extends Button {

    public BubbleTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
        setTypeface(FontCache.getFont(context));
    }
}


text:
using System.Reflection;

[assembly : AssemblyVersion("5.6.2.0")]
[assembly : AssemblyFileVersion("5.6.2.0")]


text:
<component name="libraryTable">
  <library name="unitynotification">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/app/libs/unitynotification.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>


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

<meta name="collection" content="api">

<TITLE>
SSLContext (Java 2 Platform SE 5.0)
</TITLE>

<META NAME="keywords" CONTENT="javax.net.ssl.SSLContext class">
<META NAME="keywords" CONTENT="getInstance()">
<META NAME="keywords" CONTENT="getProtocol()">
<META NAME="keywords" CONTENT="getProvider()">
<META NAME="keywords" CONTENT="init()">
<META NAME="keywords" CONTENT="getSocketFactory()">
<META NAME="keywords" CONTENT="getServerSocketFactory()">
<META NAME="keywords" CONTENT="createSSLEngine()">
<META NAME="keywords" CONTENT="getServerSessionContext()">
<META NAME="keywords" CONTENT="getClientSessionContext()">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

JavaTM 2 Platform
Standard Ed. 5.0

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

javax.net.ssl

Class SSLContext

java.lang.Object
  javax.net.ssl.SSLContext

public class SSLContext
extends Object

Instances of this class represent a secure socket protocol
 implementation which acts as a factory for secure socket
 factories or SSLEngines. This class is initialized
 with an optional set of key and trust managers and source of
 secure random bytes.

Since:

1.4

Constructor Summary

protected
SSLContext(SSLContextSpi contextSpi,
           Provider provider,
           String protocol)

          Creates an SSLContext object.

Method Summary

 SSLEngine
createSSLEngine()

          Creates a new SSLEngine using this context.

 SSLEngine
createSSLEngine(String peerHost,
                int peerPort)

          Creates a new SSLEngine using this context using
 advisory peer information.

 SSLSessionContext
getClientSessionContext()

          Returns the client session context, which represents the set of
 SSL sessions available for use during the handshake phase of
 client-side SSL sockets.

static SSLContext
getInstance(String protocol)

          Generates a SSLContext object that implements the
 specified secure socket protocol.

static SSLContext
getInstance(String protocol,
            Provider provider)

          Generates a SSLContext object that implements the
 specified secure socket protocol from the specified provider.

static SSLContext
getInstance(String protocol,
            String provider)

          Generates a SSLContext object that implements the
 specified secure socket protocol from the specified provider.

 String
getProtocol()

          Returns the protocol name of this SSLContext object.

 Provider
getProvider()

          Returns the provider of this SSLContext object.

 SSLSessionContext
getServerSessionContext()

          Returns the server session context, which represents the set of
 SSL sessions available for use during the handshake phase of
 server-side SSL sockets.

 SSLServerSocketFactory
getServerSocketFactory()

          Returns a ServerSocketFactory object for
 this context.

 SSLSocketFactory
getSocketFactory()

          Returns a SocketFactory object for this
 context.

 void
init(KeyManager[] km,
     TrustManager[] tm,
     SecureRandom random)

          Initializes this context.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SSLContext

protected SSLContext(SSLContextSpi contextSpi,
                     Provider provider,
                     String protocol)

Creates an SSLContext object.

Parameters:
contextSpi - the delegate
provider - the provider
protocol - the protocol

Method Detail

getInstance

public static SSLContext getInstance(String protocol)
                              throws NoSuchAlgorithmException

Generates a SSLContext object that implements the
 specified secure socket protocol.

 If the default provider package provides an implementation of the
 requested key management algorithm, an instance of
 SSLContext containing that implementation is
 returned.  If the algorithm is not available in the default provider
 package, other provider packages are searched.

Parameters:
protocol - the standard name of the requested protocol.

Returns:
the new SSLContext object

Throws:

NoSuchAlgorithmException - if the specified protocol is not
                  available in the default provider package or any of the
                  other provider packages that were searched.

getInstance

public static SSLContext getInstance(String protocol,
                                     String provider)
                              throws NoSuchAlgorithmException,
                                     NoSuchProviderException

Generates a SSLContext object that implements the
 specified secure socket protocol from the specified provider.

Parameters:
protocol - the standard name of the requested protocol.
provider - the name of the provider

Returns:
the new SSLContext object

Throws:

NoSuchAlgorithmException - if the specified protocol is not
               available from the specified provider.

NoSuchProviderException - if the specified provider has not
               been configured.

IllegalArgumentException - if the provider name is null or empty.

getInstance

public static SSLContext getInstance(String protocol,
                                     Provider provider)
                              throws NoSuchAlgorithmException

Generates a SSLContext object that implements the
 specified secure socket protocol from the specified provider.

Parameters:
protocol - the standard name of the requested protocol.
provider - an instance of the provider

Returns:
the new SSLContext object

Throws:

NoSuchAlgorithmException - if the specified protocol is not
                available from the specified provider.

IllegalArgumentException - if the provider name is null.

getProtocol

public final String getProtocol()

Returns the protocol name of this SSLContext object.

This is the same name that was specified in one of the
 getInstance calls that created this
 SSLContext object.

Returns:
the protocol name of this SSLContext object.

getProvider

public final Provider getProvider()

Returns the provider of this SSLContext object.

Returns:
the provider of this SSLContext object

init

public final void init(KeyManager[] km,
                       TrustManager[] tm,
                       SecureRandom random)
                throws KeyManagementException

Initializes this context. Either of the first two parameters
 may be null in which case the installed security providers will
 be searched for the highest priority implementation of the
 appropriate factory. Likewise, the secure random parameter may
 be null in which case the default implementation will be used.

 Only the first instance of a particular key and/or trust manager
 implementation type in the array is used.  (For example, only
 the first javax.net.ssl.X509KeyManager in the array will be used.)

Parameters:
km - the sources of authentication keys or null
tm - the sources of peer authentication trust decisions or null
random - the source of randomness for this generator or null

Throws:

KeyManagementException - if this operation fails

getSocketFactory

public final SSLSocketFactory getSocketFactory()

Returns a SocketFactory object for this
 context.

Returns:
the SocketFactory object

getServerSocketFactory

public final SSLServerSocketFactory getServerSocketFactory()

Returns a ServerSocketFactory object for
 this context.

Returns:
the ServerSocketFactory object

createSSLEngine

public final SSLEngine createSSLEngine()

Creates a new SSLEngine using this context.

 Applications using this factory method are providing no hints
 for an internal session reuse strategy. If hints are desired,
 createSSLEngine(String, int) should be used
 instead.

 Some cipher suites (such as Kerberos) require remote hostname
 information, in which case this factory method should not be used.

Returns:
the SSLEngine object

Throws:

UnsupportedOperationException - if the underlying provider
                does not implement the operation.
Since:

1.5

createSSLEngine

public final SSLEngine createSSLEngine(String peerHost,
                                       int peerPort)

Creates a new SSLEngine using this context using
 advisory peer information.

 Applications using this factory method are providing hints
 for an internal session reuse strategy.

 Some cipher suites (such as Kerberos) require remote hostname
 information, in which case peerHost needs to be specified.

Parameters:
peerHost - the non-authoritative name of the host
peerPort - the non-authoritative port

Returns:
the new SSLEngine object

Throws:

UnsupportedOperationException - if the underlying provider
                does not implement the operation.
Since:

1.5

getServerSessionContext

public final SSLSessionContext getServerSessionContext()

Returns the server session context, which represents the set of
 SSL sessions available for use during the handshake phase of
 server-side SSL sockets.

 This context may be unavailable in some environments, in which
 case this method returns null. For example, when the underlying
 SSL provider does not provide an implementation of SSLSessionContext
 interface, this method returns null. A non-null session context
 is returned otherwise.

Returns:
server session context bound to this SSL context

getClientSessionContext

public final SSLSessionContext getClientSessionContext()

Returns the client session context, which represents the set of
 SSL sessions available for use during the handshake phase of
 client-side SSL sockets.

 This context may be unavailable in some environments, in which
 case this method returns null. For example, when the underlying
 SSL provider does not provide an implementation of SSLSessionContext
 interface, this method returns null. A non-null session context
 is returned otherwise.

Returns:
client session context bound to this SSL context

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

JavaTM 2 Platform
Standard Ed. 5.0

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.


text:
require 'spec_helper'

describe User do
  it { should have_db_index(:email) }
  it { should have_db_index(:remember_token) }

  describe "When signing up" do
    it { should validate_presence_of(:email) }
    it { should validate_presence_of(:password) }
    it { should allow_value("foo@example.co.uk").for(:email) }
    it { should allow_value("foo@example.com").for(:email) }
    it { should_not allow_value("foo@").for(:email) }
    it { should_not allow_value("foo@example..com").for(:email) }
    it { should_not allow_value("foo@.example.com").for(:email) }
    it { should_not allow_value("foo").for(:email) }
    it { should_not allow_value("example.com").for(:email) }

    it "should store email in down case" do
      user = Factory(:user, :email => "John.Doe@example.com")
      user.email.should == "john.doe@example.com"
    end
  end

  describe "When multiple users have signed up" do
    before { Factory(:user) }
    it { should validate_uniqueness_of(:email) }
  end

  describe "A user" do
    before do
      @user     = Factory(:user)
      @password = @user.password
    end

    it "is authenticated with correct email and password" do
      (::User.authenticate(@user.email, @password)).should be
      @user.should be_authenticated(@password)
    end

    it "is authenticated with correct uppercased email and correct password" do
      (::User.authenticate(@user.email.upcase, @password)).should be
      @user.should be_authenticated(@password)
    end

    it "is authenticated with incorrect credentials" do
      (::User.authenticate(@user.email, 'bad_password')).should_not be
      @user.should_not be_authenticated('bad password')
    end
  end

  describe "When resetting authentication with reset_remember_token!" do
    before do
      @user  = Factory(:user)
      @user.remember_token = "old-token"
      @user.reset_remember_token!
    end

    it "should change the remember token" do
      @user.remember_token.should_not == "old-token"
    end
  end

  describe "An email confirmed user" do
    before do
      @user = Factory(:user)
      @old_encrypted_password = @user.encrypted_password
    end

    describe "who updates password" do
      before do
        @user.update_password("new_password")
      end

      it "should change encrypted password" do
        @user.encrypted_password.should_not == @old_encrypted_password
      end
    end
  end

  it "should not generate the same remember token for users with the same password at the same time" do
    Time.stubs(:now => Time.now)
    password    = 'secret'
    first_user  = Factory(:user, :password => password)
    second_user = Factory(:user, :password => password)

    second_user.remember_token.should_not == first_user.remember_token
  end

  describe "An user" do
    before do
      @user = Factory(:user)
      @old_encrypted_password = @user.encrypted_password
    end

    describe "who requests password reminder" do
      before do
        @user.confirmation_token.should be_nil
        @user.forgot_password!
      end

      it "should generate confirmation token" do
        @user.confirmation_token.should_not be_nil
      end

      describe "and then updates password" do
        describe 'with password' do
          before do
            @user.update_password("new_password")
          end

          it "should change encrypted password" do
            @user.encrypted_password.should_not == @old_encrypted_password
          end

          it "should clear confirmation token" do
            @user.confirmation_token.should be_nil
          end
        end

        describe 'with blank password' do
          before do
            @user.update_password("")
          end

          it "does not change encrypted password" do
            @user.encrypted_password.should == @old_encrypted_password
          end

          it "does not clear confirmation token" do
            @user.confirmation_token.should_not be_nil
          end
        end
      end
    end
  end

  describe "a user with an optional email" do
    before do
      @user = User.new
      class << @user
        def email_optional?
          true
        end
      end
    end

    subject { @user }

    it { should allow_value(nil).for(:email) }
    it { should allow_value("").for(:email) }
  end

  describe "a user with an optional password" do
    before do
      @user = User.new
      class << @user
        def password_optional?
          true
        end
      end
    end

    subject { @user }

    it { should allow_value(nil).for(:password) }
    it { should allow_value("").for(:password) }
  end

  describe "user factory" do
    it "should create a valid user with just an overridden password" do
      Factory.build(:user, :password => "test").should be_valid
    end
  end

  describe "when user exists before Clearance was installed" do
    before do
      @user = Factory(:user)
      sql  = "update users set salt = NULL, encrypted_password = NULL, remember_token = NULL where id = #{@user.id}"
      ActiveRecord::Base.connection.update(sql)
      @user.reload.salt.should be_nil
      @user.reload.encrypted_password.should be_nil
      @user.reload.remember_token.should be_nil
    end

    it "should initialize salt, generate remember token, and save encrypted password on update_password" do
      @user.update_password('password')
      @user.salt.should_not be_nil
      @user.encrypted_password.should_not be_nil
      @user.remember_token.should_not be_nil
    end
  end

  describe "The password setter on a User" do
    let(:password) { "a-password" }
    before { subject.send(:password=, password) }

    it "sets password to the plain-text password" do
      subject.password.should == password
    end

    it "also sets encrypted_password" do
      subject.encrypted_password.should_not be_nil
    end
  end
end


text:
@implementation MKJavaScriptContext {
    BOOL _initialized;
    NSMutableSet *loadedModules;

    JSValue *(^_requireBlock)(NSString *name);
}

- (instancetype)init {
    if(!(self = [super init])) return nil;

    [self _setupFancyPantsContext];
    loadedModules = [NSMutableSet new];

    return self;
}

- (void)printString:(NSString *)string {
    printf("%s\n", string.UTF8String);
}

- (void)classesLoaded:(NSNotification *)notif {
    [[NSNotificationCenter defaultCenter] removeObserver:self name:notif.name object:notif.object];
    NSArray *classes = notif.userInfo[NSLoadedClasses];

    for(NSString *className in classes) {
        [self loadNativeModule:NSClassFromString(className)];
    }
}

- (void)setCurrentEvaluatingScriptPath:(NSString *)currentEvaluatingScriptPath {
    self[@"__dirname"] = currentEvaluatingScriptPath;
}

- (NSString *)currentEvaluatingScriptPath {
    return [self[@"__dirname"] toString];
}

- (JSValue *)require:(NSString *)path {
    return _requireBlock(path);
}

- (void)_setupFancyPantsContext {
    void (^logBlock)(NSString *log) = ^(id arg) { [self printString:[arg isKindOfClass:[JSValue class]] ? [[arg toObject] description] : [arg description]]; };

#if TARGET_OS_MAC
    self[@"_cwd"] = [NSFileManager defaultManager].currentDirectoryPath;
#endif

    self[@"objectDescription"] = ^(JSValue *val) { return [val.toObject description]; };
    __weak typeof(self) _self = self;
//    self[@"require"] = _requireBlock = ^JSValue *(NSString *name) {
//
//        BOOL isScript = [name hasSuffix:@".js"];
//        if([name hasPrefix:@"./"] || !name.isAbsolutePath) {
//            name = [_self.currentEvaluatingScriptPath stringByAppendingPathComponent:name];
//        }
////        else {
////            _self.currentEvaluatingScriptPath = [name substringToIndex:(name.length - [name lastPathComponent].length)];
////        }
//
//
//
//        if(isScript) {
//            return [_self evaluateScriptAtPath:name];
//        } else if([name hasSuffix:@".mkmodule"]
//                   || [name hasSuffix:@".bundle"]
//                   || [name hasSuffix:@".dylib"]) {
//            return [_self loadNativeModuleAtPath:name];
//        }
//
//        return nil;
//    };

    NSProcessInfo *info = [NSProcessInfo processInfo];
    self[@"process"] = @{
#if TARGET_OS_MAC
                         @"exit" : ^(int code) { exit(code); },
                         @"chdir" : ^(NSString *dir) { _self[@"_cwd"] = dir; },
                         @"cwd" : ^JSValue *{ return _self[@"_cwd"]; },
#endif
                         @"execPath" : [NSBundle mainBundle].executablePath,
                         @"pid" : @(info.processIdentifier),
                         @"moduleLoadList" : @[],
                         @"version" : [NSString stringWithFormat:@"%u.%u.%u", kMIDIKitVersionMajor, kMIDIKitVersionMinor, kMIDIKitVersionPatch]
                         };
    self[@"console"] = @{
                         @"log" : logBlock,
                         };
    if(info.environment) {
        self[@"process"][@"env"] = info.environment;
    }
    if(info.arguments) {
        self[@"process"][@"argv"] = info.arguments;
    }
    self[@"log"] = logBlock;

    [MIDIKit installIntoContext:self];
}

- (JSValue *)evaluateScriptAtPath:(NSString *)name {
    BOOL isValidScript =
    [name hasSuffix:@".js"]
    && [[name lastPathComponent] componentsSeparatedByString:@"."].count > 1
    && [[NSFileManager defaultManager] fileExistsAtPath:name];

    __weak typeof(self) _self = self;
    switch ((UInt8)isValidScript) {
        case YES: {

            NSError *e;
            self[@"exports"] = self[@"module"] = @{ @"exports" : @{} };

            static NSString *evalFmt =
            @"(function () { "
                "var obj = (function () { "
                    "%@ "
                "})(); "
            "return module.exports; })()";
            NSString *eval = [NSString stringWithFormat:evalFmt, [NSString stringWithContentsOfFile:name encoding:NSUTF8StringEncoding error:&e]];

            if(e) {
                [_self printString:[NSString stringWithFormat:@"Error loading script: \'%@\'", name]];
                return nil;
            }
            JSValue *val = [_self evaluateScript:eval];

//            static NSString *clearModule = @"delete module";
//            [_self evaluateScript:clearModule];

            if(!val) {
                [_self printString:[NSString stringWithFormat:@"Error evaluating script: \'%@\', error = %@", name, e]];
            } else {
                [_self evaluateScript:[NSString stringWithFormat:@"process.moduleLoadList.push(\'ScriptModule %@\');", name.lastPathComponent]];
            }

            return val;
        } break;
        case NO: {

        } break;
    }

    return nil;
}

#if TARGET_OS_MAC
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"
static JSValue *_MKJavaScriptContextRequireHook(Class self, SEL _cmd, MKJavaScriptContext *ctx) {
    return ctx[NSStringFromClass(self)];
}
#pragma clang diagnostic pop
#endif

- (JSValue *)loadNativeModuleAtPath:(NSString *)path {
#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
    // IPHONE CANNOT LOAD CODE
    [NSException raise:@"MKInvalidFeatureException" format:@"iOS cannot load code dynamically"];
    return nil;
#else

    BOOL isDir;
    if(![[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:&isDir]) {
        return nil;
    }

    if(isDir) {
        NSBundle *bundle = [NSBundle bundleWithPath:path];
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(classesLoaded:) name:NSBundleDidLoadNotification object:bundle];
        if([bundle load]) {
            Class pClass= [bundle principalClass];
            if(![pClass respondsToSelector:@selector(requireReturnValue:)]) {
                class_addMethod(objc_getMetaClass(class_getName(pClass)), @selector(requireReturnValue:), (IMP)_MKJavaScriptContextRequireHook, [MKJavaScriptContext methodSignatureForSelector:@selector(requireReturnValue:)].methodReturnType);
            }

            JSValue *ret = [self loadNativeModule:pClass];
            return ret;
        }

        return nil; // this is async w/ notification
    }

    else {
        void *handle = dlopen(path.UTF8String, RTLD_NOW);
        if(!handle) return nil;

        Class (*MKModuleClass)() = dlsym(handle, "MKModuleClass");
        if(!MKModuleClass) return nil;

        return [self loadNativeModule:MKModuleClass()];
    }
#endif

    return nil;
}

- (void)loadClass:(Class)c {
    if([self classIsLoaded:c]) return;

    self[NSStringFromClass(c)] = c;
}

- (BOOL)classIsLoaded:(Class)c {
    NSString *key = NSStringFromClass(c);
    JSValue *val = self[key];

    return val && !val.isUndefined;
}

- (JSValue *)loadNativeModule:(Class<MKJavaScriptModule>)module withListName:(NSString *)listName {
    Class cMod = (Class)module;
    if([loadedModules containsObject:module]) return [module requireReturnValue:self];
    if(![cMod conformsToProtocol:@protocol(MKJavaScriptModule)]) return nil;

    if([cMod respondsToSelector:@selector(classesToLoad:)]) {
        for(Class cls in [module classesToLoad:self]) {
            [self loadClass:cls];
        }
    }
    [self loadClass:cMod];

    NSString *className = NSStringFromClass(cMod);
    static NSString *script = @"process.moduleLoadList.push(\'%@ %@\');";
    NSString *formatted = [NSString stringWithFormat:script, listName, className];
    [self evaluateScript:formatted];

    JSValue *ret = nil;
    if([cMod respondsToSelector:@selector(requireReturnValue:)]) {
        ret = [cMod requireReturnValue:self];
    }

    [loadedModules addObject:module];

    return ret;
}

- (JSValue *)loadNativeModule:(Class<MKJavaScriptModule>)module {
    return [self loadNativeModule:module withListName:@"NativeModule"];
}

- (void)setObject:(id)object forKeyedSubscript:(NSObject<NSCopying> *)key {
    [super setObject:object forKeyedSubscript:key];
}

- (JSValue *)objectForKeyedSubscript:(id)key {
    return [super objectForKeyedSubscript:key];
}

@end


text:
package com.mercadolibre.restclient.async;

import com.mercadolibre.restclient.Request;
import com.mercadolibre.restclient.Response;
import com.mercadolibre.restclient.exception.RestException;

public class DirectWriteBackHTTPCallback<T> extends HTTPCallback<T> {

    private Callback<Response> callback;

    public DirectWriteBackHTTPCallback(Request request, Callback<Response> callback) {
        super(request, null);
        this.callback = callback;
    }

    protected void cacheResult(Response response, RestException exception) {
        if (exception == null && response.getStatus() / 100 == 2) {
            request.getCache().internalAsyncPut(request.getURL(), response);
        }
    }

    @Override
    protected void successAction(Response r, RestException e) {
        cacheResult(r, e);
        if (e != null)
            failureAction(e);
        else
            callback.success(r);
    }

    @Override
    protected void failureAction(RestException e) {
        callback.failure(e);
    }

    @Override
    public void cancel() {
        callback.cancel();
    }

    @Override
    protected boolean futureRunning() {
        return true;
    }

}


text:
package lumi.action.signup;

import lombok.Getter;
import lombok.Setter;
import lombok.val;
import lombok.extern.log4j.Log4j2;
import lumi.action.LumiActionSupport;
import lumi.service.UserRegisterService;
import lumi.vo.UserVO;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.interceptor.annotations.Blocked;
import com.opensymphony.xwork2.validator.annotations.Validations;
import com.opensymphony.xwork2.validator.annotations.VisitorFieldValidator;

/**
 * サインアップ機能の登録Action。
 *
 * @author A-pZ ( Serendipity 3 ./ as sundome goes by. )
 */
@Namespace("/signup")
@ParentPackage("lumi-default")
@Results({
	// location属性に指定したhtmlファイル名は、/WEB-INF/content 以下からの相対パス。
	@Result(name = ActionSupport.SUCCESS, location = "signup/complete" , type="thymeleaf-spring"),
	@Result(name = ActionSupport.ERROR, location = "signup/signup" , type="thymeleaf-spring"),
	@Result(name = ActionSupport.INPUT, location = "signup/signup" , type="thymeleaf-spring"),
})
@Validations(
	visitorFields={
		@VisitorFieldValidator(appendPrefix=false,fieldName="vo")
	}
)
@Controller
@Scope("prototype")
@Log4j2
public class RegisterAction extends LumiActionSupport {

	/**
	 * デフォルトアクション。
	 */
	@Action("register")
	public String start() throws Exception {

		service.register(vo);

		val result = service.isResult();

		return ( result ) ? SUCCESS : ERROR;
	}

	/**
	 * Actionクラスから実行する業務ロジックのServiceクラス。Autowiredがついたフィールドが自動的に対象となる。
	 */
	@Blocked
	@Autowired
	@Getter @Setter
	private UserRegisterService service;

	@Getter @Setter
	private UserVO vo;
}


text:
package com.webfirmframework.wffweb.css;

import com.webfirmframework.wffweb.InvalidValueException;
import com.webfirmframework.wffweb.WffRuntimeException;
import com.webfirmframework.wffweb.data.AbstractBean;
import com.webfirmframework.wffweb.util.StringUtil;

/**
 *
 * @author WFF
 * @since 1.0.0
 */
public class UrlCss3Value extends AbstractBean<UrlCss3Value> {

    private static final long serialVersionUID = 1_0_0L;

    // NB : it should not override equals and hashcode methods as its objects
    // are equalized by Objects.equals(obj1, obj2) method in some places.

    private String url;
    private int x = -1;
    private int y = -1;

    @SuppressWarnings("unused")
    private UrlCss3Value() {
    }

    /**
     * @param urlCssValue eg:- <code> url(\"Test.png\")75 158 </code> or
     *                    <code> url(\"Test.png\")</code>
     * @param urlCssValue
     */
    public UrlCss3Value(final String urlCssValue) {
        super();
        extractAndAssign(urlCssValue);
    }

    public void setUrlCssValue(final String urlCssValue) {
        extractAndAssign(urlCssValue);
    }

    // analyze the code for optimization.
    /**
     * @param urlString
     * @since 1.0.0
     * @author WFF
     */
    private void extractAndAssign(final String urlString) {

        final String urlStringTrimmed = StringUtil.strip(urlString);

        final int lastIndexOfClosingParentheses = urlStringTrimmed.lastIndexOf(')');

        if (urlStringTrimmed.startsWith("url(") && lastIndexOfClosingParentheses != -1) {

            final String urlPart = urlStringTrimmed.substring(0, lastIndexOfClosingParentheses);

            final int indexOfOpeningParantheses = urlPart.indexOf('(');

            String extractedUrl = "";

            if (indexOfOpeningParantheses + 1 < urlPart.length()) {
                extractedUrl = StringUtil.strip(urlPart.substring(indexOfOpeningParantheses + 1));
            }

            extractedUrl = extractedUrl.length() > 0 && extractedUrl.charAt(0) == '"' ? extractedUrl.substring(1)
                    : extractedUrl;
            extractedUrl = extractedUrl.endsWith("\"") ? extractedUrl.substring(0, extractedUrl.length() - 1)
                    : extractedUrl;

            url = extractedUrl;

            final int beginIndexCoordinatesPart = lastIndexOfClosingParentheses + 1;

            if (beginIndexCoordinatesPart < urlStringTrimmed.length()) {

                // .replaceAll("\\s+", " ")
                final String coordinatesPart = StringUtil.convertWhitespacesToSingleSpace(
                        StringUtil.strip(urlStringTrimmed.substring(beginIndexCoordinatesPart)));

                final String[] coordinatesStringParts = StringUtil.splitBySpace(coordinatesPart);

                if (coordinatesStringParts.length == 2) {
                    x = Integer.parseInt(coordinatesStringParts[0]);
                    y = Integer.parseInt(coordinatesStringParts[1]);
                }
            }
        } else {
            throw new InvalidValueException(urlStringTrimmed
                    + " is not a valid url string. It should be in the format of url(\"Test.png\")75 158  or url(\"Testing.png\")");
        }
    }

    /**
     * @param url eg:- Test.png
     * @param x   x coordinate value. give -1 if no value needs to be defined.
     * @param y   y coordinate value. give -1 if no value needs to be defined.
     */
    public UrlCss3Value(final String url, final int x, final int y) {
        super();
        this.url = url;
        this.x = x;
        this.y = y;
    }

    /**
     * @return the value of url(). i.e. it could be http: or data: string
     * @author WFF
     */
    public String getUrl() {
        return url;
    }

    public void setUrl(final String url) {
        this.url = url;
        if (getStateChangeInformer() != null) {
            getStateChangeInformer().stateChanged(this);
        }
    }

    public int getX() {
        return x;
    }

    public void setX(final int x) {
        final int previousX = this.x;
        try {
            this.x = x;
            if (getStateChangeInformer() != null) {
                getStateChangeInformer().stateChanged(this);
            }
        } catch (final WffRuntimeException e) {
            this.x = previousX;
            throw e;
        }
    }

    public int getY() {
        return y;
    }

    public void setY(final int y) {
        final int previousY = x;
        try {
            this.y = y;
            if (getStateChangeInformer() != null) {
                getStateChangeInformer().stateChanged(this);
            }
        } catch (final WffRuntimeException e) {
            this.y = previousY;
            throw e;
        }
    }

    @Override
    public String toString() {
        String urlString = "url(\"" + url + "\")";
        if (x > -1 && y > -1) {
            urlString = "url(\"" + url + "\") " + x + " " + y;
        }
        return urlString;
    }

    /**
     * @return the print format of these valus as a css value.
     * @since 1.0.0
     * @author WFF
     */
    @Override
    public String getValue() {
        String urlString = "url(\"" + url + "\")";
        if (x > -1 && y > -1) {
            urlString = "url(\"" + url + "\") " + x + " " + y;
        }
        return urlString;
    }
}


text:
#ifndef Fennel_CircularSegment_Included
#define Fennel_CircularSegment_Included

#include "fennel/segment/DelegatingSegment.h"

FENNEL_BEGIN_NAMESPACE

/**
 * CircularSegment implements circular page allocation in terms of an
 * underlying LINEAR_ALLOCATION segment.  See the design docs for more
 * detail.
 *
 *

 *
 * Deallocation of individual pages is not supported; however, the caller may
 * deallocate runs of oldest pages by calling deallocatePageRange with
 * NULL_PAGE_ID for startPageId; all pages up to and including the specified
 * endPageId will be deallocated.  This must be done periodically to prevent
 * the allocation point from wrapping around to the oldest allocated page, or
 * an assertion violation results.
 */
class FENNEL_SEGMENT_EXPORT CircularSegment
    : public DelegatingSegment
{
    friend class SegmentFactory;

    SharedCheckpointProvider pCheckpointProvider;

    BlockNum oldestPageNum;

    // TODO:  change design doc diagram from newestPageId to nextPageId
    BlockNum nextPageNum;

    BlockNum nPages;

    BlockNum checkpointThreshold1, checkpointThreshold2;

    explicit CircularSegment(
        SharedSegment delegateSegment,
        SharedCheckpointProvider pCheckpointProvider,
        PageId oldestPageId,
        PageId newestPageId);

public:
    virtual ~CircularSegment();

    // implement the Segment interface
    virtual BlockNum getAllocatedSizeInPages();
    virtual BlockId translatePageId(PageId);
    virtual PageId translateBlockId(BlockId);
    virtual PageId allocatePageId(PageOwnerId ownerId = ANON_PAGE_OWNER_ID);
    virtual void deallocatePageRange(PageId startPageId, PageId endPageId);
    virtual bool isPageIdAllocated(PageId pageId);
    virtual AllocationOrder getAllocationOrder() const;
    virtual PageId getPageSuccessor(PageId pageId);
    virtual void setPageSuccessor(PageId pageId, PageId successorId);
};

FENNEL_END_NAMESPACE

#endif

// End CircularSegment.h


text: export default from './BreadcrumbHome';


text:
enum PhysicsCommandRenderFlags
{
	COV_DISABLE_SYNC_RENDERING = 1
};

class PhysicsCommandProcessorInterface
{
public:
	virtual ~PhysicsCommandProcessorInterface() {}

	virtual bool connect() = 0;

	virtual void disconnect() = 0;

	virtual bool isConnected() const = 0;

	virtual bool processCommand(const struct SharedMemoryCommand& clientCmd, struct SharedMemoryStatus& serverStatusOut, char* bufferServerToClient, int bufferSizeInBytes) = 0;

	virtual bool receiveStatus(struct SharedMemoryStatus& serverStatusOut, char* bufferServerToClient, int bufferSizeInBytes) = 0;

	virtual void renderScene(int renderFlags) = 0;
	virtual void physicsDebugDraw(int debugDrawFlags) = 0;
	virtual void setGuiHelper(struct GUIHelperInterface* guiHelper) = 0;
	virtual void setTimeOut(double timeOutInSeconds) = 0;

	virtual void reportNotifications() = 0;
};

class btVector3;
class btQuaternion;

class CommandProcessorInterface : public PhysicsCommandProcessorInterface
{
public:
	virtual ~CommandProcessorInterface() {}

	virtual void syncPhysicsToGraphics() = 0;
	virtual void stepSimulationRealTime(double dtInSec, const struct b3VRControllerEvent* vrControllerEvents, int numVRControllerEvents, const struct b3KeyboardEvent* keyEvents, int numKeyEvents, const struct b3MouseEvent* mouseEvents, int numMouseEvents) = 0;
	virtual void enableRealTimeSimulation(bool enableRealTimeSim) = 0;
	virtual bool isRealTimeSimulationEnabled() const = 0;

	virtual void enableCommandLogging(bool enable, const char* fileName) = 0;
	virtual void replayFromLogFile(const char* fileName) = 0;
	virtual void replayLogCommand(char* bufferServerToClient, int bufferSizeInBytes) = 0;

	virtual bool pickBody(const btVector3& rayFromWorld, const btVector3& rayToWorld) = 0;
	virtual bool movePickedBody(const btVector3& rayFromWorld, const btVector3& rayToWorld) = 0;
	virtual void removePickingConstraint() = 0;

	virtual const btVector3& getVRTeleportPosition() const = 0;
	virtual void setVRTeleportPosition(const btVector3& vrReleportPos) = 0;

	virtual const btQuaternion& getVRTeleportOrientation() const = 0;
	virtual void setVRTeleportOrientation(const btQuaternion& vrReleportOrn) = 0;

	virtual void processClientCommands() = 0;
};

#endif  //PHYSICS_COMMAND_PROCESSOR_INTERFACE_H


text:
require 'spec_helper'
require_relative '../../../lib/trellist/client.rb'

RSpec.describe 'Client' do
  describe 'a new client', record: :skip do
    context 'without the proper arguments' do
      it 'requires a board_id' do
        expect{Client.new(key: 'foo', token: 'foo_token')}.
          to raise_error(ArgumentError)
      end

      it 'requires a key' do
        expect{Client.new(board_id: 'my_board', token: 'foo_token')}.
          to raise_error(ArgumentError)
      end

      it 'requires a token' do
        expect{Client.new(board_id: 'my_board', key: 'foo')}.
          to raise_error(ArgumentError)
      end

      it 'requires arguments' do
        expect{Client.new()}.to raise_error(ArgumentError)
      end
    end

    context 'with all of the proper arguments' do
      it 'does not raise an argument error' do
        expect{Client.new(board_id: 'foo',
                          key: 'blah123blah',
                          token: 'xzypdq')}.not_to raise_error
      end
    end
  end

  describe 'get board lists' do
    it 'sets @client.lists' do
      @client = Client.new(board_id: 't3anNqoJ',
                           token: 'myTRELLOtoken',
                           key: 'myTRELLOkey')
      @client.get_board_lists
      expect(@client.lists).not_to be_nil
      expect(@client.lists.size).to eq(1)
    end
  end

  describe 'get list cards' do
    let(:client) { Client.new(board_id: 't3anNqoJ',
                         token: 'myTRELLOkey',
                         key: 'myTRELLOtoken') }

    context 'witout a label argument' do
      it 'sets @client.cards' do
        client.list_cards('5883d2c40c15260ae897621d')
        expect(client.cards).not_to be_nil
        expect(client.cards.size).to eq(3)
      end
    end

    context 'with a label argument' do
      it 'sets @client.cards limited by card label' do
        client.list_cards('5883d2c40c15260ae897621d', label: 'red')
        expect(client.cards).not_to be_nil
        expect(client.cards.size).to eq(1)
      end
    end
  end

  describe 'generate links' do
    before do
      @client = Client.new(board_id: 'foo',
                           key: 'blah123blah',
                           token: 'xzypdq')
      card = Trello::Card.new(name: 'mock card title')
      @client.cards = [card]
      allow_any_instance_of(Trello::Card).
        to receive(:short_url).and_return('http://example.com/foobar')
    end

    context 'format: markdown' do
      it 'prints link in markdown' do
        expect(@client.generate_links(format: 'markdown').first).
          to eq("[mock card title](http://example.com/foobar)")
      end
    end

    context 'format: plain' do
      it 'prints link plainly' do
        expect(@client.generate_links(format: 'plain').first).
          to eq("http://example.com/foobar")
      end
    end

    context 'format: titles-only' do
      it 'does not print links just titles' do
        expect(@client.generate_links(format: 'titles-only').first).
          to eq("mock card title")
      end
    end

    context 'format: html' do
      it 'prints link like markdown' do
        expect(@client.generate_links(format: 'html').first).
          to eq("mock card title")
      end
    end

    context 'format: markdown, prefix: small trello icon' do
      it 'prints link like markdown' do
        expect(@client.generate_links(prefix: '![](https://github.trello.services/images/mini-trello-icon.png) ').first).
          to eq("![](https://github.trello.services/images/mini-trello-icon.png) [mock card title](http://example.com/foobar)")
      end
    end
  end

  describe 'board_labels' do
    before do
      @client = Client.new(board_id: 't3anNqoJ',
                           key: 'myTRELLOkey',
                           token: 'myTRELLOtoken')
    end

    it 'sets @client.labels' do
      @client.board_labels
      expect(@client.labels).not_to be_nil
      expect(@client.labels.size).to eq(6)
    end
  end
end


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

<!--

 This file is part of the Sylius package.

 (c) Paweł Jędrzejewski

 For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.

-->

<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping">

    <mapped-superclass name="Sylius\Component\Product\Model\ProductAssociation" table="sylius_product_association" />

</doctrine-mapping>


text:
package com.gemstone.gemfire.test.junit.categories;

/**
 * Unit test category that specifies tests for distributed transactions
 * functionality
 * @author shirishd
 */
public interface DistributedTransactionsTest {

}


text:
<?php

namespace Backend\Modules\Mailmotor\Actions;

use Backend\Core\Engine\Base\ActionAdd as BackendBaseActionAdd;
use Backend\Core\Engine\Form as BackendForm;
use Backend\Core\Engine\Language as BL;
use Backend\Core\Engine\Model as BackendModel;
use Backend\Modules\Mailmotor\Engine\Model as BackendMailmotorModel;
use Backend\Modules\Mailmotor\Engine\CMHelper as BackendMailmotorCMHelper;

/**
 * This is the add-action, it will display a form to create a new subscriber
 *
 * @author Dave Lens <dave.lens@netlash.com>
 */
class AddAddress extends BackendBaseActionAdd
{
    /**
     * The given group ID
     *
     * @var    int
     */
    private $groupId;

    /**
     * Execute the action
     */
    public function execute()
    {
        parent::execute();
        $this->groupId = $this->getParameter('group_id', 'int');
        $this->loadForm();
        $this->validateForm();
        $this->parse();
        $this->display();
    }

    /**
     * Load the form
     */
    private function loadForm()
    {
        $this->frm = new BackendForm('add');
        $this->frm->addText('email');

        // fetch groups
        $groups = BackendMailmotorModel::getGroupsForCheckboxes();

        // if no groups are found, redirect to overview
        if (empty($groups)) {
            $this->redirect(BackendModel::createURLForAction('Addresses') . '&error=no_groups');
        }

        // add checkboxes for groups
        $this->frm->addMultiCheckbox('groups', $groups, $this->groupId);
    }

    /**
     * Validate the form
     */
    private function validateForm()
    {
        // is the form submitted?
        if ($this->frm->isSubmitted()) {
            // cleanup the submitted fields, ignore fields that were added by hackers
            $this->frm->cleanupFields();

            // validate fields
            $this->frm->getField('email')->isFilled(BL::err('EmailIsRequired'));

            // get addresses
            $addresses = (array) explode(',', $this->frm->getField('email')->getValue());

            // loop addresses
            foreach ($addresses as $email) {
                // validate email
                if (!\SpoonFilter::isEmail(trim($email))) {
                    // add error if needed
                    $this->frm->getField('email')->addError(BL::err('ContainsInvalidEmail'));

                    // stop looking
                    break;
                }
            }

            $this->frm->getField('groups')->isFilled(BL::err('ChooseAtLeastOneGroup'));

            // no errors?
            if ($this->frm->isCorrect()) {
                // build item
                $item = $this->frm->getValues();
                $item['source'] = BL::lbl('Manual');
                $item['created_on'] = BackendModel::getUTCDate('Y-m-d H:i:s');

                // loop the groups
                foreach ($item['groups'] as $group) {
                    foreach ($addresses as $email) {
                        BackendMailmotorCMHelper::subscribe(trim($email), $group);
                    }
                }

                // trigger event
                BackendModel::triggerEvent($this->getModule(), 'after_add_address', array('item' => $item));

                // everything is saved, so redirect to the overview
                $this->redirect(
                    BackendModel::createURLForAction(
                        'Addresses'
                    ) . (!empty($this->groupId) ? '&group_id=' . $this->groupId : '') . '&report=added'
                );
            }
        }
    }
}


text:
""" Practica 8-2 - Favorite Book

Write a function called favorite_book() that accepts one
parameter, title. The function should print a message,
such as One of my favorite books is Alice in Wonderland.
Call the function, making sure to include a book title as
an argument in the function call."""

def favorite_book(Titulo):
    print(f"Uno de mis libros favoritos es:{Titulo}.")

favorite_book('Palabras radiantes')


text:
require 'digest.so'

module Digest
  # A mutex for Digest().
  REQUIRE_MUTEX = Mutex.new

  def self.const_missing(name) # :nodoc:
    case name
    when :SHA256, :SHA384, :SHA512
      lib = 'digest/sha2.so'
    else
      lib = File.join('digest', name.to_s.downcase)
    end

    begin
      require lib
    rescue LoadError
      raise LoadError, "library not found for class Digest::#{name} -- #{lib}", caller(1)
    end
    unless Digest.const_defined?(name)
      raise NameError, "uninitialized constant Digest::#{name}", caller(1)
    end
    Digest.const_get(name)
  end

  class ::Digest::Class
    # Creates a digest object and reads a given file, _name_.
    # Optional arguments are passed to the constructor of the digest
    # class.
    #
    #   p Digest::SHA256.file("X11R6.8.2-src.tar.bz2").hexdigest
    #   # => "f02e3c85572dc9ad7cb77c2a638e3be24cc1b5bea9fdbb0b0299c9668475c534"
    def self.file(name, *args)
      new(*args).file(name)
    end

    # Returns the base64 encoded hash value of a given _string_.  The
    # return value is properly padded with '=' and contains no line
    # feeds.
    def self.base64digest(str, *args)
      [digest(str, *args)].pack('m0')
    end
  end

  module Instance
    # Updates the digest with the contents of a given file _name_ and
    # returns self.
    def file(name)
      File.open(name, "rb") {|f|
        buf = ""
        while f.read(16384, buf)
          update buf
        end
      }
      self
    end

    # If none is given, returns the resulting hash value of the digest
    # in a base64 encoded form, keeping the digest's state.
    #
    # If a +string+ is given, returns the hash value for the given
    # +string+ in a base64 encoded form, resetting the digest to the
    # initial state before and after the process.
    #
    # In either case, the return value is properly padded with '=' and
    # contains no line feeds.
    def base64digest(str = nil)
      [str ? digest(str) : digest].pack('m0')
    end

    # Returns the resulting hash value and resets the digest to the
    # initial state.
    def base64digest!
      [digest!].pack('m0')
    end
  end
end

# call-seq:
#   Digest(name) -> digest_subclass
#
# Returns a Digest subclass by +name+ in a thread-safe manner even
# when on-demand loading is involved.
#
#   require 'digest'
#
#   Digest("MD5")
#   # => Digest::MD5
#
#   Digest(:SHA256)
#   # => Digest::SHA256
#
#   Digest(:Foo)
#   # => LoadError: library not found for class Digest::Foo -- digest/foo
def Digest(name)
  const = name.to_sym
  Digest::REQUIRE_MUTEX.synchronize {
    # Ignore autoload's because it is void when we have #const_missing
    Digest.const_missing(const)
  }
rescue LoadError
  # Constants do not necessarily rely on digest/*.
  if Digest.const_defined?(const)
    Digest.const_get(const)
  else
    raise
  end
end


text:
 #if CPP_DIRECTIVE_LEADING_SPACE

 #endif

	#if CPP_DIRECTIVE_LEADING_SPACE

	#endif

 	#if CPP_DIRECTIVE_LEADING_SPACE

 	#endif

	 #if CPP_DIRECTIVE_LEADING_SPACE

	 #endif

 	 #if CPP_DIRECTIVE_LEADING_SPACE

 	 #endif

	 	#if CPP_DIRECTIVE_LEADING_SPACE

	 	#endif


text:
import Span = require('./span');
import SpanContext = require('./span_context');

declare class Reference {
    /**
     * @return The Reference type (e.g., REFERENCE_CHILD_OF or
     *         REFERENCE_FOLLOWS_FROM).
     */
    type(): string;

    /**
     * @return The SpanContext being referred to (e.g., the
     *         parent in a REFERENCE_CHILD_OF Reference).
     */
    referencedContext(): SpanContext;

    /**
     * Initialize a new Reference instance.
     *
     * @param type - the Reference type constant (e.g.,
     *        REFERENCE_CHILD_OF or REFERENCE_FOLLOWS_FROM).
     * @param referencedContext - the SpanContext being referred
     *        to. As a convenience, a Span instance may be passed in instead
     *        (in which case its .context() is used here).
     */
    constructor(type: string, referencedContext: SpanContext | Span);
}

export = Reference;


text:
Floor-to-floor section details\\
Floor-to-external wall section details\\
Floor-to-internal partitions section details

Ceiling-to-ceiling section details\\
Ceiling-to-external wall section details\\
Ceiling-to-internal partitions section details

EXTERNAL WALL-TO-INTERNAL PARTITION PLAN DETAILS\\
ROOF-TO-EXTERNAL WALL SECTION DETAILS\\
ROOFING DETAILS\\
INTERNAL PARTITION-TO-INTERNAL PARTITION PLAN DETAILS\\
(If required - not needed if it's common construction)

- Grid lines where location specific
- Finished floor level benchmarks where location specific
- Dimensions
- Description of the construction using systems and materials codes
    - _(Do not include description of applied finishes e.g. sealants, paints, etc. They are described in F series drawings._
    - _Do not redraw common details. Make reference to proprietary system in the specification instead.)_


text:
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Examples</title>
<link rel="stylesheet" href="../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../index.html" title="Chapter 1. Boost.Bimap">
<link rel="up" href="../index.html" title="Chapter 1. Boost.Bimap">
<link rel="prev" href="performance.html" title="Performance">
<link rel="next" href="examples/simple_bimap.html" title="Simple Bimap">

Home
Libraries
People
FAQ
More

Examples

Examples list

Simple Bimap

Mighty Bimap

MultiIndex
      to Bimap Path - Bidirectional Map

MultiIndex
      to Bimap Path - Hashed indices

Examples list

        In the folder libs/bimap/example you can
        find all the examples used in bimap documentation. Here is a list of them:

Table 1.7. Tutorial examples

<colgroup>
<col>
<col>
</colgroup>

                  Program

                  Description

                  simple_bimap.cpp

                  Soccer world cup example

                  tagged_simple_bimap.cpp

                  Soccer world cup example using user defined names

                  step_by_step.cpp

                  Basic example of the three views of bimap

                  population_bimap.cpp

                  Countries populations, using unordered_set_of
                  and multiset_of

                  repetitions_counter.cpp

                  Word repetitions counter, using unordered_set_of
                  and list_of

                  mighty_bimap.cpp

                  Dictionary using list_of_relation

                  user_defined_names.cpp

                  Equivalence between code with tagged and untagged code

                  standard_map_comparison.cpp

                  Comparison between standard maps and bimap map views

                  at_function_examples.cpp

                  Functions at(key)
                  and operator[](key)
                  examples

                  tutorial_modify_and_replace.cpp

                  modify and replace examples

                  tutorial_range.cpp

                  range()
                  tutorial

                  tutorial_info_hook.cpp

                  Additional information hooking

                  unconstrained_collection.cpp

                  Using unconstrained_set_of
                  collection type

Table 1.8. Bimap and Boost examples

<colgroup>
<col>
<col>
</colgroup>

                  Program

                  Description

                  assign.cpp

                  Bimap and Boost.Assign: Methods to insert elements

                  lambda.cpp

                  Bimap and Boost.Lambda: new lambda placeholders

                  property_map.cpp

                  Bimap and Boost.PropertyMap: PropertyMap support

                  range.cpp

                  Bimap and Boost.Range: Using bimaps in the new range framework

                  foreach.cpp

                  Bimap and Boost.Foreach: Iterating over bimaps

                  typeof.cpp

                  Bimap and Boost.Typeof: using BOOST_AUTO while we wait for C++0x

                  xpressive.cpp

                  Bimap and Boost.Xpressive: Inserting elements in a bimap

                  serialization.cpp:

                  Bimap and Boost.Serialization: Load and save bimaps and iterators

Table 1.9. Boost.MultiIndex to Boost.Bimap path examples

<colgroup>
<col>
<col>
</colgroup>

                  Program

                  Description

                  bidirectional_map.cpp

                  Boost.MultiIndex to Boost.Bimap path example

                  hashed_indices.cpp

                  Boost.MultiIndex to Boost.Bimap path example

                  tagged_bidirectional_map.cpp

                  Boost.MultiIndex to Boost.Bimap path example

Copyright © 2006 -2007 Matias Capeletto

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
Title: Warning: mkdir() [function.mkdir]: Too many links in
Date: 2011-04-05 11:02
Category: Sākums
Tags: 2011
Lang: en

We got this error today. It is not very self explaining, so I thought I will leave here a link explaining it: [http://ryan.ifupdown.com/2008/08/17/warning-mkdir-too-many-links/][1]

[1]: http://ryan.ifupdown.com/2008/08/17/warning-mkdir-too-many-links/