text:
package com.oath.cyclops.jackson.deserializers;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
import cyclops.control.Either;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.IOException;

final class EitherDeserializer extends StdDeserializer<Either<?,?>>  {

  protected EitherDeserializer(JavaType valueType) {
    super(valueType);

  }

  @Override
  public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException {
    return super.deserializeWithType(p, ctxt, typeDeserializer);
  }

  @AllArgsConstructor @NoArgsConstructor
  public static class EitherBean{

    @Getter @Setter
    private  Object left;
    @Getter @Setter
    private  Object right;
  }

  @Override
  public Either<?,?> deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
    JsonDeserializer ser = ctxt.findRootValueDeserializer(ctxt.getTypeFactory().constructSimpleType(EitherBean.class, new JavaType[0]));
    EitherBean x = (EitherBean)ser.deserialize(p, ctxt);
    if(x.left!=null){
      return Either.left(x.left);
    }
    return Either.right(x.right);
  }

}


text:
package planbuilder

import (
	vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc"
	"vitess.io/vitess/go/vt/sqlparser"
	"vitess.io/vitess/go/vt/vterrors"
	"vitess.io/vitess/go/vt/vtgate/engine"
	"vitess.io/vitess/go/vt/vtgate/semantics"
)

var _ logicalPlan = (*joinGen4)(nil)

// joinGen4 is used to build a Join primitive.
// It's used to build an inner join and only used by the Gen4 planner
type joinGen4 struct {
	// Left and Right are the nodes for the join.
	Left, Right logicalPlan
	Opcode      engine.JoinOpcode
	Cols        []int
	Vars        map[string]int
}

// Order implements the logicalPlan interface
func (j *joinGen4) Order() int {
	panic("implement me")
}

// ResultColumns implements the logicalPlan interface
func (j *joinGen4) ResultColumns() []*resultColumn {
	panic("implement me")
}

// Reorder implements the logicalPlan interface
func (j *joinGen4) Reorder(i int) {
	panic("implement me")
}

// Wireup implements the logicalPlan interface
func (j *joinGen4) Wireup(lp logicalPlan, jt *jointab) error {
	panic("implement me")
}

// WireupGen4 implements the logicalPlan interface
func (j *joinGen4) WireupGen4(semTable *semantics.SemTable) error {
	err := j.Left.WireupGen4(semTable)
	if err != nil {
		return err
	}
	return j.Right.WireupGen4(semTable)
}

// SupplyVar implements the logicalPlan interface
func (j *joinGen4) SupplyVar(from, to int, col *sqlparser.ColName, varname string) {
	panic("implement me")
}

// SupplyCol implements the logicalPlan interface
func (j *joinGen4) SupplyCol(col *sqlparser.ColName) (rc *resultColumn, colNumber int) {
	panic("implement me")
}

// SupplyWeightString implements the logicalPlan interface
func (j *joinGen4) SupplyWeightString(int, bool) (weightcolNumber int, err error) {
	panic("implement me")
}

// Primitive implements the logicalPlan interface
func (j *joinGen4) Primitive() engine.Primitive {
	return &engine.Join{
		Left:   j.Left.Primitive(),
		Right:  j.Right.Primitive(),
		Cols:   j.Cols,
		Vars:   j.Vars,
		Opcode: j.Opcode,
	}
}

// Inputs implements the logicalPlan interface
func (j *joinGen4) Inputs() []logicalPlan {
	return []logicalPlan{j.Left, j.Right}
}

// Rewrite implements the logicalPlan interface
func (j *joinGen4) Rewrite(inputs ...logicalPlan) error {
	if len(inputs) != 2 {
		return vterrors.New(vtrpcpb.Code_INTERNAL, "wrong number of children")
	}
	j.Left = inputs[0]
	j.Right = inputs[1]
	return nil
}

// ContainsTables implements the logicalPlan interface
func (j *joinGen4) ContainsTables() semantics.TableSet {
	return j.Left.ContainsTables().Merge(j.Right.ContainsTables())
}

redpajama_set_name: RedPajamaGithub


text:
from trac.core import Component, implements
from announcer.api import IAnnouncementFormatter
from trac.config import Option, IntOption, BoolOption
from genshi.template import NewTextTemplate, MarkupTemplate
from genshi import HTML
from trac.web.href import Href
from trac.web.chrome import Chrome
from trac.wiki.model import WikiPage
from genshi.template import TemplateLoader
from trac.util.text import wrap
from trac.versioncontrol.diff import diff_blocks, unified_diff
import difflib

def diff_cleanup(gen):
    for value in gen:
        if value.startswith('---'):
            continue
        if value.startswith('+++'):
            continue
        if value.startswith('@@'):
            yield '\n'
        else:
            yield value

def lineup(gen):
    for value in gen:
        yield ' ' + value

diff_header = """Index: %(name)s
==============================================================================
--- %(name)s (version: %(oldversion)s)
+++ %(name)s (version: %(version)s)
"""

class WikiFormatter(Component):
    implements(IAnnouncementFormatter)

    wiki_email_diff = BoolOption('announcer', 'wiki_email_diff',
            "true",
            """Should a wiki diff be sent with emails?""")

    def styles(self, transport, realm):
        if realm == "wiki":
            yield "text/plain"

    def alternative_style_for(self, transport, realm, style):
        if realm == "wiki" and style != "text/plain":
            return "text/plain"

    def format(self, transport, realm, style, event):
        if realm == "wiki" and style == "text/plain":
            return self._format_plaintext(event)

    def _format_plaintext(self, event):
        page = event.target
        data = dict(
            action = event.category,
            attachment = event.attachment,
            page = page,
            author = event.author,
            comment = event.comment,
            category = event.category,
            page_link = self.env.abs_href('wiki', page.name),
            project_name = self.env.project_name,
            project_desc = self.env.project_description,
            project_link = self.env.project_url or self.env.abs_href(),
        )
        old_page = WikiPage(self.env, page.name, page.version - 1)
        if page.version:
            data["changed"] = True
            data["diff_link"] = self.env.abs_href('wiki', page.name,
                    action="diff", version=page.version)
            if self.wiki_email_diff:
                diff = "\n"
                diff += diff_header % { 'name': page.name,
                                       'version': page.version,
                                       'oldversion': page.version - 1
                                     }
                for line in unified_diff(old_page.text.splitlines(),
                                         page.text.splitlines(), context=3):
                    diff += "%s\n" % line
                data["diff"] = diff
        chrome = Chrome(self.env)
        dirs = []
        for provider in chrome.template_providers:
            dirs += provider.get_templates_dirs()
        templates = TemplateLoader(dirs, variable_lookup='lenient')
        template = templates.load('wiki_email_plaintext.txt',
                cls=NewTextTemplate)
        if template:
            stream = template.generate(**data)
            output = stream.render('text')
        return output


text:
package com.healthmarketscience.jackcess.query;

import java.util.List;

/**
 * Query interface which represents a row update query, e.g.:
 * {@code UPDATE <table> SET <newValues>}
 *
 * @author James Ahlborn
 */
public interface UpdateQuery extends Query
{

  public List<String> getTargetTables();

  public String getRemoteDbPath();

  public String getRemoteDbType();

  public List<String> getNewValues();

  public String getWhereExpression();
}


text:
package ssh_config

import (
	"fmt"
	"strconv"
	"strings"
)

// Default returns the default value for the given keyword, for example "22" if
// the keyword is "Port". Default returns the empty string if the keyword has no
// default, or if the keyword is unknown. Keyword matching is case-insensitive.
//
// Default values are provided by OpenSSH_7.4p1 on a Mac.
func Default(keyword string) string {
	return defaults[strings.ToLower(keyword)]
}

// Arguments where the value must be "yes" or "no" and *only* yes or no.
var yesnos = map[string]bool{
	strings.ToLower("BatchMode"):                        true,
	strings.ToLower("CanonicalizeFallbackLocal"):        true,
	strings.ToLower("ChallengeResponseAuthentication"):  true,
	strings.ToLower("CheckHostIP"):                      true,
	strings.ToLower("ClearAllForwardings"):              true,
	strings.ToLower("Compression"):                      true,
	strings.ToLower("EnableSSHKeysign"):                 true,
	strings.ToLower("ExitOnForwardFailure"):             true,
	strings.ToLower("ForwardAgent"):                     true,
	strings.ToLower("ForwardX11"):                       true,
	strings.ToLower("ForwardX11Trusted"):                true,
	strings.ToLower("GatewayPorts"):                     true,
	strings.ToLower("GSSAPIAuthentication"):             true,
	strings.ToLower("GSSAPIDelegateCredentials"):        true,
	strings.ToLower("HostbasedAuthentication"):          true,
	strings.ToLower("IdentitiesOnly"):                   true,
	strings.ToLower("KbdInteractiveAuthentication"):     true,
	strings.ToLower("NoHostAuthenticationForLocalhost"): true,
	strings.ToLower("PasswordAuthentication"):           true,
	strings.ToLower("PermitLocalCommand"):               true,
	strings.ToLower("PubkeyAuthentication"):             true,
	strings.ToLower("RhostsRSAAuthentication"):          true,
	strings.ToLower("RSAAuthentication"):                true,
	strings.ToLower("StreamLocalBindUnlink"):            true,
	strings.ToLower("TCPKeepAlive"):                     true,
	strings.ToLower("UseKeychain"):                      true,
	strings.ToLower("UsePrivilegedPort"):                true,
	strings.ToLower("VisualHostKey"):                    true,
}

var uints = map[string]bool{
	strings.ToLower("CanonicalizeMaxDots"):     true,
	strings.ToLower("CompressionLevel"):        true, // 1 to 9
	strings.ToLower("ConnectionAttempts"):      true,
	strings.ToLower("ConnectTimeout"):          true,
	strings.ToLower("NumberOfPasswordPrompts"): true,
	strings.ToLower("Port"):                    true,
	strings.ToLower("ServerAliveCountMax"):     true,
	strings.ToLower("ServerAliveInterval"):     true,
}

func mustBeYesOrNo(lkey string) bool {
	return yesnos[lkey]
}

func mustBeUint(lkey string) bool {
	return uints[lkey]
}

func validate(key, val string) error {
	lkey := strings.ToLower(key)
	if mustBeYesOrNo(lkey) && (val != "yes" && val != "no") {
		return fmt.Errorf("ssh_config: value for key %q must be 'yes' or 'no', got %q", key, val)
	}
	if mustBeUint(lkey) {
		_, err := strconv.ParseUint(val, 10, 64)
		if err != nil {
			return fmt.Errorf("ssh_config: %v", err)
		}
	}
	return nil
}

var defaults = map[string]string{
	strings.ToLower("AddKeysToAgent"):                  "no",
	strings.ToLower("AddressFamily"):                   "any",
	strings.ToLower("BatchMode"):                       "no",
	strings.ToLower("CanonicalizeFallbackLocal"):       "yes",
	strings.ToLower("CanonicalizeHostname"):            "no",
	strings.ToLower("CanonicalizeMaxDots"):             "1",
	strings.ToLower("ChallengeResponseAuthentication"): "yes",
	strings.ToLower("CheckHostIP"):                     "yes",
	// TODO is this still the correct cipher
	strings.ToLower("Cipher"):                    "3des",
	strings.ToLower("Ciphers"):                   "chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc",
	strings.ToLower("ClearAllForwardings"):       "no",
	strings.ToLower("Compression"):               "no",
	strings.ToLower("CompressionLevel"):          "6",
	strings.ToLower("ConnectionAttempts"):        "1",
	strings.ToLower("ControlMaster"):             "no",
	strings.ToLower("EnableSSHKeysign"):          "no",
	strings.ToLower("EscapeChar"):                "~",
	strings.ToLower("ExitOnForwardFailure"):      "no",
	strings.ToLower("FingerprintHash"):           "sha256",
	strings.ToLower("ForwardAgent"):              "no",
	strings.ToLower("ForwardX11"):                "no",
	strings.ToLower("ForwardX11Timeout"):         "20m",
	strings.ToLower("ForwardX11Trusted"):         "no",
	strings.ToLower("GatewayPorts"):              "no",
	strings.ToLower("GlobalKnownHostsFile"):      "/etc/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts2",
	strings.ToLower("GSSAPIAuthentication"):      "no",
	strings.ToLower("GSSAPIDelegateCredentials"): "no",
	strings.ToLower("HashKnownHosts"):            "no",
	strings.ToLower("HostbasedAuthentication"):   "no",

	strings.ToLower("HostbasedKeyTypes"): "ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,ssh-rsa",
	strings.ToLower("HostKeyAlgorithms"): "ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,ssh-rsa",
	// HostName has a dynamic default (the value passed at the command line).

	strings.ToLower("IdentitiesOnly"): "no",
	strings.ToLower("IdentityFile"):   "~/.ssh/identity",

	// IPQoS has a dynamic default based on interactive or non-interactive
	// sessions.

	strings.ToLower("KbdInteractiveAuthentication"): "yes",

	strings.ToLower("KexAlgorithms"): "curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1",
	strings.ToLower("LogLevel"):      "INFO",
	strings.ToLower("MACs"):          "umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1",

	strings.ToLower("NoHostAuthenticationForLocalhost"): "no",
	strings.ToLower("NumberOfPasswordPrompts"):          "3",
	strings.ToLower("PasswordAuthentication"):           "yes",
	strings.ToLower("PermitLocalCommand"):               "no",
	strings.ToLower("Port"):                             "22",

	strings.ToLower("PreferredAuthentications"): "gssapi-with-mic,hostbased,publickey,keyboard-interactive,password",
	strings.ToLower("Protocol"):                 "2",
	strings.ToLower("ProxyUseFdpass"):           "no",
	strings.ToLower("PubkeyAcceptedKeyTypes"):   "ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,ssh-rsa",
	strings.ToLower("PubkeyAuthentication"):     "yes",
	strings.ToLower("RekeyLimit"):               "default none",
	strings.ToLower("RhostsRSAAuthentication"):  "no",
	strings.ToLower("RSAAuthentication"):        "yes",

	strings.ToLower("ServerAliveCountMax"):   "3",
	strings.ToLower("ServerAliveInterval"):   "0",
	strings.ToLower("StreamLocalBindMask"):   "0177",
	strings.ToLower("StreamLocalBindUnlink"): "no",
	strings.ToLower("StrictHostKeyChecking"): "ask",
	strings.ToLower("TCPKeepAlive"):          "yes",
	strings.ToLower("Tunnel"):                "no",
	strings.ToLower("TunnelDevice"):          "any:any",
	strings.ToLower("UpdateHostKeys"):        "no",
	strings.ToLower("UseKeychain"):           "no",
	strings.ToLower("UsePrivilegedPort"):     "no",

	strings.ToLower("UserKnownHostsFile"): "~/.ssh/known_hosts ~/.ssh/known_hosts2",
	strings.ToLower("VerifyHostKeyDNS"):   "no",
	strings.ToLower("VisualHostKey"):      "no",
	strings.ToLower("XAuthLocation"):      "/usr/X11R6/bin/xauth",
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="API documentation for the Rust `GenericPath` trait in crate `std`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, GenericPath">

    <title>std::old_path::GenericPath - Rust</title>

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

    <link rel="shortcut icon" href="http://www.rust-lang.org/favicon.ico">

std::<wbr>old_path

        <form class="search-form js-only">

                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press 'S' to search, '?' for more options..."
                       type="search">

        </form>

Trait std::<wbr>old_path::<wbr>GenericPath<wbr>Unstable
            [-] [+]
        [src]

pub trait GenericPath: Clone + GenericPathUnsafe {
    fn as_vec<'a>(&'a self) -> &'a [u8];
    fn into_vec(self) -> Vec<u8>;
    fn dirname<'a>(&'a self) -> &'a [u8];
    fn filename<'a>(&'a self) -> Option<&'a [u8]>;
    fn root_path(&self) -> Option<Self>;
    fn pop(&mut self) -> bool;
    fn is_absolute(&self) -> bool;
    fn is_ancestor_of(&self, other: &Self) -> bool;
    fn path_relative_from(&self, base: &Self) -> Option<Self>;
    fn ends_with_path(&self, child: &Self) -> bool;

    fn new<T: BytesContainer>(path: T) -> Self { ... }
    fn new_opt<T: BytesContainer>(path: T) -> Option<Self> { ... }
    fn as_str<'a>(&'a self) -> Option<&'a str> { ... }
    fn display<'a>(&'a self) -> Display<'a, Self> { ... }
    fn filename_display<'a>(&'a self) -> Display<'a, Self> { ... }
    fn dirname_str<'a>(&'a self) -> Option<&'a str> { ... }
    fn filename_str<'a>(&'a self) -> Option<&'a str> { ... }
    fn filestem<'a>(&'a self) -> Option<&'a [u8]> { ... }
    fn filestem_str<'a>(&'a self) -> Option<&'a str> { ... }
    fn extension<'a>(&'a self) -> Option<&'a [u8]> { ... }
    fn extension_str<'a>(&'a self) -> Option<&'a str> { ... }
    fn set_filename<T: BytesContainer>(&mut self, filename: T) { ... }
    fn set_extension<T: BytesContainer>(&mut self, extension: T) { ... }
    fn with_filename<T: BytesContainer>(&self, filename: T) -> Self { ... }
    fn with_extension<T: BytesContainer>(&self, extension: T) -> Self { ... }
    fn dir_path(&self) -> Self { ... }
    fn push<T: BytesContainer>(&mut self, path: T) { ... }
    fn push_many<T: BytesContainer>(&mut self, paths: &[T]) { ... }
    fn join<T: BytesContainer>(&self, path: T) -> Self { ... }
    fn join_many<T: BytesContainer>(&self, paths: &[T]) -> Self { ... }
    fn is_relative(&self) -> bool { ... }
}

A trait that represents the generic operations available on paths

Required Methods

fn as_vec<'a>(&'a self) -> &'a [u8]

Returns the path as a byte vector

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("abc/def");
    assert_eq!(p.as_vec(), b"abc/def");
    }
}

let p = Path::new("abc/def");
assert_eq!(p.as_vec(), b"abc/def");

fn into_vec(self) -> Vec<u8>

Converts the Path into an owned byte vector

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("abc/def");
    assert_eq!(p.into_vec(), b"abc/def".to_vec());
    // attempting to use p now results in "error: use of moved value"
    }
}

let p = Path::new("abc/def");
assert_eq!(p.into_vec(), b"abc/def".to_vec());
// attempting to use p now results in "error: use of moved value"

fn dirname<'a>(&'a self) -> &'a [u8]

Returns the directory component of self, as a byte vector (with no trailing separator).
If self has no directory component, returns ['.'].

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("abc/def/ghi");
    assert_eq!(p.dirname(), b"abc/def");
    }
}

let p = Path::new("abc/def/ghi");
assert_eq!(p.dirname(), b"abc/def");

fn filename<'a>(&'a self) -> Option<&'a [u8]>

Returns the file component of self, as a byte vector.
If self represents the root of the file hierarchy, returns None.
If self is "." or "..", returns None.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("abc/def/ghi");
    assert_eq!(p.filename(), Some(b"ghi"));
    }
}

let p = Path::new("abc/def/ghi");
assert_eq!(p.filename(), Some(b"ghi"));

fn root_path(&self) -> Option<Self>

Returns a Path that represents the filesystem root that self is rooted in.

If self is not absolute, or vol/cwd-relative in the case of Windows, this returns None.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    assert_eq!(Path::new("abc/def").root_path(), None);
    assert_eq!(Path::new("/abc/def").root_path(), Some(Path::new("/")));
    }
}

assert_eq!(Path::new("abc/def").root_path(), None);
assert_eq!(Path::new("/abc/def").root_path(), Some(Path::new("/")));

fn pop(&mut self) -> bool

Removes the last path component from the receiver.
Returns true if the receiver was modified, or false if it already
represented the root of the file hierarchy.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let mut p = Path::new("foo/bar/baz.txt");
    p.pop();
    assert_eq!(p, Path::new("foo/bar"));
    }
}

let mut p = Path::new("foo/bar/baz.txt");
p.pop();
assert_eq!(p, Path::new("foo/bar"));

fn is_absolute(&self) -> bool

Returns whether self represents an absolute path.
An absolute path is defined as one that, when joined to another path, will
yield back the same absolute path.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("/abc/def");
    assert!(p.is_absolute());
    }
}

let p = Path::new("/abc/def");
assert!(p.is_absolute());

fn is_ancestor_of(&self, other: &Self) -> bool

Returns whether self is equal to, or is an ancestor of, the given path.
If both paths are relative, they are compared as though they are relative
to the same parent path.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("foo/bar/baz/quux.txt");
    let fb = Path::new("foo/bar");
    let bq = Path::new("baz/quux.txt");
    assert!(fb.is_ancestor_of(&p));
    }
}

let p = Path::new("foo/bar/baz/quux.txt");
let fb = Path::new("foo/bar");
let bq = Path::new("baz/quux.txt");
assert!(fb.is_ancestor_of(&p));

fn path_relative_from(&self, base: &Self) -> Option<Self>

Returns the Path that, were it joined to base, would yield self.
If no such path exists, None is returned.
If self is absolute and base is relative, or on Windows if both
paths refer to separate drives, an absolute path is returned.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("foo/bar/baz/quux.txt");
    let fb = Path::new("foo/bar");
    let bq = Path::new("baz/quux.txt");
    assert_eq!(p.path_relative_from(&fb), Some(bq));
    }
}

let p = Path::new("foo/bar/baz/quux.txt");
let fb = Path::new("foo/bar");
let bq = Path::new("baz/quux.txt");
assert_eq!(p.path_relative_from(&fb), Some(bq));

fn ends_with_path(&self, child: &Self) -> bool

Returns whether the relative path child is a suffix of self.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("foo/bar/baz/quux.txt");
    let bq = Path::new("baz/quux.txt");
    assert!(p.ends_with_path(&bq));
    }
}

let p = Path::new("foo/bar/baz/quux.txt");
let bq = Path::new("baz/quux.txt");
assert!(p.ends_with_path(&bq));

Provided Methods

fn new<T: BytesContainer>(path: T) -> Self

Creates a new Path from a byte vector or string.
The resulting Path will always be normalized.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let path = Path::new("foo/bar");
    }
}

let path = Path::new("foo/bar");

Panics

Panics the task if the path contains a NUL.

See individual Path impls for additional restrictions.

fn new_opt<T: BytesContainer>(path: T) -> Option<Self>

Creates a new Path from a byte vector or string, if possible.
The resulting Path will always be normalized.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let x: &[u8] = b"foo\0";
    assert!(Path::new_opt(x).is_none());
    }
}

let x: &[u8] = b"foo\0";
assert!(Path::new_opt(x).is_none());

fn as_str<'a>(&'a self) -> Option<&'a str>

Returns the path as a string, if possible.
If the path is not representable in utf-8, this returns None.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("/abc/def");
    assert_eq!(p.as_str(), Some("/abc/def"));
    }
}

let p = Path::new("/abc/def");
assert_eq!(p.as_str(), Some("/abc/def"));

fn display<'a>(&'a self) -> Display<'a, Self>

Returns an object that implements Display for printing paths

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("abc/def");
    println!("{}", p.display()); // prints "abc/def"
    }
}

let p = Path::new("abc/def");
println!("{}", p.display()); // prints "abc/def"

fn filename_display<'a>(&'a self) -> Display<'a, Self>

Returns an object that implements Display for printing filenames

If there is no filename, nothing will be printed.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("abc/def");
    println!("{}", p.filename_display()); // prints "def"
    }
}

let p = Path::new("abc/def");
println!("{}", p.filename_display()); // prints "def"

fn dirname_str<'a>(&'a self) -> Option<&'a str>

Returns the directory component of self, as a string, if possible.
See dirname for details.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("abc/def/ghi");
    assert_eq!(p.dirname_str(), Some("abc/def"));
    }
}

let p = Path::new("abc/def/ghi");
assert_eq!(p.dirname_str(), Some("abc/def"));

fn filename_str<'a>(&'a self) -> Option<&'a str>

Returns the file component of self, as a string, if possible.
See filename for details.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("abc/def/ghi");
    assert_eq!(p.filename_str(), Some("ghi"));
    }
}

let p = Path::new("abc/def/ghi");
assert_eq!(p.filename_str(), Some("ghi"));

fn filestem<'a>(&'a self) -> Option<&'a [u8]>

Returns the stem of the filename of self, as a byte vector.
The stem is the portion of the filename just before the last '.'.
If there is no '.', the entire filename is returned.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("/abc/def.txt");
    assert_eq!(p.filestem(), Some(b"def"));
    }
}

let p = Path::new("/abc/def.txt");
assert_eq!(p.filestem(), Some(b"def"));

fn filestem_str<'a>(&'a self) -> Option<&'a str>

Returns the stem of the filename of self, as a string, if possible.
See filestem for details.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("/abc/def.txt");
    assert_eq!(p.filestem_str(), Some("def"));
    }
}

let p = Path::new("/abc/def.txt");
assert_eq!(p.filestem_str(), Some("def"));

fn extension<'a>(&'a self) -> Option<&'a [u8]>

Returns the extension of the filename of self, as an optional byte vector.
The extension is the portion of the filename just after the last '.'.
If there is no extension, None is returned.
If the filename ends in '.', the empty vector is returned.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("abc/def.txt");
    assert_eq!(p.extension(), Some(b"txt"));
    }
}

let p = Path::new("abc/def.txt");
assert_eq!(p.extension(), Some(b"txt"));

fn extension_str<'a>(&'a self) -> Option<&'a str>

Returns the extension of the filename of self, as a string, if possible.
See extension for details.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("abc/def.txt");
    assert_eq!(p.extension_str(), Some("txt"));
    }
}

let p = Path::new("abc/def.txt");
assert_eq!(p.extension_str(), Some("txt"));

fn set_filename<T: BytesContainer>(&mut self, filename: T)

Replaces the filename portion of the path with the given byte vector or string.
If the replacement name is [], this is equivalent to popping the path.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let mut p = Path::new("abc/def.txt");
    p.set_filename("foo.dat");
    assert!(p == Path::new("abc/foo.dat"));
    }
}

let mut p = Path::new("abc/def.txt");
p.set_filename("foo.dat");
assert!(p == Path::new("abc/foo.dat"));

Panics

Panics the task if the filename contains a NUL.

fn set_extension<T: BytesContainer>(&mut self, extension: T)

Replaces the extension with the given byte vector or string.
If there is no extension in self, this adds one.
If the argument is [] or "", this removes the extension.
If self has no filename, this is a no-op.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let mut p = Path::new("abc/def.txt");
    p.set_extension("csv");
    assert_eq!(p, Path::new("abc/def.csv"));
    }
}

let mut p = Path::new("abc/def.txt");
p.set_extension("csv");
assert_eq!(p, Path::new("abc/def.csv"));

Panics

Panics the task if the extension contains a NUL.

fn with_filename<T: BytesContainer>(&self, filename: T) -> Self

Returns a new Path constructed by replacing the filename with the given
byte vector or string.
See set_filename for details.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let mut p = Path::new("abc/def.txt");
    assert_eq!(p.with_filename("foo.dat"), Path::new("abc/foo.dat"));
    }
}

let mut p = Path::new("abc/def.txt");
assert_eq!(p.with_filename("foo.dat"), Path::new("abc/foo.dat"));

Panics

Panics the task if the filename contains a NUL.

fn with_extension<T: BytesContainer>(&self, extension: T) -> Self

Returns a new Path constructed by setting the extension to the given
byte vector or string.
See set_extension for details.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let mut p = Path::new("abc/def.txt");
    assert_eq!(p.with_extension("csv"), Path::new("abc/def.csv"));
    }
}

let mut p = Path::new("abc/def.txt");
assert_eq!(p.with_extension("csv"), Path::new("abc/def.csv"));

Panics

Panics the task if the extension contains a NUL.

fn dir_path(&self) -> Self

Returns the directory component of self, as a Path.
If self represents the root of the filesystem hierarchy, returns self.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("abc/def/ghi");
    assert_eq!(p.dir_path(), Path::new("abc/def"));
    }
}

let p = Path::new("abc/def/ghi");
assert_eq!(p.dir_path(), Path::new("abc/def"));

fn push<T: BytesContainer>(&mut self, path: T)

Pushes a path (as a byte vector or string) onto self.
If the argument represents an absolute path, it replaces self.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let mut p = Path::new("foo/bar");
    p.push("baz.txt");
    assert_eq!(p, Path::new("foo/bar/baz.txt"));
    }
}

let mut p = Path::new("foo/bar");
p.push("baz.txt");
assert_eq!(p, Path::new("foo/bar/baz.txt"));

Panics

Panics the task if the path contains a NUL.

fn push_many<T: BytesContainer>(&mut self, paths: &[T])

Pushes multiple paths (as byte vectors or strings) onto self.
See push for details.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let mut p = Path::new("foo");
    p.push_many(&["bar", "baz.txt"]);
    assert_eq!(p, Path::new("foo/bar/baz.txt"));
    }
}

let mut p = Path::new("foo");
p.push_many(&["bar", "baz.txt"]);
assert_eq!(p, Path::new("foo/bar/baz.txt"));

fn join<T: BytesContainer>(&self, path: T) -> Self

Returns a new Path constructed by joining self with the given path
(as a byte vector or string).
If the given path is absolute, the new Path will represent just that.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("/foo");
    assert_eq!(p.join("bar.txt"), Path::new("/foo/bar.txt"));
    }
}

let p = Path::new("/foo");
assert_eq!(p.join("bar.txt"), Path::new("/foo/bar.txt"));

Panics

Panics the task if the path contains a NUL.

fn join_many<T: BytesContainer>(&self, paths: &[T]) -> Self

Returns a new Path constructed by joining self with the given paths
(as byte vectors or strings).
See join for details.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("foo");
    let fbbq = Path::new("foo/bar/baz/quux.txt");
    assert_eq!(p.join_many(&["bar", "baz", "quux.txt"]), fbbq);
    }
}

let p = Path::new("foo");
let fbbq = Path::new("foo/bar/baz/quux.txt");
assert_eq!(p.join_many(&["bar", "baz", "quux.txt"]), fbbq);

fn is_relative(&self) -> bool

Returns whether self represents a relative path.
Typically this is the inverse of is_absolute.
But for Windows paths, it also means the path is not volume-relative or
relative to the current working directory.

Example
fn main() {
    foo();
    #[cfg(windows)] fn foo() {}
    #[cfg(unix)] fn foo() {
    let p = Path::new("abc/def");
    assert!(p.is_relative());
    }
}

let p = Path::new("abc/def");
assert!(p.is_relative());

Implementors

impl GenericPath for Path

impl GenericPath for Path

Keyboard shortcuts

?

Show this help dialog

S

Focus the search field

⇤

Move up in search results

⇥

Move down in search results

⏎

Go to active search result

Search tricks

                Prefix searches with a type followed by a colon (e.g.
                fn:) to restrict the search to a given type.

                Accepted types are: fn, mod,
                struct, enum,
                trait, typedef (or
                tdef).


text:
FROM rauliu/ubuntu-base
MAINTAINER Raul Liu "https://github.com/rauliu"

# Update sources
RUN apt-get update -y

# install http
RUN apt-get install -y apache2 vim bash-completion unzip
RUN mkdir -p /var/lock/apache2 /var/run/apache2

# install mysql
#RUN apt-get install -y mysql-client mysql-server

# install php
RUN apt-get install -y php5 php5-mysql php5-dev php5-gd php5-memcache php5-pspell php5-snmp snmp php5-xmlrpc libapache2-mod-php5 php5-cli

#Set up sendmail for PHP
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list
RUN apt-get -q -y update
RUN apt-get install -q -y msmtp ca-certificates

RUN touch /etc/msmtprc
RUN mkdir -p /var/log/msmtp
RUN chown www-data:adm /var/log/msmtp
RUN touch /etc/logrotate.d/msmtp
RUN rm /etc/logrotate.d/msmtp
RUN echo "/var/log/msmtp/*.log {\n rotate 12\n monthly\n compress\n missingok\n notifempty\n }" > /etc/logrotate.d/msmtp
RUN sed -i 's/;sendmail_path\s=.*/sendmail_path = \/usr\/bin\/msmtp -t/' /etc/php5/apache2/php.ini

ADD phpinfo.php /var/www/html/

ADD apache.conf /etc/supervisor/conf.d/

ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2

EXPOSE 22 80 443


text:
package com.animatedspriteexample;

import com.facebook.react.ReactActivity;

public class MainActivity extends ReactActivity {

    /**
     * Returns the name of the main component registered from JavaScript.
     * This is used to schedule rendering of the component.
     */
    @Override
    protected String getMainComponentName() {
        return "AnimatedSpriteExample";
    }
}


text:
<!--[if lt IE 9]>
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<![endif]-->
<!--[if gte IE 9]><!-->
  <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js">
  </script>
<!--<![endif]-->
<script>
  window.jQuery || document.write(
    '<script src="/third_party/static/jquery-2.1.1/jquery.min.js">\x3C/script>');
</script>

<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script>
  window.jQuery.ui || document.write(
    '<script src="/third_party/static/jqueryui-1.10.3/jquery-ui.min.js">\x3C/script>');
</script>

<script src="/third_party/static/bootstrap-3.1.1/js/bootstrap.min.js"></script>

{% if DEV_MODE %}
  <script src="/third_party/static/angularjs-1.3.13/angular.js"></script>
  <script src="/third_party/static/ui-bootstrap-0.12.0/ui-bootstrap-tpls-0.12.0.js"></script>
  <script src="/third_party/static/angularjs-1.3.13/angular-aria.js"></script>
{% else %}
  <script src="/third_party/static/angularjs-1.3.13/angular.min.js"></script>
  <script src="/third_party/static/ui-bootstrap-0.12.0/ui-bootstrap-tpls-0.12.0.min.js"></script>
  <script src="/third_party/static/angularjs-1.3.13/angular-aria.min.js"></script>
{% endif %}

<script src="/third_party/static/ng-joyride-0.1.11/ng-joyride.js"></script>
<script src="/third_party/static/select2-3.5.1/select2.js"></script>

<!-- See http://docs.mathjax.org/en/latest/start.html#mathjax-cdn -->
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    skipStartupTypeset: true,
    messageStyle: 'none',
    'HTML-CSS': {
      showMathMenu: false
    }
  });
  MathJax.Hub.Configured();
</script>
<script src="/third_party/static/MathJax-2.4-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

<script src="/third_party/static/ui-sortable-0.12.6/src/sortable.js"></script>

<script src="/third_party/static/hammer-js-2.0.4/hammer.js"></script>
<script src="/third_party/static/bower-material-0.6.0-rc1/angular-material.js"></script>

<script src="/third_party/static/ng-img-crop-0.3.2/compile/minified/ng-img-crop.js"></script>

<!-- This is used in Google Maps and for form validation. -->
<script src="/third_party/static/ui-utils-0.1.1/ui-utils.js"></script>


text:
@interface Schoolbus : ZJUBaseViewController
<UIActionSheetDelegate,
SchoolBusSearchResultViewControllerDelegate,
UITextFieldDelegate,
UIPickerViewDataSource,
UIPickerViewDelegate,
ZJUDateRequestDelegate>
{
    IBOutlet UIButton       * search;
    IBOutlet UIButton       * toButton;
    IBOutlet UIButton       * fromButton;
    IBOutlet UIButton       * changeFromTo;
    IBOutlet UIView         * rotatorView;
    IBOutlet UITextField    * busSelecterView;
    IBOutlet UIView         * flipView;
    TSLocateView            * pickerCampus;

    BOOL                      isSearchBusType;

    NSArray                 * _cachedBusInfo;
    NSArray                 * _buses;
}
@property (nonatomic, readonly) NSArray *cachedBusInfo;
@property (nonatomic, readonly) NSArray *buses;

-(IBAction)fromWhere:(id)sender;
-(IBAction)toWhere:(id)sender;
-(IBAction)changeForFromto:(id)sender;
-(IBAction)searchBus:(id)sender;

-(IBAction)swipeUp:(id)sender;
-(IBAction)swipeDown:(id)sender;

-(IBAction)hideInputView:(id)sender;

@end


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.karaf.itests;

import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.hasKey;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;

import java.lang.management.ManagementFactory;
import java.util.List;
import java.util.Map;

import javax.management.MBeanServer;
import javax.management.ObjectName;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerClass;

@RunWith(PaxExam.class)
@ExamReactorStrategy(PerClass.class)
public class ConfigTest extends KarafTestSupport {

    @Test
    public void listCommand() throws Exception {
        String configListOutput = executeCommand("config:list");
        System.out.println(configListOutput);
        assertFalse(configListOutput.isEmpty());
        configListOutput = executeCommand("config:list \"(service.pid=org.apache.karaf.features)\"");
        System.out.println(configListOutput);
        assertFalse(configListOutput.isEmpty());
    }

    @Test
    public void listShortCommand() throws Exception {
        String configListOutput = executeCommand("config:list -s");
        System.out.println(configListOutput);
        assertFalse(configListOutput.isEmpty());
        assertContains("org.apache.karaf.jaas\norg.apache.karaf.kar\n", configListOutput);
    }

    @SuppressWarnings("unchecked")
    @Test
    public void configsViaMBean() throws Exception {
        MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();
        ObjectName name = new ObjectName("org.apache.karaf:type=config,name=root");
        List<String> configs = (List<String>) mbeanServer.getAttribute(name, "Configs");
        assertThat(configs, hasItem("org.apache.karaf.features"));
        Map<String, String> properties = (Map<String, String>) mbeanServer
            .invoke(name, "listProperties", new Object[]{"org.apache.karaf.features"}, new String[]{"java.lang.String"});
        assertThat(properties, hasKey("featuresRepositories"));
    }

}


text:
namespace MultiLanguage
{
    using System;
    using System.Runtime.InteropServices;
    using System.Security;

    [StructLayout(LayoutKind.Sequential, Pack=4)]
    public struct tagSCRIPTINFO
    {
        public byte ScriptId;
        public uint uiCodePage;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst=0x30)]
        public ushort[] wszDescription;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst=0x20)]
        public ushort[] wszFixedWidthFont;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst=0x20)]
        public ushort[] wszProportionalFont;
    }
}


text:
var express = require('express');
var router = express.Router();

var Image = require('../server/models/image');

// define the home page route
router.get('/', function(req, res) {
    Image.find({}, function (err, images) {
        if(err) console.log('Err: ', err);
        res.json(images);
    });
});

router.get('/currentuser/', function(req, res) {
    var username = req.user.twitter.username;

    Image.find({'username': username},function(err, images) {
        if(err) console.log('Err: ', err);
        res.json(images);
    });
});

router.delete('/:id', function(req, res) {
    var id = req.params.id;

    Image.remove({'_id': id},function(result) {
        res.json(result);
    });
});

router.post('/', function(req, res) {
    // Create a new image

    var image = new Image({
      text: req.body.text,
      imgUrl: req.body.imgUrl,
      username: req.body.username,
      userIcon: req.body.userIcon,
      favoriteCount: req.body.favoriteCount
    });

    image.save(function (err, image) {
      if (err) {
        console.log('error saving image: ', err);
      }
      res.status(201).json(image);
    });

});

router.get('/:id', function(req, res) {
    var id = req.params.id;

    Image.findOne({'_id':id},function(err, result) {
        if(err) console.log('Err: ', err);
        return res.send(result);
    });
});

// toggle-favorite will look for the id of the image passed. If it already exists in the favorites array, it will remove it, otherwise it will add it
router.put('/user-favorited/:imageId', function(req, res) {
    var imageId = req.params.imageId;

    if(!req.user) {
        //console.log("NO USER DETECTED. Cannot favorite an image without logging in.");
        return;
    }

    var userId = req.user._id;

    //console.log("User ID: ", userId);
    //console.log("Will see if userId is in this images favorites array. If not, will add it. If so, will remove it. Just toggles the favorites existence.");

    Image.findOne({'_id':imageId},function(err, image) {
        if(err) console.log('Err: ', err);

        //console.log("Image BEFORE: ", image);

        if(image.favorites) {
            //console.log("Favorites array exists... look for this user id in array. If found they've already favorited it before. User id: ", userId);

            var currentFavs = image.favorites;

            //console.log("Current favs: ", currentFavs);

            var locationOfThisElement = currentFavs.indexOf(userId);
            //console.log("Index of: ", locationOfThisElement);

            if(locationOfThisElement !== -1) {
               // console.log("This user has already favorited this image. They are now unfavoriting it, so remove from array");
                currentFavs.splice(locationOfThisElement, 1);
            } else {
                //console.log("User has not yet favorited this image, add to the array");
                currentFavs.push(userId);
            }

            image.favorites = currentFavs;
            image.favoriteCount = currentFavs.length;

            delete image._id;

            //console.log("New image object: ", image);

            Image.update({_id: imageId}, image, {upsert: true}, function (err, image) {
                if(err) console.log('Err: ', err);
            });

        }

        return res.send(image);
    });
});

module.exports = router;


text:
namespace osrm
{
namespace customizer
{

struct EdgeBasedGraphEdgeData
{
    NodeID turn_id; // ID of the edge based node (node based edge)
};

template <typename EdgeDataT, storage::Ownership Ownership> class MultiLevelGraph;

namespace serialization
{
template <typename EdgeDataT, storage::Ownership Ownership>
void read(storage::tar::FileReader &reader,
          const std::string &name,
          MultiLevelGraph<EdgeDataT, Ownership> &graph);

template <typename EdgeDataT, storage::Ownership Ownership>
void write(storage::tar::FileWriter &writer,
           const std::string &name,
           const MultiLevelGraph<EdgeDataT, Ownership> &graph);
} // namespace serialization

template <typename EdgeDataT, storage::Ownership Ownership>
class MultiLevelGraph : public partitioner::MultiLevelGraph<EdgeDataT, Ownership>
{
  private:
    using SuperT = partitioner::MultiLevelGraph<EdgeDataT, Ownership>;
    using PartitionerGraphT = partitioner::MultiLevelGraph<partitioner::EdgeBasedGraphEdgeData,
                                                           storage::Ownership::Container>;
    template <typename T> using Vector = util::ViewOrVector<T, Ownership>;

  public:
    using NodeArrayEntry = typename SuperT::NodeArrayEntry;
    using EdgeArrayEntry = typename SuperT::EdgeArrayEntry;
    using EdgeOffset = typename SuperT::EdgeOffset;

    MultiLevelGraph() = default;
    MultiLevelGraph(MultiLevelGraph &&) = default;
    MultiLevelGraph(const MultiLevelGraph &) = default;
    MultiLevelGraph &operator=(MultiLevelGraph &&) = default;
    MultiLevelGraph &operator=(const MultiLevelGraph &) = default;

    MultiLevelGraph(PartitionerGraphT &&graph,
                    Vector<EdgeWeight> node_weights_,
                    Vector<EdgeDuration> node_durations_,
                    Vector<EdgeDistance> node_distances_)
        : node_weights(std::move(node_weights_)), node_durations(std::move(node_durations_)),
          node_distances(std::move(node_distances_))
    {
        util::ViewOrVector<PartitionerGraphT::EdgeArrayEntry, storage::Ownership::Container>
            original_edge_array;

        std::tie(SuperT::node_array,
                 original_edge_array,
                 SuperT::node_to_edge_offset,
                 SuperT::connectivity_checksum) = std::move(graph).data();

        SuperT::edge_array.reserve(original_edge_array.size());
        for (const auto &edge : original_edge_array)
        {
            SuperT::edge_array.push_back({edge.target, {edge.data.turn_id}});
            is_forward_edge.push_back(edge.data.forward);
            is_backward_edge.push_back(edge.data.backward);
        }
    }

    MultiLevelGraph(Vector<NodeArrayEntry> node_array_,
                    Vector<EdgeArrayEntry> edge_array_,
                    Vector<EdgeOffset> node_to_edge_offset_,
                    Vector<EdgeWeight> node_weights_,
                    Vector<EdgeDuration> node_durations_,
                    Vector<EdgeDistance> node_distances_,
                    Vector<bool> is_forward_edge_,
                    Vector<bool> is_backward_edge_)
        : SuperT(std::move(node_array_), std::move(edge_array_), std::move(node_to_edge_offset_)),
          node_weights(std::move(node_weights_)), node_durations(std::move(node_durations_)),
          node_distances(std::move(node_distances_)), is_forward_edge(is_forward_edge_),
          is_backward_edge(is_backward_edge_)
    {
    }

    EdgeWeight GetNodeWeight(NodeID node) const { return node_weights[node]; }

    EdgeWeight GetNodeDuration(NodeID node) const { return node_durations[node]; }

    EdgeDistance GetNodeDistance(NodeID node) const { return node_distances[node]; }

    bool IsForwardEdge(EdgeID edge) const { return is_forward_edge[edge]; }

    bool IsBackwardEdge(EdgeID edge) const { return is_backward_edge[edge]; }

    friend void
    serialization::read<EdgeDataT, Ownership>(storage::tar::FileReader &reader,
                                              const std::string &name,
                                              MultiLevelGraph<EdgeDataT, Ownership> &graph);
    friend void
    serialization::write<EdgeDataT, Ownership>(storage::tar::FileWriter &writer,
                                               const std::string &name,
                                               const MultiLevelGraph<EdgeDataT, Ownership> &graph);

  protected:
    Vector<EdgeWeight> node_weights;
    Vector<EdgeDuration> node_durations;
    Vector<EdgeDistance> node_distances;
    Vector<bool> is_forward_edge;
    Vector<bool> is_backward_edge;
};

using MultiLevelEdgeBasedGraph =
    MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>;
using MultiLevelEdgeBasedGraphView =
    MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>;
} // namespace customizer
} // namespace osrm

#endif


text:
require 'spec_helper'
Awspec::Stub.load 'rds_db_cluster_parameter_group'

describe rds_db_cluster_parameter_group('my-rds-db-cluster-parameter-group') do
  it { should exist }
  its(:time_zone) { should eq 'US/Central' }
  its(:binlog_format) { should eq 'ROW' }
  its(:character_set_server) { should eq 'utf8mb4' }
end


text:
#ifndef _MSC_VER
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#endif

#include "Context/Context.h"
#include "Transport/LowLevel/EventThread.h"
#include "Transport/LowLevel/Listener.h"
#include "Transport/LowLevel/Socket.h"
#include "Transport/LowLevel/ListenerThread.h"

#include "Transport/Connection/AcceptedConnections.h" /* TODO - circular dependency :( */
#include "Transport/Connection/ConnectionTestHook.h"

#include "debug_helper.h"

static void connection_shutdown_hook(amqp_context_t *context, amqp_event_loop_t *loop, amqp_accept_handler_arguments_t *accept_handler_arguments)
{
    if (accept_handler_arguments && accept_handler_arguments->connections)
    {
        amqp_connections_shutdown_hook(context, loop, accept_handler_arguments->connections);
    }
}

static void listener_thread_handler(amqp_event_thread_t *event_thread)
{
    struct amqp_listener_thread_t *listener_thread = (struct amqp_listener_thread_t *) event_thread->thread_arguments;

    amqp_io_event_watcher_t *accept_watcher = amqp_listener_initialize(event_thread->context, event_thread->loop, listener_thread->port_number, listener_thread->accept_handler, listener_thread->accept_handler_arguments);

    amqp_event_thread_run_loop_with_shutdown_hook(event_thread, connection_shutdown_hook, listener_thread->accept_handler_arguments);

    amqp_listener_destroy(event_thread->context, accept_watcher);
}

amqp_listener_thread_t *amqp_listener_thread_initialize(amqp_context_t *context, amqp_event_loop_t *loop, int listen_port_number, amqp_accept_event_handle_t accept_handler, const char *context_name, amqp_accept_handler_arguments_t *accept_handler_arguments)
{
    amqp_listener_thread_t *result = AMQP_MALLOC(context, amqp_listener_thread_t);
    result->port_number = listen_port_number;
    result->accept_handler = accept_handler;
    result->context_name = context_name;
    result->accept_handler_arguments = accept_handler_arguments;

    result->thread =  amqp_event_thread_initialize(context, listener_thread_handler, loop, result, context_name);
    return result;
}

void amqp_listener_thread_destroy(amqp_context_t *context, amqp_listener_thread_t *listener_thread)
{
    if (listener_thread)
    {
        amqp_event_thread_destroy(context, listener_thread->thread);
        AMQP_FREE(context, listener_thread);
    }
}


text:
angular.module('main.module')
        .directive('launchSshPane', ['$log', 'core-rest.service', 'alert.service',
          function ($log, coreService, alertService) {
            return{
              restrict: 'E',
              require: "^launchTabs",
              scope: {
                title: '@',
                mapKey: '@',
                credentialsHolderMap: '='
              },
              link: function (scope, elem, attrs, tabsCtrl) {

                function _initScope(scp) {
                  tabsCtrl.addPane(scp);
                  scp.bootUp = true;
                  scp.sshKeyPair = {
                    pubKeyPath: null,
                    privKeyPath: null,
                    passphrase: null
                  };
                  scp.availableStates = {
                    success: 'success',
                    failure: 'failure',
                    passwordNeeded: 'passwordNeeded',
                    initialWarn: 'initialWarn',
                    sudoWarn: 'sudoWarn'
                    , userWarn: 'userWarn'
                  };
                  scp.stateMessage = {
                    success: 'Valid SSH Key Pair',
                    passwordNeeded: 'Enter passphrase for SSH Key Pair',
                    failure: 'Unable to generate valid SSH Key Pair',
                    initialWarn: 'Enter SSH Key Pair Paths (and password). Then click Validate.',
                    sudoWarn: 'Enter the sudo account password. Then click Validate.',
                    userWarn: 'Please generate a new one, instead of manual changing.'
                  };
                  scp.sudoAccount = {
                    password: null
                  };
                  scp.repeatSshPwd = "";
                  scp.currentState = scp.availableStates.initialWarn;
                  scp.sshKeyObj = scp.credentialsHolderMap[scp.mapKey];
                  scp.needsPassword = true;
                  scp.repeatSudoPassword = "";
                  scp.hasEc2 = scp.credentialsHolderMap["ec2"] === undefined ? false : true;
                  scp.hasGce = scp.credentialsHolderMap["gce"] === undefined ? false : true;
                  scp.hasOcci = scp.credentialsHolderMap["occi"] === undefined ? false : true;
                  scp.hasNova = scp.credentialsHolderMap["nova"] === undefined ? false : true;
                  scp.isBaremetal = !(scp.hasEc2 || scp.hasGce || scp.hasOcci || scp.hasNova)
                }

                function _updateState(result, credentialObj) {

                  if (result === 'success') {
                    credentialObj.setIsValid(true);
                    scope.currentState = scope.availableStates.success;
                  } else if (result === 'passwordNeeded') {
                    credentialObj.setIsValid(false);
                    scope.currentState = scope.availableStates.passwordNeeded;
                  } else if (result === 'failure') {
                    credentialObj.setIsValid(false);
                    scope.currentState = scope.availableStates.failure;
                  } else if (result === 'initialWarn') {
                    credentialObj.setIsValid(false);
                    scope.currentState = scope.availableStates.initialWarn;
                  } else if (result === 'userWarn') {
                    credentialObj.setIsValid(false);
                    scope.currentState = scope.availableStates.userWarn;
                  }

                }

                scope.baremetal = function () {
                  return scope.isBaremetal;
                };

                scope.warnUser = function () {
                  _updateState('userWarn', scope.sshKeyObj);
                };

                scope.usingSudoPassword = function () {
                  return sudoAccount === null;
                };

                scope.$watch('selected', function () {

                  if (scope.selected) {
                    $log.info('ssh-key-pane selected');

                    if (scope.bootUp) {
                      $log.info("ssh - first time try.");
                      coreService.loadSshKeys(scope.sshKeyPair.passphrase)
                              .success(function (data) {
                                $log.info("ssh data is:" + data.publicKeyPath + "," + data.privateKeyPath);
                                scope.sshKeyPair.pubKeyPath = data.publicKeyPath;
                                scope.sshKeyPair.privKeyPath = data.privateKeyPath;
                                if (data.passphrase !== null) {
                                  scope.sshKeyPair.passphrase = data.passphrase;
                                  scope.repeatSshPwd = data.passphrase;
                                }
                                scope.needsPassword = data.needsPassword;
                                if (scope.needsPassword === true &&
                                        (scope.sshKeyPair.passphrase === null ||
                                                scope.sshKeyPair.passphrase.length < 2)) {
                                  _updateState('initialWarn', scope.sshKeyObj);
                                } else {
                                  _updateState('success', scope.sshKeyObj);
                                }
                              })
                              .error(function (data) {
                                $log.warn("No default ssh key available");
                                _updateState('initialWarn', scope.sshKeyObj);
                                alertService.addAlert({type: 'danger', msg: data.reason});
                              });
                      scope.bootUp = false;
                    } else {
                      $log.info("Won't try now.");
                    }
                  }
                });

                scope.generateKeys = function () {
                  coreService.generateSshKeys()
                          .success(function (data) {
                            $log.info("ssh data is:" + data.publicKeyPath + "," + data.privateKeyPath);
                            scope.sshKeyPair.pubKeyPath = data.publicKeyPath;
                            scope.sshKeyPair.privKeyPath = data.privateKeyPath;
                            scope.sshKeyPair.passphrase = data.passphrase;
                            scope.repeatSshPwd = data.passphrase;
                            _updateState('success', scope.sshKeyObj);
                          })
                          .error(function (data) {
                            $log.warn("Couldn't generate ssh-keys");
                            _updateState('failure', scope.sshKeyObj);
                            alertService.addAlert({type: 'danger', msg: data.reason});
                          });
                };

                scope.setRepeatSshpassphrase = function (inputTxt) {
                  scope.repeatSshPwd = inputTxt;
                  scope.matchSshKeyPasswords();
                };
                scope.matchSshKeyPasswords = function () {
                  if (scope.needsPassword) {
                    if (scope.sshKeyPair.passphrase === null || scope.sshKeyPair.passphrase === "") {
                      scope.currentState = scope.availableStates.success;
                      return true;
                    }
                    if (scope.repeatSshPwd !== scope.sshKeyPair.passphrase) {
                      scope.currentState = scope.availableStates.passwordNeeded;
                      return false;
                    }
                  }
                  scope.registerKeys();
                  return true;
                };

                scope.registerKeys = function () {
                    coreService.registerSshKeys(scope.sshKeyPair)
                            .success(function (data) {
                              $log.info("ssh data is:" + data.publicKeyPath + "," + data.privateKeyPath);
                              scope.sshKeyPair.pubKeyPath = data.publicKeyPath;
                              scope.sshKeyPair.privKeyPath = data.privateKeyPath;
                              _updateState('success', scope.sshKeyObj);
                            })
                            .error(function (data) {
                              $log.info("Couldn't register ssh-keys yet");
                              _updateState('userWarn', scope.sshKeyObj);
                            });
                };

                scope.sudoChange = function () {
                  if (scope.usingSudoPasswd) {
                    if (!scope.matchSudoPasswords()) {
                      _updateState('sudoWarn', scope.sshKeyObj);
                    } else {
                      _updateState('success', scope.sshKeyObj);
                    }
                  } else {
                    scope.repeatSudoPassword = "";
                    scope.sudoAccount.password = "";
                    scope.registerSudoPassword();
                  }
                };

                scope.setRepeatSudoPassword = function (inputTxt) {
                  scope.repeatSudoPassword = inputTxt;
                  scope.matchSudoPasswords();
                };

                scope.matchSudoPasswords = function () {
                  if (scope.usingSudoPasswd) {
                    if (scope.sudoAccount.password === null || scope.sudoAccount.password === "") {
                      scope.currentState = scope.availableStates.sudoWarn;
                      return false;
                    }
                    if (scope.repeatSudoPassword !== scope.sudoAccount.password) {
                      scope.currentState = scope.availableStates.sudoWarn;
                      return false;
                    }
                  }
                  scope.registerSudoPassword();
                  return true;
                };

                scope.registerSudoPassword = function () {

                  if (scope.repeatSudoPassword !== scope.sudoAccount.password) {
                    return;
                  }

                  coreService.sudoPassword(scope.sudoAccount)
                          .success(function (data) {
                            _updateState('success', scope.sshKeyObj);
                          })
                          .error(function (data) {
                            $log.warn("Couldn't register sudo account password");
                            _updateState('failure', scope.sshKeyObj);
                          });
                };

                _initScope(scope);
              },
              templateUrl: 'karamel/board/launch/ssh-pane.html'
            }
          }]);


text:
package com.tqmars.cardrecycle.application.User.dto;

import java.sql.Timestamp;

/**
 * Created by jjh on 2/4/17.
 */
public class LoginOutput {
    private Integer id;
    private String token;
    private String name;
    private String account;
    private String tel;
    private String qq;
    private String businessId;
    private Timestamp lastLoginTime;
    private int status;

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Timestamp getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Timestamp lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public Integer getId() {
        return id;
    }

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

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getName() {
        return name;
    }

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

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public String getBusinessId() {
        return businessId;
    }

    public void setBusinessId(String businessId) {
        this.businessId = businessId;
    }

    @Override
    public String toString() {
        return "LoginOutput{" +
                "id=" + id +
                ", token='" + token + '\'' +
                ", name='" + name + '\'' +
                ", account='" + account + '\'' +
                ", tel='" + tel + '\'' +
                ", qq='" + qq + '\'' +
                ", businessId='" + businessId + '\'' +
                ", lastLoginTime=" + lastLoginTime +
                '}';
    }

    public boolean isEnabled(){
        return this.status == 1 ? true : false;
    }
}


text:
package com.foc.business.workflow;

import java.sql.Date;

import com.foc.admin.FocUser;
import com.foc.business.workflow.map.WFStage;
import com.foc.desc.FocConstructor;
import com.foc.desc.FocObject;

@SuppressWarnings("serial")
public class WFHorizontalLog extends FocObject{

	public WFHorizontalLog(FocConstructor constr) {
		super(constr);
		newFocProperties();
	}

	public FocObject getTransaction(){
		return getPropertyObject(WFHorizontalLogDesc.FLD_TRANSACTION);
	}

	public void setTransaction(FocObject transaction){
		setPropertyObject(WFHorizontalLogDesc.FLD_TRANSACTION, transaction);
	}

	public void setUserAt(FocUser user, int i){
		setPropertyObject(WFHorizontalLogDesc.FLD_USER+i, user);
	}

	public FocUser getUserAt(int i){
		return (FocUser) getPropertyObject(WFHorizontalLogDesc.FLD_USER+i);
	}

	public Date getDateTimeAt(int i){
		return getPropertyDate(WFHorizontalLogDesc.FLD_DATE_TIME+i);
	}

	public void setDateTimeAt(Date date, int i){
		setPropertyDate(WFHorizontalLogDesc.FLD_DATE_TIME+i, date);
	}

	public void setCommentAt(String reason, int i){
		setPropertyString(WFHorizontalLogDesc.FLD_COMMENT+i, reason);
	}

	public String getCommentAt(int i){
		return getPropertyString(WFHorizontalLogDesc.FLD_COMMENT+i);
	}

	public void setTitleAt(String reason, int i){
		setPropertyString(WFHorizontalLogDesc.FLD_TITLE+i, reason);
	}

	public String getTitleAt(int i){
		return getPropertyString(WFHorizontalLogDesc.FLD_TITLE+i);
	}

	public void setStageAt(WFStage stage, int i){
		setPropertyObject(WFHorizontalLogDesc.FLD_STAGE+i, stage);
	}

	public WFStage getStageAt(int i){
		return (WFStage) getPropertyObject(WFHorizontalLogDesc.FLD_STAGE+i);
	}

	public int getWFLogRefAt(int i){
		return getPropertyInteger(WFHorizontalLogDesc.FLD_WF_LOG+i);
	}

	public void setWFLogRefAt(int logInt, int i){
		setPropertyInteger(WFHorizontalLogDesc.FLD_WF_LOG+i, logInt);
	}
}


text:
'''
Created on Oct 19, 2015

@author: wirkert
'''
import unittest

import numpy as np
import mc.camera as cam

class TestCamera(unittest.TestCase):

    def setUp(self):
        # setup a imaging system that does almost nothing
        # (camera with 8 bands, each the same
        # and just taking all the wavelengths into account equally).
        # The light source is completely homogeneous w.r.t. wavelength
        self.nr_bands = 8
        self.nr_wavelengths = 200
        wavelengths = np.linspace(400, 700, self.nr_wavelengths) * 10**-9  # nm
        filters = np.ones((self.nr_bands, self.nr_wavelengths))
        self.imaging_system = cam.ImagingSystem(wavelengths=wavelengths,
                                                F=filters)

    def test_reflectance_transform(self):
        reflectance = 0.5 * np.ones(self.nr_wavelengths)
        # we expect a normalized result with all values equal.
        expected_measurement = np.ones(self.nr_bands) / self.nr_bands
        calc_cam_measurement = cam.transform_reflectance(self.imaging_system,
                                                         reflectance)
        np.testing.assert_almost_equal(np.squeeze(calc_cam_measurement),
                                       np.squeeze(expected_measurement),
                                       err_msg="test if " +
                                               "camera measurement is " +
                                               "correctly calculated from " +
                                               "given reflectance")

    def test_spectrometer_transform(self):
        # measurement made by a spectrometer:
        spectrometer = 0.5 * np.ones(self.nr_wavelengths)
        # we expect a normalized result with all values equal.
        expected_measurement = np.ones(self.nr_bands) / self.nr_bands
        calc_cam_measurement = cam.transform_color(self.imaging_system,
                                                         spectrometer)
        np.testing.assert_almost_equal(np.squeeze(calc_cam_measurement),
                                       np.squeeze(expected_measurement),
                                       err_msg="test if " +
                                               "camera measurement is " +
                                               "correctly calculated from " +
                                               "given spectrometer measurement")

    def test_difference_transformations(self):
        # first set a non uniform lighting
        self.imaging_system.w = _n_random_numbers(self.nr_wavelengths)
        # also, let one filter differ from the rest
        self.imaging_system.F[0, :] = _n_random_numbers(self.nr_wavelengths)
        measurement = 0.5 * np.ones(self.nr_wavelengths)

        r_transformed = cam.transform_color(self.imaging_system, measurement)
        s_transformed = cam.transform_reflectance(self. imaging_system, measurement)

        # the two vectors should be different because one transformation is
        # taking lighting into account and the other one is not.
        self.assertFalse(r_transformed[0] == s_transformed[0], "test if " +
                         "color and reflectance transformations differ")

def _n_random_numbers(n):
    return np.array([np.random.uniform(0.1, 1) for _ in xrange(n)])

if __name__ == "__main__":
    # import sys;sys.argv = ['', 'Test.testName']
    unittest.main()


text:
/* global define, require, Handlebars, Backbone, Marionette, $, _, Localizer */

define([
    'comindware/core',
    'text!../templates/indexPage.html'
], function (core, template) {
    'use strict';
    return Marionette.ItemView.extend({
        className: "demo-welcome",

        template: Handlebars.compile(template)
    });
});


text:
MIME-Version: 1.0
Server: CERN/3.0
Date: Sunday, 24-Nov-96 21:25:01 GMT
Content-Type: text/html
Content-Length: 3704
Last-Modified: Thursday, 02-May-96 14:56:37 GMT

<TITLE> SYMPOSIUM ON TEACHING LOGIC</TITLE>

            Announcement and Call for Papers

                 DIMACS Symposium on

              TEACHING LOGIC AND REASONING

                  IN AN ILLOGICAL WORLD

          Rutgers University   25-26 July 1996

  Sponsored by the DIMACS Special Year on Logic and Algorithms

           and the Association for Symbolic Logic

      in conjunction with the Federated Logic Conference.

     Hosted by Rutgers, The State University of New Jersey

Logic and logical thinking are central to all disciplines and are
critical in the mathematical and computer sciences.  This symposium
will explore the teaching of introductory logic and logical thinking,
with a primary focus on the college level and a secondary focus on
the high school level.  The symposium will be interdisciplinary,
emphasizing and contrasting approaches used in mathematics, computer
science, natural sciences, and engineering.

The symposium seeks a sharing of ideas, rather than consensus, on how
to teach logic, so that all participants gain an appreciation for the
fundamental issues and ultimately are better able to motivate the
importance of logic and to convey the foundations of logical reasoning
to students.  Topics of interest include, but are not limited to:

Pedagogical Approaches
  Cognitive Models of Logical Reasoning

Empirical Studies
  Exemplary Course Material

Innovative Approaches
  Courseware for Teaching Logic

Submit an extended abstract (maximum of 4 pages) by 1 April 1996.
Submissions in postscript form are preferred; email them to
lmc@cs.cornell.edu.  Mail paper submissions to: David Gries, Computer
Science, Upson Hall, Cornell University, Ithaca, NY 14853 USA.

Notification of acceptance: 1 May 1.  Camera ready and electronic
paper versions due: 1 July.  Accepted papers will be published in a
locally available proceedings and on the World Wide Web.

                     Organizers

Susanna Epp (DePaul University),	 epp@condor.depaul.edu

David Gries (Cornell University),	  gries@cs.cornell.edu

Peter Henderson (SUNY Stony Brook),	pbh@cs.sunysb.edu

Ann Yasuhara (Rutgers University),	 yasuhara@cs.rutgers.edu

For further information, contact Peter Henderson, Department of
Computer Science, SUNY Stony Brook, Stony Brook, N.Y. 11794-4400 USA.
(516) 632-8463, pbh@cs.sunysb.edu.

The symposium will be held prior to the Federated Logic Conference
(FLoC), hosted by DIMACS as part of its Special Year on Logic and
Algorithms.  FLoC includes the following conferences:

IEEE Symp. on Logic in Computer Science (LICS)	   27-30 July

Rewriting Techniques and Applications (RTA)	  27-30 July

Conference on Automated Deduction (CADE) workshops	    30 July

Conference on Automated Deduction (CADE)	  31 July - 3 August

Computer-Aided Verification (CAV) 	    31 July - 3 August

For further information, see the FLoC home page at
http://www.research.att.com/lics/floc/.  Information about the Special
Year can be found in http://dimacs.rutgers.edu/.


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

  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Finds position of last occurrence of a string within another, case insensitive</title>

mb_strrichr

mb_strrpos

Multibyte String Functions

PHP Manual

mb_strripos

(PHP 5 >= 5.2.0)

mb_strripos — Finds position of last occurrence of a string within another, case insensitive

Description

   int mb_strripos
    ( string $haystack
   , string $needle
   [, int $offset = 0
   [, string $encoding = mb_internal_encoding()
  ]] )

   mb_strripos() performs multi-byte safe
   strripos() operation based on
   number of characters. needle position is
   counted from the beginning of
   haystack. First character's position is
   0. Second character position is 1.
   Unlike mb_strrpos(),
   mb_strripos() is case-insensitive.

Parameters

haystack

       The string from which to get the position of the last occurrence
       of needle

needle

       The string to find in haystack

offset

       The position in haystack
       to start searching

encoding

       Character encoding name to use.
       If it is omitted, internal character encoding is used.

Return Values

   Return the numeric position of
   the last occurrence of needle in the
   haystack string, or FALSE
   if needle is not found.

See Also

strripos() - Find the position of the last occurrence of a case-insensitive substring in a string

strrpos() - Find the position of the last occurrence of a substring in a string

mb_strrpos() - Find position of last occurrence of a string in a string

mb_strrichr

mb_strrpos

Multibyte String Functions

PHP Manual


text:
$(document).ready(function() {
    $("#content").find("[id^='tab']").hide(); // Hide all content
    $("#tabs li:first").attr("id","current"); // Activate the first tab
    $("#content #tab1").fadeIn(); // Show first tab's content

    $('#tabs a').click(function(e) {
        e.preventDefault();
        if ($(this).closest("li").attr("id") == "current"){ //detection for current tab
         return;
        }
        else{
          $("#content").find("[id^='tab']").hide(); // Hide all content
          $("#tabs li").attr("id",""); //Reset id's
          $(this).parent().attr("id","current"); // Activate this
          $('#' + $(this).attr('name')).fadeIn(); // Show content for the current tab
        }
    });
});

$(function() {
  $("#datepicker").datepicker({
      minDate : 0,
      dateFormat: 'yy-mm-dd'
  });

});


text:
package net.venaglia.nondairy.soylang.elements.path;

import com.intellij.psi.PsiElement;
import net.venaglia.nondairy.soylang.elements.DelegateTemplateDefElement;
import org.jetbrains.annotations.NotNull;

/**
 * User: ed
 * Date: 1/23/12
 * Time: 5:20 PM
 *
 * An ElementPredicate that matches soy tags that implement
 * {@link net.venaglia.nondairy.soylang.elements.TemplateMemberElement} and have a particular template name.
 */
public class DeltemplateNamePredicate extends AbstractElementPredicate {

    private final String myDeltemplateName;

    public DeltemplateNamePredicate(@NotNull String myDeltemplateName) {
        this.myDeltemplateName = myDeltemplateName;
    }

    @Override
    public boolean test(PsiElement element) {
        if (element instanceof DelegateTemplateDefElement) {
            String name = ((DelegateTemplateDefElement)element).getTemplateName();
            return myDeltemplateName.equals(name);
        } else {
            return false;
        }
    }

    @Override
    public String toString() {
        return "[deltemplateName=" + myDeltemplateName + "]"; //NON-NLS
    }
}