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

<title>RawAvroBinding (Oracle NoSQL Database API)</title>
<meta name="date" content="2015-12-03">
<link rel="stylesheet" type="text/css" href="../../../style.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Oracle NoSQL Database
 version 12cR1.3.5.2

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

oracle.kv.avro

Interface RawAvroBinding

All Superinterfaces:

AvroBinding<RawRecord>, ValueBinding<RawRecord>

public interface RawAvroBinding
extends AvroBinding<RawRecord>

The RawAvroBinding interface has the same methods as AvroBinding, but represents values as instances of RawRecord.  A
 raw binding is created using AvroCatalog.getRawBinding().

 The trade-offs in using a RawAvroBinding, compared to other types
 of bindings, are:

The advantage of a raw binding is that it allows handling the Avro
   serialized byte array directly in the application.  In other words, it
   allows "escaping" from the built-in serialization provided by the other
   bindings in this package, when necessary. For example:

The Avro serialization and deserialization APIs may be used
     directly, when none of the built-in bindings in this package are
     appropriate.

The serialized byte array may be copied to or from another
     component or system, without deserializing it.

An application may wish to examine the schema of a value before
     deciding on which binding to use, or whether or not to deserialize the
     value.

Because it does not perform serialization, deserialization or class
   evolution, a raw binding is lower level and more difficult to use than the
   other built-in buildings.  WARNING: When using a raw binding, it is the
   user's responsibility to ensure that a Value contains valid
   serialized Avro data, before writing it to the store.

 See AvroCatalog for general information on Avro bindings and
 schemas.  The schemas used in the examples below are described in the AvroCatalog javadoc.

 When using a RawAvroBinding, a RawRecord is used to
 represent values.  A RawRecord contains the raw Avro serialized byte
 array and its associated schema.

 The only purpose of a raw binding is to package and unpackage the Avro
 serialized data and the internal schema identifier.  These are stored
 together in the byte array of the Value object, using an internal
 format known to the binding.

 No schema is specified when calling AvroCatalog.getRawBinding(), no
 class evolution is performed by a raw binding's toObject
 method, and the binding may be used for values with any schema known to the
 store.

 The following code fragment demonstrates writing and reading a value using a
 raw binding.  The Avro APIs are used directly to perform serialization and
 deserialization.  In the example a GenericRecord is used, but other
 Avro APIs could be used as well.

 The example performs the same function as the built-in generic binding
 provided by this class, i.e., the serialization and deserialization sections
 below are equivalent what the built-in generic binding already provides.  An
 application would normally use a raw binding along with custom serialization
 done differently than shown below.

 Schema.Parser parser = new Schema.Parser();
 Schema nameSchema = parser.parse(nameSchemaText);
 Schema memberSchema = parser.parse(memberSchemaText);

 RawAvroBinding binding = avroCatalog.getRawBinding();

 // Create object
 GenericRecord name = new GenericData.Record(nameSchema)
 name.put("first", ...);
 name.put("last", ...);
 GenericRecord object = new GenericData.Record(memberSchema)
 object.put("name", name);
 object.put("age", new Integer(...));

 // Serialize using Avro APIs directly
 ByteArrayOutputStream out = new ByteArrayOutputStream();
 GenericDatumWriter<GenericRecord> writer =
     new GenericDatumWriter<GenericRecord>(object.getSchema());
 Encoder encoder = EncoderFactory.get().binaryEncoder(out, null);
 writer.write(object, encoder);
 encoder.flush();

 // Package and store
 RawRecord raw = new RawRecord(out.toByteArray(), object.getSchema());
 kvStore.put(key, binding.toValue(raw));

 // Sometime later, retrieve and unpackage
 ValueVersion vv = kvStore.get(key);
 RawRecord raw = binding.toObject(vv.getValue());

 // Deserialize using Avro APIs directly
 Decoder decoder =
     DecoderFactory.get().binaryDecoder(raw.getRawData(), null);
 GenericDatumReader<GenericRecord> reader =
     new GenericDatumReader<GenericRecord>(raw.getSchema());
 GenericRecord object = reader.read(null, decoder);

 // Use object
 GenericRecord name = (GenericRecord) object.get("name");
 Integer age = (Integer) object.get("age");
 ...

 The following code fragment demonstrates reading values and examining
 their schema using a raw binding, without performing deserialization.
 Another binding could be used to deserialize the value, if desired,
 after examining the schema.  Or, the serialized byte array could be
 copied to or from another component or system, without deserializing it.

 RawAvroBinding binding = avroCatalog.getRawBinding();

 Iterator<KeyValueVersion> iter = kvStore.multiGetIterator(...);
 for (KeyValueVersion kvv : iter) {
     RawRecord object = binding.toObject(kvv.getValue());
     Schema schema = object.getSchema();

     // Use schema to decide how to process the object...
 }

Since:

2.0

Method Summary

Methods

Modifier and Type
Method and Description

RawRecord
toObject(Value value)

After doing a read operation using a KVStore method, the user
 calls toObject with the Value obtained from the read
 operation.

Value
toValue(RawRecord object)

Before doing a write operation, the user calls toValue passing
 an object she wishes to store.

Method Detail

toObject

RawRecord toObject(Value value)
                   throws IllegalArgumentException

After doing a read operation using a KVStore method, the user
 calls toObject with the Value obtained from the read
 operation.

 This method does not perform deserialization or class evolution. It only
 unpackages the Avro serialized data and the internal schema identifier.
 These are stored together in the byte array of the Value object,
 using an internal format known to the binding.

 WARNING: When using a raw binding, it is the user's responsibility to
 ensure that a Value contains valid serialized Avro data, before
 writing it to the store.

Specified by:

toObject in interface AvroBinding<RawRecord>

Specified by:

toObject in interface ValueBinding<RawRecord>

Parameters:

value - the Value obtained from a KVStore read
 operation method..  The byte array of the Value is
 serialized Avro data, packaged in an internal format that includes a
 reference to the Avro schema

Returns:

the RawRecord instance.  The RawRecord.getSchema()
 method will return the writer schema, which is the schema that was
 specified when the value was stored.

Throws:

IllegalArgumentException - if the value format is not Value.Format.AVRO, the schema identifier embedded in the value
 parameter is invalid, or the serialized data cannot be parsed.

toValue

Value toValue(RawRecord object)
              throws UndefinedSchemaException

Before doing a write operation, the user calls toValue passing
 an object she wishes to store.  The resulting Value is then
 passed to the write operation method in KVStore.

 This method does not perform serialization. It only packages the Avro
 serialized data and the internal schema identifier.  These are stored
 together in the byte array of the Value object, using an
 internal format known to the binding.

 WARNING: When using a raw binding, it is the user's responsibility to
 ensure that a Value contains valid serialized Avro data, before
 writing it to the store.

Specified by:

toValue in interface AvroBinding<RawRecord>

Specified by:

toValue in interface ValueBinding<RawRecord>

Parameters:

object - the RawRecord instance that the user wishes to
 package as a Value.

Returns:

the serialized object..  The byte array of the Value is
 serialized Avro data, packaged in an internal format that includes a
 reference to the Avro schema

Throws:

UndefinedSchemaException - if the schema associated with the
 object parameter has not been defined using the NoSQL Database
 administration interface.  Note that when the allowed schemas for a
 binding are specified (and validate) at the time the binding is created,
 this exception is extremely unlikely and is only possible if a schema is
 mistakenly disabled after the binding is created.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Oracle NoSQL Database
 version 12cR1.3.5.2

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright (c) 2011, 2015 Oracle and/or its affiliates.  All rights reserved.


text:
import * as React from 'react'
import {
    Card, CardActions, CardMedia, CardText, CardTitle, FlatButton, RaisedButton, Toggle
} from 'material-ui'
import { Link } from 'react-router'
 // using require for TextField to be able to use the 'autoComplete' that is missing at d.ts
const TextField = require('material-ui/lib/text-field')
const Helmet = require('react-helmet')

export default class LoginRender extends React.Component<any, any> {
    constructor(props, context) {
        super(props, context)
        this.state = { rememberMe: true }
    }
    public render() {
        // http://codepen.io/zavoloklom/pen/IkaFL
        const mdTyphographyBody = {
            fontSize: '13px',
            lineHeight: '20px',
            letterSpacing: '0.1px',
            fontWeight: '300',
            color: '#212121',
            textTransform: 'inherit'
        }
        return (

                <Helmet title='Login' />
                <Card style={{maxWidth: '400px', margin: '30px auto' }}>
                    <CardMedia style={{minHeight: '150px'}}
                               overlay={
                                   <CardTitle title='Login' style={{ textAlign: 'center' }} />
                               } >

                    </CardMedia>
                    <form onSubmit={this.handleLoginSubmit.bind(this)} >
                        <CardText>
                            <TextField
                                hintText='Enter your email address'
                                floatingLabelText='Email'
                                multiLine={false}
                                fullWidth={true}
                                ref='email'
                                autoComplete='off' />
                            <TextField
                                hintText='Enter your password'
                                floatingLabelText='Password'
                                multiLine={false}
                                fullWidth={true}
                                type='password'
                                ref='password' />
                            <Toggle
                                label='Remember me'
                                toggled={this.state.rememberMe}
                                labelPosition='right'
                                style={{marginTop: '20px'}}
                                labelStyle={mdTyphographyBody}
                                onToggle={() => this.setState({rememberMe: !this.state.rememberMe})} />
                        </CardText>
                        <CardActions style={{ textAlign: 'center' }}>
                            <RaisedButton primary={true} label='Login' type='submit'/>
                            <Link to={'/sign_up'}>
                                <FlatButton label='Not a member?' href={'/sign_up'}/>
                            </Link>
                        </CardActions>
                    </form>
                </Card>

        )
    }

    private async handleLoginSubmit(evt) {
        evt.preventDefault();
        const refs: any = this.refs
        const email = refs.email && refs.email.getValue()
        const password = refs.password && refs.password.getValue()
        if (email && password) {
            const formData = new FormData();
            formData.append('email', email)
            formData.append('password', password)
            formData.append('rememberMe', this.state.rememberMe)
            try {
                const response = await fetch('/login', {
                  method: 'POST',
                  body: formData,
                  credentials: 'same-origin'
                })
                if (response.status !== 200 && response.statusText !== 'OK') {
                    throw new Error('Invalid credentials.')
                }
            } catch (e) { this.handleAuthorizationFailed(e) }
            // browserHistory.push('/')
            document.location.href = '/'

        } else { this.handleAuthorizationFailed(new Error('Invalid credentials.')) }
    }

    private handleAuthorizationFailed(error) {
        // TODO: handle validation errors
        console.error(error)
        document.location.href = '/'
    }
}

redpajama_set_name: RedPajamaGithub


text:
package scala.tools.tastytest

sealed abstract class SourceKind(val name: String)(val filter: String => Boolean = _.endsWith(name)) { self =>
  def fileOf(name: String) = name + self.name
}

object SourceKind {

  case object NoSource  extends SourceKind("")(filter = _ => false)
  case object Scala     extends SourceKind(".scala")()
  case object ScalaFail extends SourceKind("_fail.scala")()
  case object ScalaPre  extends SourceKind("_pre.scala")()
  case object Check     extends SourceKind(".check")()
  case object SkipCheck extends SourceKind(".skipcheck")()
  case object Java      extends SourceKind(".java")()

  def filterByKind(kinds: Set[SourceKind], paths: String*): Seq[String] =
    if (kinds.isEmpty) Nil
    else paths.filter(kinds.foldLeft(NoSource.filter)((filter, kind) => p => kind.filter(p) || filter(p)))
}


text:
module DirtyNestedAttributes
  # Marks association record changes with ActiveRecord::Dirty behavior
  module ChangesMarker
    include ChangedAssociations

    # catch assignment for collection association and mark changes
    def assign_nested_attributes_for_collection_association(*args)
      super
      mark_associations_changes
    end

    # catch assignment for one to one association and mark changes
    def assign_nested_attributes_for_one_to_one_association(*args)
      super
      mark_associations_changes
    end

    private

    def mark_associations_changes
      self.class.reflect_on_all_autosave_associations.each do |reflection|
        association = association(reflection.name)
        if reflection.collection?
          mark_associations_changes_for_collection_association(association)
        else
          mark_associations_changes_for_single_association(association)
        end
      end
    end

    def mark_associations_changes_for_collection_association(association)
      records_that_will_change = association.target.select { |r| record_new_or_changed_or_marked_for_destruction?(r) }
      return if records_that_will_change.size == 0
      @changed_attributes[association.reflection.name] = records_that_will_change
    end

    def mark_associations_changes_for_single_association(association)
      return if association.target.blank? || !record_new_or_changed_or_marked_for_destruction?(association.target)
      @changed_attributes[association.reflection.name] = association.target
    end

    def record_new_or_changed_or_marked_for_destruction?(record)
      record.new_record? || record.changed? || record.marked_for_destruction?
    end
  end
end


text:
copyright:
  years: 2015, 2016
lastupdated: "2016-10-27"

---

{:shortdesc: .shortdesc}
{:codeblock:.codeblock}

# Protection des ressources Node.js à l'aide de {{site.data.keyword.amashort}}
{: #protecting-resources-nodejs}

Vous pouvez utiliser le SDK serveur de {{site.data.keyword.amashort}} pour protéger les ressources dans votre appli Node.js.

## Avant de commencer
{: #before-you-begin}

* Vous devez savoir développer des applications Node.js sur {{site.data.keyword.Bluemix_notm}}. Pour plus d'informations, voir
[Création d'applications à l'aide du SDK pour Node.js](https://console.{DomainName}/docs/runtimes/nodejs/index.html#nodejs_runtime).
* Le SDK serveur de {{site.data.keyword.amashort}} nécessite que le serveur Node.js soit implémenté avec l'infrastructure `Express`. Notez
que d'autres infrastructures, telle que LoopBack, utilisent les structures `Express`. Vous pouvez utiliser le SDK serveur de
{{site.data.keyword.amashort}} avec toutes ces infrastructures. Pour plus d'informations sur l'infrastructure Express,
voir [Expressjs.com](http://expressjs.com/).

## A propos du SDK serveur
{: #about}

Le SDK serveur de {{site.data.keyword.amashort}} fournit une stratégie de passeport `MCABackendStrategy` pour son utilisation
dans les applications de back end déployées sur IBM {{site.data.keyword.Bluemix_notm}}. Pour protéger votre appli des accès non autorisés et obtenir des informations de surveillance, vous devez instrumenter votre serveur Node.js avec `MCABackendStrategy`. Le
module npm `bms-mca-token-validation-strategy` fournit la stratégie de passeport `MCABackendStrategy` et la méthode de
vérification pour valider le jeton d'accès et le jeton d'ID émis par {{site.data.keyword.amashort}}. Ce module fournit aussi automatiquement les informations de surveillance relatives aux événements de sécurité.

Le SDK serveur de {{site.data.keyword.amashort}} utilise l'infrastructure `Passport` pour mettre en oeuvre l'autorisation.  Pour plus d'informations, voir [Passportjs.org](http://passportjs.org/).

## Installation du SDK serveur
{: #protecting-resources-serversdk}

Sur une ligne de commande, ouvrez le répertoire contenant votre application Node.js set exécutez les commandes suivantes :

```
npm install -save express
npm install -save passport
npm install -save bms-mca-token-validation-strategy
```
{: codeblock}

## Protection des ressources dans Node.js
{: #protecting-resources-nodesdk}

Le fragment de code suivant illustre la manière d'utiliser `MCABackendStrategy` dans une application Express simple pour protéger les méthodes
GET du noeud final `/protected`.

```JavaScript
var express = require('express');
var passport = require('passport');
var MCABackendStrategy = require('bms-mca-token-validation-strategy').MCABackendStrategy;

passport.use(new MCABackendStrategy());

var app = express();
app.use(passport.initialize());

app.get('/protected', passport.authenticate('mca-backend-strategy', {session: false }),
    function(request, response){
		console.log("Securty context", request.securityContext)
		response.send(200, "Success!");
    }
);

app.listen(process.env.PORT);
```
{: codeblock}


text:
<?php

namespace Dez\ORM\Relation;

use Dez\ORM\Collection\ModelCollection;
use Dez\ORM\Common\Object;
use Dez\ORM\Common\SingletonTrait;
use Dez\ORM\Model\Table as TableModel;

abstract class Relation extends Object
{

    use SingletonTrait;

    /**
     * @var TableModel
     */
    protected $model = null;
    /**
     * @var string
     */
    protected $related = null;
    /**
     * @var string
     */
    protected $foreignKey = 'id';
    /**
     * @var string
     */
    protected $fromKey = 'id';
    /**
     * @var array
     */
    protected $ids = [0];

    /**
     * @var ModelCollection
     */
    protected $collection = null;

    /**
     * @param TableModel $model
     * @return $this
     */
    public function setModel(TableModel $model)
    {
        $this->model = $model;

        return $this;
    }

    /**
     * @return ModelCollection
     */
    public function get()
    {

        return $this->collection->findAll(function ($item) {
            /** @var TableModel $item */
            $modelValue = $this->fromKey == $this->model->pk()
                ? $this->model->id()
                : $this->model->get($this->fromKey);

            $relatedValue = $this->foreignKey == $item->pk()
                ? $item->id()
                : $item->get($this->foreignKey);

            return $modelValue == $relatedValue;

        });

    }

    /**
     * @param   array $ids
     * @param   TableModel $related
     * @param   string $foreignKey
     * @param $fromKey
     */
    protected function init(array $ids = [], $related, $foreignKey, $fromKey)
    {
        $this->ids = $ids;
        $this->related = $related;
        $this->foreignKey = $foreignKey;
        $this->fromKey = $fromKey;

        $this->makeRelation();
    }

    /**
     * @return mixed
     */
    abstract protected function makeRelation();

}


text:
from django.contrib import messages
from django.core.exceptions import PermissionDenied
from django.db import transaction
from django.shortcuts import render, redirect, get_object_or_404
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseForbidden
from django.forms import modelformset_factory
from .models import Organisation, OrganisationPost
from .forms import OrganisationForm, AddOrganisationForm
from django.utils.translation import ugettext as _

def organisation(request, organisation_name):
    org = get_object_or_404(Organisation, name=organisation_name)
    members = OrganisationPost.objects.filter(org=org)
    return render(request, "organisations/organisation.html", {
        'organisation': org,
        'members': members
    })

@login_required()
@transaction.atomic
def edit_organisation(request, organisation_name):
    my_organisation = Organisation.objects.get(name=organisation_name)

    # Only the leader can change a organization.
    if not my_organisation.can_edit(request.user):
        raise PermissionDenied

    if request.method == 'POST':
        form = OrganisationForm(request.POST, request.FILES, instance=my_organisation)

        if form.is_valid():
            org=form.save()
            org.modified_by=request.user
            org.save()

        return redirect(reverse("organisations:organisation", kwargs={'organisation_name': organisation_name}))
    else:
        form = OrganisationForm(instance=my_organisation)
        return render(request, "organisations/organisation_form.html",
                      {'organisation': Organisation.objects.get(name=organisation_name), "form": form})

@login_required()
@transaction.atomic
def edit_memebers(request, organisation_name):
    my_organisation = Organisation.objects.get(name=organisation_name)

    # Only the leader can change a organization.
    if not my_organisation.can_edit(request.user):
        raise PermissionDenied

    OrgPostFormSet = modelformset_factory(OrganisationPost,
                                          fields=('post', 'user', 'email'),
                                          max_num=100,
                                          extra=5,
                                          can_delete=True)

    if request.method == 'POST':
        formset = OrgPostFormSet(request.POST, queryset=OrganisationPost.objects.filter(org=my_organisation))
        if formset.is_valid():
            group = my_organisation.group
            for entry in formset.cleaned_data:
                if not entry == {}:
                    if entry['DELETE']:
                        try:
                            group.user_set.remove(entry.user)  # Delete
                        except AttributeError:  # No groups for user.
                            pass
                        entry['id'].delete()
                    else:
                        if entry['id']:
                            org_post = entry['id']  # Update
                        else:
                            org_post = OrganisationPost(org=my_organisation)  # Create
                        org_post.email = entry['email']
                        org_post.post = entry['post']
                        org_post.user = entry['user']
                        org_post.modified_by=request.user
                        org_post.save()
                        group.user_set.add(org_post.user)
            return redirect("organisations:edit organisation members", organisation_name=my_organisation.name)
        else:
            return render(request, "organisations/members.html", {
                        'organisation': my_organisation,
                        'formset': formset,
                        })

    formset = OrgPostFormSet(queryset=OrganisationPost.objects.filter(org=my_organisation))
    return render(request, "organisations/members.html", {
                        'organisation': my_organisation,
                        'formset': formset,
                        })

@login_required()
@transaction.atomic
def add_organisation(request):
    if not request.user.has_perm('organisations.add organisation'):
        raise PermissionDenied
    if request.method == 'POST':
        form = AddOrganisationForm(request.POST)
        if form.is_valid():
            org = form.save()
            org.modified_by=request.user
            org.save()
            messages.info(request, "".join([_("Organisationen:"), " {:} ", _("har skapats")]).format(
                form.cleaned_data['name']))
            form = AddOrganisationForm()
    else:
        form = AddOrganisationForm()
    return render(request, "organisations/add_org_form.html", {"form": form})


text:
Pattern: Use of `forEach` on range

Issue: -

## Description

Using the `forEach` method on ranges has a heavy performance cost. Prefer using simple `for` loops.

Benchmarks have shown that using forEach on a range can have a huge performance cost in comparison to simple for loops. Hence in most contexts a simple for loop should be used instead.

Example of **incorrect** code:

```kotlin
(1..10).forEach {
    println(it)
}
(1 until 10).forEach {
    println(it)
}
(10 downTo 1).forEach {
    println(it)
}
```

Example of **correct** code:

```kotlin
for (i in 1..10) {
    println(i)
}
```

## Further Reading

* [Detekt - ForEachOnRange](https://detekt.dev/docs/rules/performance/#foreachonrange)
* [Kotlin's hidden costs - Benchmarks](https://sites.google.com/a/athaydes.com/renato-athaydes/posts/kotlinshiddencosts-benchmarks)


text:
A [Ruby](http://ruby-lang.org) client for the [NATS messaging system](https://nats.io).

[![License MIT](https://img.shields.io/npm/l/express.svg)](http://opensource.org/licenses/MIT)
[![Build Status](https://travis-ci.org/nats-io/ruby-nats.svg)](http://travis-ci.org/nats-io/ruby-nats) [![Gem Version](https://d25lcipzij17d.cloudfront.net/badge.svg?id=rb&type=5&v=0.5.0)](https://rubygems.org/gems/nats/versions/0.5.0) [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/github/nats-io/ruby-nats)

## Supported Platforms

This gem and the client are known to work on the following Ruby platforms:

- MRI 1.9, 2.0, 2.1
- JRuby 1.6.8 (experimental)

Note: This installation installs a version of the NATS server written in Ruby that has been deprecated. Please utilize a supported server such as [gnatsd](https://github.com/apcera/gnatsd). nats-server will be removed in a future release.

## Getting Started

```bash
[sudo] gem install nats
== or ==
[sudo] rake geminstall

nats-sub foo &
nats-pub foo 'Hello World!'
```

## Basic Usage

```ruby
require "nats/client"

NATS.start do

  # Simple Subscriber
  NATS.subscribe('foo') { |msg| puts "Msg received : '#{msg}'" }

  # Simple Publisher
  NATS.publish('foo.bar.baz', 'Hello World!')

  # Unsubscribing
  sid = NATS.subscribe('bar') { |msg| puts "Msg received : '#{msg}'" }
  NATS.unsubscribe(sid)

  # Requests
  NATS.request('help') { |response| puts "Got a response: '#{response}'" }

  # Replies
  NATS.subscribe('help') { |msg, reply| NATS.publish(reply, "I'll help!") }

  # Stop using NATS.stop, exits EM loop if NATS.start started the loop
  NATS.stop

end
```

## Wildcard Subscriptions

```ruby
# "*" matches any token, at any level of the subject.
NATS.subscribe('foo.*.baz') { |msg, reply, sub| puts "Msg received on [#{sub}] : '#{msg}'" }
NATS.subscribe('foo.bar.*') { |msg, reply, sub| puts "Msg received on [#{sub}] : '#{msg}'" }
NATS.subscribe('*.bar.*')   { |msg, reply, sub| puts "Msg received on [#{sub}] : '#{msg}'" }

# ">" matches any length of the tail of a subject and can only be the last token
# E.g. 'foo.>' will match 'foo.bar', 'foo.bar.baz', 'foo.foo.bar.bax.22'
NATS.subscribe('foo.>') { |msg, reply, sub| puts "Msg received on [#{sub}] : '#{msg}'" }
```

## Queues Groups

```ruby
# All subscriptions with the same queue name will form a queue group
# Each message will be delivered to only one subscriber per queue group, queuing semantics
# You can have as many queue groups as you wish
# Normal subscribers will continue to work as expected.
NATS.subscribe(subject, :queue => 'job.workers') { |msg| puts "Received '#{msg}'" }
```

## Clustered Usage
```ruby
NATS.start(:servers => ['nats://127.0.0.1:4222', 'nats://127.0.0.1:4223'] do |c|
  puts "NATS is connected to #{c.connected_server}"
  c.on_reconnect do
    puts "Reconnected to server at #{c.connected_server}"
  end
end

opts = {
  :dont_randomize_servers => true,
  :reconnect_time_wait => 0.5,
  :max_reconnect_attempts = 10,
  :servers => ['nats://127.0.0.1:4222', 'nats://127.0.0.1:4223', 'nats://127.0.0.1:4224']
}

NATS.connect(opts) do |c|
  puts "NATS is connected!"
end

```

## Advanced Usage
```ruby
# Publish with closure, callback fires when server has processed the message
NATS.publish('foo', 'You done?') { puts 'msg processed!' }

# Timeouts for subscriptions
sid = NATS.subscribe('foo') { received += 1 }
NATS.timeout(sid, TIMEOUT_IN_SECS) { timeout_recvd = true }

# Timeout unless a certain number of messages have been received
NATS.timeout(sid, TIMEOUT_IN_SECS, :expected => 2) { timeout_recvd = true }

# Auto-unsubscribe after MAX_WANTED messages received
NATS.unsubscribe(sid, MAX_WANTED)

# Multiple connections
NATS.subscribe('test') do |msg|
    puts "received msg"
    NATS.stop
end

# Form second connection to send message on
NATS.connect { NATS.publish('test', 'Hello World!') }
```

See examples and benchmarks for more information..

## License

(The MIT License)

Copyright (c) 2010-2015 Derek Collison

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.


text:
import torch
from torch.utils.mobile_optimizer import optimize_for_mobile
from torchvision.models.detection import (
    fasterrcnn_mobilenet_v3_large_320_fpn,
    FasterRCNN_MobileNet_V3_Large_320_FPN_Weights,
)

print(torch.__version__)

model = fasterrcnn_mobilenet_v3_large_320_fpn(
    weights=FasterRCNN_MobileNet_V3_Large_320_FPN_Weights.DEFAULT,
    box_score_thresh=0.7,
    rpn_post_nms_top_n_test=100,
    rpn_score_thresh=0.4,
    rpn_pre_nms_top_n_test=150,
)

model.eval()
script_model = torch.jit.script(model)
opt_script_model = optimize_for_mobile(script_model)
opt_script_model.save("app/src/main/assets/frcnn_mnetv3.pt")


text:
""" Humans.txt generator, based on work done on Kuma.

https://github.com/mozilla/kuma/blob/master/apps/humans/models.py

More info about humans.txt here http://humanstxt.org/"""


text:
(function(window) {
	var CheatSheet = window.CheatSheet;

	function every(arr, func, arg) {
		var ret = [];
		for(var i=0, ii=arr.length; i<ii; i++) {
			ret.push(arr[i][func](arg || null));
		}
		return ret;
	}

	function isMatch(obj, keys, rx) {
		var matched = false;
		for(var i=0, ii=keys.length; i<ii && !matched; i++) {
			var key = keys[i];
			if(obj[key]) {
				matched = rx.exec(obj[key]) !== null;
			}
		}
		return matched;
	}

	CheatSheet.prototype.filter = function(term) {
		var rx = new RegExp(term, 'i');
		every(this.sections, 'filter', rx);
		this.afterFilter();
	};

	CheatSheet.prototype.unfilter = function() {
		every(this.sections, 'unfilter');
		this.afterFilter();
	};

	CheatSheet.Section.prototype.filter = function(rx) {
		var matched = isMatch(this, ['title', 'description', 'linkTitle'], rx);
		if(matched) {
			this.unfilter();
			return matched;
		}
		var visibles = every(this.items, 'filter', rx);
		while(!matched && visibles.length) {
			matched = visibles.pop();
		}
		if(matched) {
			this.show();
		} else {
			this.hide();
		}
		return matched;
	};

	CheatSheet.Section.prototype.unfilter = function() {
		every(this.items, 'unfilter');
		this.show();
	};

	CheatSheet.Item.prototype.filter = function(rx) {
		var matched = isMatch(this, ['title', 'description', 'linkTitle'], rx);
		if(!matched && this.params) {
			var params = this.params;
			for(var i=0, ii=params.length; i<ii && !matched; i++) {
				matched = isMatch(params[i], ['name', 'description'], rx);
			}
		}
		if(matched) {
			this.show();
		} else {
			this.hide();
		}
		return matched;
	};

	CheatSheet.Item.prototype.unfilter = function() {
		this.show();
	};

})(window || module.exports);


text:
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"

	>
<channel>
	<title>Comments on: 3.13. Avoiding Duplication with Templates</title>
	<atom:link href="http://www.sureassert.com/uc/guide/3-exemplars/3-13-avoiding-duplication-in-exemplars-using-the-template-property/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sureassert.com/uc</link>
	<description></description>
	<lastBuildDate>Fri, 13 Apr 2012 09:09:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.7.2</generator>
</channel>
</rss>


text:
import Vue from 'vue';

import RepositoriesIndexPage from './pages/index';
import RepositoriesShowPage from './pages/show';

$(() => {
  if (!$('body[data-controller="repositories"]').length) {
    return;
  }

  // eslint-disable-next-line no-new
  new Vue({
    el: '.vue-root',

    components: {
      RepositoriesIndexPage,
      RepositoriesShowPage,
    },
  });
});


text:
"""
This module defines constant variables used by the GUI. These variable should
never be modified by user.
Variables defining the style or theme of the GUI can be found in:
    - style.py
    - painterstyle.py
"""

import pygame.event as pygame_event
from pygame.font import get_fonts
from pygame.locals import USEREVENT, QUIT

try:
    import numpy
    HAS_NUMPY = True
except ImportError:
    HAS_NUMPY = False

try:
    import PIL
    HAS_PIL = True
except ImportError:
    HAS_PIL = False

CAN_SHADOWS = HAS_NUMPY and HAS_PIL

# fonts
AVAILABLE_FONTS = sorted(get_fonts())

# pygame events
EVENT_QUIT = pygame_event.Event(QUIT)

THORPY_EVENT = USEREVENT
# events types : these are the names of thorpy events.
# A ThorPy event has an attribute name, and the numbers below are these attributes, not pygame events!!!
# However, due to the working principle of Reactions, we follow the numbers after pygame.USEREVENT
EVENT_TIME =   1
EVENT_PRESS =   2  # posted when an element enter state pressed
# posted when sth has been inserted into an Inserter
EVENT_INSERT =   3
EVENT_SELECT =   4  # posted when sth has been selected into a DDL
# posted when mousewheel has been used on an element that handles it
EVENT_WHEEL =   5
EVENT_SLIDE =   6  # posted when a slider's dragger has been slided
EVENT_DONE =   7  # posted when a "Done" button has been clicked
EVENT_UNPRESS =   8
EVENT_HOVER =   9
EVENT_CANCEL =   10
EVENT_CHANGE_STATE =   11

# => post EVENT_PRESS. reacts to parameters.BUTTON_PRESS_EVENT
REAC_PRESSED = 0
# => post EVENT_UNPRESS. reacts to parameters.BUTTON_UNPRESS_EVENT
REAC_UNPRESS = 1
REAC_HOVER = 2  # => post EVENT_HOVER. reacts to pygame.MOUSEMOTION
REAC_TIME = 3  # => post nothing. Usually reacts to EVENT_TIME event
REAC_KEYPRESS = 4  # => post nothing. reacts to parameters.KEY_PRESS_EVENT
REAC_MOTION = 5  # => post nothing. reacts to pygame.MOUSEMOTION
REAC_SLIDER_PRESS = 7
REAC_SLIDER_UNPRESS = 8
REAC_SELECT = 9
REAC_PRESS_DDL = 10
REAC_WHEELUP = 11
REAC_WHEELDOWN = 12
REAC_HELP = 13
REAC_CLICKQUIT = 14
REAC_MOUSE_REPEAT = 15
REAC_PRESSED2 = 16
REAC_SLIDER_PRESS2 = 17
REAC_SLIDER_UNPRESS2 = 18
REAC_RIGHT_CLICK = 19
REAC_CHANGE_STATE = 20
REAC_USER = 100

# _states
STATE_NORMAL = 0  # should always stay 0 for compatibility reasons
STATE_PRESSED = 1

# colors
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
YELLOW = (255, 255, 0)
PINK = (255, 0, 255)
LIGHTBLUE = (150, 150, 255)
# colors (gray levels)
WHITE = (255, 255, 255)
ULTRABRIGHT = (240, 240, 240)
BRIGHT = (220, 220, 220)
BRAY = (200, 200, 200)
GRAY = (150, 150, 150)
MID = (127, 127, 127)
DARK = (50, 50, 50)
BLACK = (0, 0, 0)
# alphacolors
TRANSPARENT = (0, 0, 0, 0)

# cursors
CURSOR_NORMAL = 0
CURSOR_TEXT = 1
CURSOR_BROKEN = 2
CURSOR_BALL = 3

SYNTAX_BEG = "#SB"
SYNTAX_END = "#SE"
SYNTAX_FIRST = False
SYNTAX_LAST = False

DEFAULT_RANK = 0


text:
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.byteCodeViewer;

import com.intellij.codeInsight.documentation.DockablePopupManager;
import com.intellij.ide.util.JavaAnonymousClassesHelper;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.fileTypes.FileTypeRegistry;
import com.intellij.openapi.fileTypes.StdFileTypes;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.CompilerModuleExtension;
import com.intellij.openapi.roots.ProjectFileIndex;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.*;
import com.intellij.psi.presentation.java.SymbolPresentationUtil;
import com.intellij.psi.util.ClassUtil;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiUtil;
import com.intellij.ui.content.Content;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.org.objectweb.asm.ClassReader;
import org.jetbrains.org.objectweb.asm.util.Textifier;
import org.jetbrains.org.objectweb.asm.util.TraceClassVisitor;

import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * @author anna
 */
public final class ByteCodeViewerManager extends DockablePopupManager<ByteCodeViewerComponent> {
  private static final ExtensionPointName<ClassSearcher> CLASS_SEARCHER_EP = ExtensionPointName.create("ByteCodeViewer.classSearcher");

  private static final Logger LOG = Logger.getInstance(ByteCodeViewerManager.class);

  private static final @NonNls String TOOLWINDOW_ID = "Byte Code Viewer";
  private static final @NonNls String SHOW_BYTECODE_IN_TOOL_WINDOW = "BYTE_CODE_TOOL_WINDOW";
  private static final @NonNls String BYTECODE_AUTO_UPDATE_ENABLED = "BYTE_CODE_AUTO_UPDATE_ENABLED";

  public static ByteCodeViewerManager getInstance(Project project) {
    return project.getService(ByteCodeViewerManager.class);
  }

  public ByteCodeViewerManager(Project project) {
    super(project);
  }

  @Override
  public String getShowInToolWindowProperty() {
    return SHOW_BYTECODE_IN_TOOL_WINDOW;
  }

  @Override
  public String getAutoUpdateEnabledProperty() {
    return BYTECODE_AUTO_UPDATE_ENABLED;
  }

  @Override
  protected String getToolwindowId() {
    return TOOLWINDOW_ID;
  }

  @Override
  protected String getToolwindowTitle() {
    return JavaByteCodeViewerBundle.message("show.bytecode.tool.window.title");
  }

  @Override
  protected String getAutoUpdateTitle() {
    return JavaByteCodeViewerBundle.message("show.bytecode.for.current.element.action.name");
  }

  @Override
  protected String getAutoUpdateDescription() {
    return JavaByteCodeViewerBundle.message("show.bytecode.for.current.element.action.description");
  }

  @Override
  protected String getRestorePopupDescription() {
    return JavaByteCodeViewerBundle.message("show.bytecode.restore.popup.action.description");
  }

  @Override
  protected ByteCodeViewerComponent createComponent() {
    return new ByteCodeViewerComponent(myProject);
  }

  @Override
  @Nullable
  protected String getTitle(PsiElement element) {
    PsiClass aClass = getContainingClass(element);
    if (aClass == null) return null;
    return SymbolPresentationUtil.getSymbolPresentableText(aClass);
  }

  private void updateByteCode(PsiElement element, ByteCodeViewerComponent component, Content content) {
    updateByteCode(element, component, content, getByteCode(element));
  }

  private void updateByteCode(PsiElement element, ByteCodeViewerComponent component, Content content, String byteCode) {
    if (!StringUtil.isEmpty(byteCode)) {
      component.setText(byteCode, element);
    }
    else {
      PsiElement presentableElement = getContainingClass(element);
      if (presentableElement == null) {
        presentableElement = element.getContainingFile();
        if (presentableElement == null && element instanceof PsiNamedElement) {
          presentableElement = element;
        }
        if (presentableElement == null) {
          component.setText(JavaByteCodeViewerBundle.message("no.bytecode.found"));
          return;
        }
      }
      component.setText(
        JavaByteCodeViewerBundle.message("no.bytecode.found.for", SymbolPresentationUtil.getSymbolPresentableText(presentableElement)));
    }
    content.setDisplayName(getTitle(element));
  }

  @Override
  protected void doUpdateComponent(@NotNull PsiElement element, PsiElement originalElement, ByteCodeViewerComponent component) {
    Content content = myToolWindow.getContentManager().getSelectedContent();
    if (content != null) {
      updateByteCode(element, component, content);
    }
  }

  @Override
  protected void doUpdateComponent(Editor editor, PsiFile psiFile) {
    Content content = myToolWindow.getContentManager().getSelectedContent();
    if (content == null) {
      return;
    }

    ByteCodeViewerComponent component = (ByteCodeViewerComponent)content.getComponent();
    PsiElement element = psiFile.findElementAt(editor.getCaretModel().getOffset());
    if (element != null) {
      updateByteCode(element, component, content);
    }
  }

  @Override
  protected void doUpdateComponent(@NotNull PsiElement element) {
    doUpdateComponent(element, getByteCode(element));
  }

  void doUpdateComponent(@NotNull PsiElement element, final String newText) {
    Content content = myToolWindow.getContentManager().getSelectedContent();
    if (content != null) {
      updateByteCode(element, (ByteCodeViewerComponent)content.getComponent(), content, newText);
    }
  }

  @Nullable
  public static String getByteCode(@NotNull PsiElement psiElement) {
    PsiClass containingClass = getContainingClass(psiElement);
    if (containingClass != null) {
      try {
        byte[] bytes = loadClassFileBytes(containingClass);
        if (bytes != null) {
          StringWriter writer = new StringWriter();
          try (PrintWriter printWriter = new PrintWriter(writer)) {
            new ClassReader(bytes).accept(new TraceClassVisitor(null, new Textifier(), printWriter), 0);
          }
          return writer.toString();
        }
      }
      catch (IOException e) {
        LOG.error(e);
      }
    }
    return null;
  }

  private static byte[] loadClassFileBytes(PsiClass aClass) throws IOException {
    String jvmClassName = getJVMClassName(aClass);
    if (jvmClassName != null) {
      PsiClass fileClass = aClass;
      while (PsiUtil.isLocalOrAnonymousClass(fileClass)) {
        PsiClass containingClass = PsiTreeUtil.getParentOfType(fileClass, PsiClass.class);
        if (containingClass != null) {
          fileClass = containingClass;
        }
      }
      VirtualFile file = fileClass.getOriginalElement().getContainingFile().getVirtualFile();
      if (file != null) {
        ProjectFileIndex index = ProjectFileIndex.SERVICE.getInstance(aClass.getProject());
        if (FileTypeRegistry.getInstance().isFileOfType(file, StdFileTypes.CLASS)) {
          // compiled class; looking for the right .class file (inner class 'A.B' is "contained" in 'A.class', but we need 'A$B.class')
          String classFileName = StringUtil.getShortName(jvmClassName) + ".class";
          if (index.isInLibraryClasses(file)) {
            VirtualFile classFile = file.getParent().findChild(classFileName);
            if (classFile != null) {
              return classFile.contentsToByteArray(false);
            }
          }
          else {
            File classFile = new File(file.getParent().getPath(), classFileName);
            if (classFile.isFile()) {
              return FileUtil.loadFileBytes(classFile);
            }
          }
        }
        else {
          // source code; looking for a .class file in compiler output
          Module module = index.getModuleForFile(file);
          if (module != null) {
            CompilerModuleExtension extension = CompilerModuleExtension.getInstance(module);
            if (extension != null) {
              boolean inTests = index.isInTestSourceContent(file);
              VirtualFile classRoot = inTests ? extension.getCompilerOutputPathForTests() : extension.getCompilerOutputPath();
              if (classRoot != null) {
                String relativePath = jvmClassName.replace('.', '/') + ".class";
                File classFile = new File(classRoot.getPath(), relativePath);
                if (classFile.exists()) {
                  return FileUtil.loadFileBytes(classFile);
                }
              }
            }
          }
        }
      }
    }

    return null;
  }

  private static String getJVMClassName(PsiClass aClass) {
    if (!(aClass instanceof PsiAnonymousClass)) {
      return ClassUtil.getJVMClassName(aClass);
    }

    PsiClass containingClass = PsiTreeUtil.getParentOfType(aClass, PsiClass.class);
    if (containingClass != null) {
      return getJVMClassName(containingClass) + JavaAnonymousClassesHelper.getName((PsiAnonymousClass)aClass);
    }

    return null;
  }

  @Nullable
  public static PsiClass getContainingClass(@NotNull PsiElement psiElement) {
    for (ClassSearcher searcher : CLASS_SEARCHER_EP.getExtensions()) {
      PsiClass aClass = searcher.findClass(psiElement);
      if (aClass != null) {
        return aClass;
      }
    }

    PsiClass containingClass = PsiTreeUtil.getParentOfType(psiElement, PsiClass.class, false);
    while (containingClass instanceof PsiTypeParameter) {
      containingClass = PsiTreeUtil.getParentOfType(containingClass, PsiClass.class);
    }

    if (containingClass == null) {
      PsiFile containingFile = psiElement.getContainingFile();
      if (containingFile instanceof PsiClassOwner) {
        PsiClass[] classes = ((PsiClassOwner)containingFile).getClasses();
        if (classes.length == 1) return classes[0];

        TextRange textRange = psiElement.getTextRange();
        if (textRange != null) {
          for (PsiClass aClass : classes) {
            PsiElement navigationElement = aClass.getNavigationElement();
            TextRange classRange = navigationElement != null ? navigationElement.getTextRange() : null;
            if (classRange != null && classRange.contains(textRange)) return aClass;
          }
        }
      }
      return null;
    }

    return containingClass;
  }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords"
          content="green, green residences, cheap,affordable,smdc, accessible, pre-selling,rent to own,rfo,ready for occupancy,Metro Manila Condo,brand new condo,ayala ave,makati cbd,ust,university of sto. tomas,sm residences, katipunan condos, katipunan properties, katipunan studio units, ateneo de manila university, admu, la salle, dlsu, csb, benilde, taft ave, st. scho, ssc, miriam college, UP Diliman, dorm,Sun Residences,mplace south triangle,condominiums,condos,five starhomes,five-star condos,real estate,properties,houses,studio,lofts,bedrooms,residential properties,flats,semi furnished units,aurora blvd.Manila condominiums,Manila flats,Manila residential,Manila properties,Quezon City condos,Q.C. residential,floor plan,amenities,swimming pool,SM Marikina,Henry Sy, Anne Curtis, BDO, Philippines, Sarah Geronimo, Roel M. Dela Cruz, Roel Dela Cruz">
    <meta name="author" content="UNIT64o.com">

    <title>SMDC Condo For Sale Metro Manila, Makati City | Green Residences</title>
    <meta name="description" content="Green Residences - SMDC Condo Affordable High-rise Condos For Sale by SM Residences.">

    <link href="../css/bootstrap.min.css" rel="stylesheet">

    <link href="../less/freelancer.css" rel="stylesheet">

    <link href="../font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet"
          type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Handlee' rel='stylesheet' type='text/css'>

    <link rel="shortcut icon" href="../img/favicon.ico?120245701">

            <button type="button" class="navbar-toggle" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1">
                Toggle navigation

            </button>

                Condos by
                SMDC
                The good guys!

                    HOME

                    PROJECT DETAILS

                    Contact

                    Inquiry Form

GREEN RESIDENCES

READY FOR OCCUPANCY!

1BR Unit starts at 3M • 10% DP in 6 Mos • 90% Bank Financing

Taft Avenue, Malate, Manila

                    VIEW IN GOOGLE MAP

OVERVIEW

                    Start them young, on their way to stellar heights in SMDC's Green Residences. Located right beside
                    De La Salle University on Taft Avenue, its amenities include a study hall and a multi-purpose area
                    that allow for its residents to focus on their studies and work towards a bright future.

FEATURES

12 Elevators

Automatic Fire Detection and Alarm System

Standby Generator Set for Common Areas

Sewerage Treatment Plant

Mailroom/li>

Garbage Disposal Area on Every Floorr

Commercial Area at the Ground Floor

AMENITIES

Study Room

Game Room

Gym

Function Rooms

Kiddie Pool

Lap Pool

GALLERY

                Previous

                Next

INTERESTED IN THIS PROJECT?

                    FILL UP THE INQUIRY FORM

OR CONTACT ME ON THE NUMBERS BELOW

ROEL M. DELA CRUZ

SENIOR PROPERTY SPECIALIST

 smjazzgain2588@gmail.com

 reox_cruz25@yahoo.com.ph

 Globe: +63 9065578882

About ME :)

Roel is the trusted property specialist by clients here and abroad.
                        Equipped with years of experience in the business and is with SMDC for almost three years.
                        Started as a property specialist in 2012 and got promoted to senior specialist the following year (2013).
                        Acknowledged as the

                        Second Top Producer of SMDC (Jazz Residences) for the year 2014.

                        and
                        6th Place - League of champion for 2016.

SOCIAL MEDIA

                    COPYRIGHT CONDOSBYSMDC.COM 2015

                    BY UNIT64o


text:
RSpec::Matchers.define :exist do |path|
  match do
    File.exist?(path)
  end
  failure_message_for_should { "Expected #{path} to exist but no file found" }
  failure_message_for_should_not { "Expected #{path} to not exist but file was found" }
end


text:
                    HTTP RAW API

                        HTTP RAW API is not supported or disabled. Read WIKI。

                            Key
                            Value
                            Description
                            Opt

                    HTTP API Server

                            Key
                            Value
                            Description
                            Opt

                    SRS Global Config

                                Key
                                Value
                                Description
                                Opt

                    System Vhosts, total {{global.nb_vhosts.value}} vhosts configed.

                            Name
                            E
                            O
                            D
                            H
                            FLV
                            HLS
                            HDS
                            CB
                            Exec
                            BWT
                            F
                            S
                            Referer
                            MR
                            RTC
                            GOP
                            TcpNoDelay
                            MixCorrect
                            TimeJitter
                            ATC
                            T
                            I

                                Add

                            {{vhost.id}}No Stream

                                {{vhost.name}}

                                    <input class="text span5" ng-model="vhost.name">

                                    Please input vhost name.

                            {{vhost.enabled| sc_filter_yesno}}
                            {{vhost.origin| sc_filter_yn}}
                            {{vhost.dvr| sc_filter_yn}}
                            {{vhost.http_static| sc_filter_yn}}
                            {{vhost.http_remux| sc_filter_yn}}
                            {{vhost.hls| sc_filter_yn}}
                            {{vhost.hds| sc_filter_yn}}
                            {{vhost.http_hooks| sc_filter_yn}}
                            {{vhost.exec| sc_filter_yn}}
                            {{vhost.bandcheck| sc_filter_yn}}
                            {{vhost.forward| sc_filter_yn}}
                            {{vhost.security| sc_filter_yn}}
                            {{vhost.refer| sc_filter_yn}}
                            {{vhost.mr| sc_filter_yn}}
                            {{vhost.min_latency| sc_filter_yn}}
                            {{vhost.gop_cache| sc_filter_yn}}
                            {{vhost.tcp_nodelay| sc_filter_yn}}
                            {{vhost.mix_correct| sc_filter_yn}}
                            {{vhost.time_jitter| sc_filter_yn}}
                            {{vhost.atc| sc_filter_yn}}
                            {{vhost.transcode| sc_filter_yn}}
                            {{vhost.ingest| sc_filter_yn}}

                                            Submit

                                        Cancel

                                            Submit

                                        Cancel

                                        Update

                                            Disable

                                        Delete

                                        编辑

                                            Enable

                                            Delete

                                    Detail

                    Config KAFKA

                            Key
                            Value
                            Description
                            Opt

                    SRS Heartbeat

                            Key
                            Value
                            Description
                            Opt

                    STAT Hardward Config

                            Key
                            Value
                            Description
                            Opt

                    HTTP Server Config

                            Key
                            Value
                            Description
                            Opt

                    Stream Caster Config

                            Key
                            Value
                            Description
                            Opt


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <title>我的创客汇 - 西湖创客汇</title>
    <meta name="description" content="">

    <link rel="stylesheet" href="/bootflat/css/site.min.css">
    <link rel="stylesheet" type="text/css" href="/css/common.css">
    <link rel="stylesheet" type="text/css" href="/css/myMaker.css">

    <%include ./inc_top_navbar.html %>

                      我的创客汇
                      我发起的项目
                      我赞助的项目
                      我关注的项目
                      我赞的项目

                      我发起的活动
                      我报名的活动

我发起的项目

您还没有发起项目

                                    新建项目

    <%include ./inc_footer.html %>
    <%include ./inc_gotop.html %>


text:
<?php

// acknowledge a new live stream via info from M6LiveBroadcaster.swf
// expect to receive $_POST['access'] and $_POST['title']

$login_required = false;
require_once('/median-webapp/includes/login_check.php');

if (!isset($current_user['loggedin']) || $current_user['loggedin'] == false) {
	die('ERROR: You are not logged in.');
}

require_once('/median-webapp/includes/live_functions.php');

if (!isset($_POST['access']) || trim($_POST['access']) == '') {
    die('ERROR: You did not set an access level.');
}

$access = (int) $_POST['access'] * 1;

if (!isset($_POST['title']) || trim($_POST['title']) == '') {
    $title = 'Untitled Live Stream';
} else {
    $title = trim($_POST['title']);
}

$new_stream = addNewLiveStream($current_user['userid'], $title, $access);

if ($new_stream === false) {
	echo 'ERROR: There was an error registering the live stream.';
} else {
	echo $new_stream;
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Nathaniel Sena</title>

    <link href="css/bootstrap.css" rel="stylesheet">

    <link href="css/1-col-portfolio.css" rel="stylesheet">
    <link rel='shortcut icon' href='favicon.ico' type='image/x-icon'/ >

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                Work

                        About Me

                        Contact

Crossbow

                    MEAM 101 Assignment

My teammate Nitin testing the crossbow before our final presentation.

Assignment

The assignment called for the making of a toy or game of a certain level of complexity, including some moving parts. Beyond this, we needed to document the build process and could use any of the manufacturing methods we had been taught. After submitting a few proposals and having them be dismissed, we settled on a crossbow.

Design Process

The project group included Nitin (seen shooting the crossbow above), Josh, and myself. I originally proposed the crossbow idea and had noted that I had already mapped out some of the basic design. We agreed that Josh and Nitin would focus on the final assembly while I would precad the basic design(All but the interference fits) to make sure we would hit no snags.

Here is my initial rendering of the cossbow without the interference fits or barrel.

Design Process Cont.

The hardest part of this project we understood would be the launching mechanism. Luckily, I had already found a representation of a working trigger form a project on thingiverse. I copied this design (below) and it worked handily with a slight alteration done by Josh and Nitin.

The second most difficult part we had to figure out was the "shelling" and interference fit of the device. Because we decided on making the model press fit for easy manufacture-the queue for the 3D printers near the project deadlines was often impossibly long- we needed to design our three dimensional structure considering the thickness of our sheet material. With MDF and acrylic available, we chose MDF as it was less prone to cracking under pressure. The MDF available came in 1/8" and 1/4" thicknesses, and considering our "shelling" required a minimum of 5 layers sheets, we opted for a crossbow with the rigidity of five 1/4" layers over five 1/8" layers.

Making the interference fits work is always a tricky game. Because the fit is dependent on the level of kerf cut away from the laser which itself is variable, it always requires some level of testing. Luckily I had wonderful teammates who made everything parametric, who were easily able to change the dimensions of the model to fit together.

The Trigger Mechanism and Handle

Not pictured: The trigger itself

A side view without the top. One can see how we opted for an internal barrel.

A top view of thethe "carriage" which cocks the band. The carriage has pieces that lock into rails on each side of the barrel.

Overall Review

While the first mockup(gif) I created did not reflect my full design, the crossbow worked fairly well. The crossbow fired with a solid speed, I'd guess ~50mph about as straight as I would imagine. We used 1/8" foot long dowel rods to fire which had no stabilization(for the safety of all), leading them to spiral once about 15ft from the gun.

Some aspects that I wish we had incorporated included adding a more definite barrel. While not pictured, the "barrel" was more of a resting spot for the projectile. This method I felt could have benefitted in two wasy from the more definite barrel. The first is that we often had misfirings of the gun from the elastic band tracking past the end of the dowel, leaving it in the barrel with a dry fire. Having a more defined barrel i believe would have minimized the chances of this happening. The other improvement this may be able to do is direct the dowel in a more straight path. I believe similarly to how the band could slip off that the band often would propel the dowel in a non-uniform manner. Having this barrel I believe could have kept the path of the projectile more consistent.

One last bit I would improve is the handle of the gun. After testing many rounds, we got excited with the product and cocked it too hard, breaking off the handle. This could have been prevented by making the piece that interlocks with the handle and carriage a little more robust. I also think this makes sense considering that we were using this product as a toy and often toys get mistreated and beaten up, requiring the design to handle these rigors.


text:
package org.apache.hadoop.hdfs.server.namenode;

import java.io.IOException;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;

import org.apache.hadoop.hdfs.protocol.Block;

public class INodeHardLinkFile extends INodeFile{
  static final INodeType INODE_TYPE = INodeType.HARDLINKED_INODE;

  /** Keeps track of the lastest hard link ID */
  private static AtomicLong latestHardLinkID = new AtomicLong(0);

  private final HardLinkFileInfo hardLinkFileInfo;

  protected INodeHardLinkFile(INodeFile inodeFile) throws IOException {
    super(inodeFile);
    hardLinkFileInfo = new HardLinkFileInfo(latestHardLinkID.getAndIncrement());
  }

  protected INodeHardLinkFile(INodeHardLinkFile inodeHardLinkFile) {
    super(inodeHardLinkFile);
    this.hardLinkFileInfo = inodeHardLinkFile.getHardLinkFileInfo();
  }

  public HardLinkFileInfo getHardLinkFileInfo() {
    return hardLinkFileInfo;
  }

  public void incReferenceCnt(){
    this.hardLinkFileInfo.addLinkedFile(this);
  }

  public int getReferenceCnt(){
    return this.hardLinkFileInfo.getReferenceCnt();
  }

  public long getHardLinkID() {
    return this.hardLinkFileInfo.getHardLinkID();
  }

  @Override
  int collectSubtreeBlocksAndClear(List<Block> v, int blocksLimit) {
    parent = null;
    this.hardLinkFileInfo.removeLinkedFile(this);
    return 1;
  }
}


text:
<?php

/**
 * Generated base class for `hg update`
 *
 * @generated
 * @see     http://selenic.com/hg/help/update
 * @package libhg.Command.Update
 */
abstract class libhg_Command_Update_Base extends libhg_Command_Base {
	/**
	 * optional 'date' option (-d)
	 *
	 * @var string
	 */
	protected $date = null;

	/**
	 * optional 'rev' option (-r)
	 *
	 * @var string
	 */
	protected $rev = null;

	/**
	 * 'clean' flag (-C)
	 *
	 * @var boolean
	 */
	protected $clean = false;

	/**
	 * 'check' flag (-c)
	 *
	 * @var boolean
	 */
	protected $check = false;

	/**
	 * get date
	 *
	 * @return string  set value or null if not set
	 */
	public function getDate() {
		return $this->date;
	}

	/**
	 * get rev
	 *
	 * @return string  set value or null if not set
	 */
	public function getRev() {
		return $this->rev;
	}

	/**
	 * get clean
	 *
	 * @return boolean  set value or false if not set
	 */
	public function getClean() {
		return $this->clean;
	}

	/**
	 * get check
	 *
	 * @return boolean  set value or false if not set
	 */
	public function getCheck() {
		return $this->check;
	}

	/**
	 * get command name
	 *
	 * @return string  always 'update'
	 */
	public function getCommandName() {
		return 'update';
	}

	/**
	 * set date
	 *
	 * @param  string $date               the single date argument
	 * @return libhg_Command_Update_Base  self
	 */
	public function date($date) {
		$this->date = $date;
		return $this;
	}

	/**
	 * set rev
	 *
	 * @param  string $rev                the single rev argument
	 * @return libhg_Command_Update_Base  self
	 */
	public function rev($rev) {
		$this->rev = $rev;
		return $this;
	}

	/**
	 * set or unset clean flag
	 *
	 * @param  boolean $flag              true to set the flag, false to unset it
	 * @return libhg_Command_Update_Base  self
	 */
	public function clean($flag = true) {
		$this->clean = (boolean) $flag;
		return $this;
	}

	/**
	 * set or unset check flag
	 *
	 * @param  boolean $flag              true to set the flag, false to unset it
	 * @return libhg_Command_Update_Base  self
	 */
	public function check($flag = true) {
		$this->check = (boolean) $flag;
		return $this;
	}

	/**
	 * get command options
	 *
	 * @return libhg_Options_Interface  options container
	 */
	public function getCommandOptions() {
		$options = new libhg_Options_Container();

		if ($this->date !== null) $options->setSingle('-d', $this->date);
		if ($this->rev !== null) $options->setSingle('-r', $this->rev);
		if ($this->clean) $options->setFlag('-C');
		if ($this->check) $options->setFlag('-c');

		return $options;
	}
}


text:
/**
 * Slider property defaults to "slider"
 */
Mojo.Widget.WahveeProgressSlider = Class.create({
	initialize: function() {
		this.sliderPhysicalMax = 100;
		this.sliderPhysicalMin = 0;
		this.offset = 0;
		this.lastPos = 0;
		this.percent = 0;
		this.seeking = false;

		this.dragStartHandler = this.dragStartHandlerFunc.bindAsEventListener(this);
		this.draggingHandler = this.dragging.bindAsEventListener(this);
	},
	setup: function() {
		// The HTML element for this widget is found in...this.controller.element
		// The name of the widget (or ID of the element that will become this widget) is...this.controller.widgetName
		this.divPrefix = Mojo.View.makeUniqueId() + this.controller.scene.sceneId + this.controller.widgetName;
		this.sliderValueProperty = this.controller.attributes.sliderProperty || "slider";
		this.progressStartProperty = this.controller.attributes.progressStartProperty || "progressLowerValue";
		this.progressEndProperty = this.controller.attributes.progressProperty || "progressUpperValue";
		this.sliderMaxValue = this.controller.attributes.sliderMaxValue || 1;
		this.sliderMinValue = this.controller.attributes.sliderMinValue || 0;
		this.sliderValDifference = this.sliderMaxValue - this.sliderMinValue;

		// Now render the widget
		this.renderWidget();

		// Make the dragging area expandable
		this.controller.exposeMethods(['updateDraggingArea']);
	},
	/**
	 * Sets up the widget for it's first time use on the screen.
	 */
	renderWidget: function() {
		// Path to the template
		var sliderTemplate = "wahvee-progress-slider/wahvee-progress-slider";
		//var physicalHeightOfSlider = this.controller.element.getHeight();
		var html = Mojo.View.render({
			object: {
				divPrefix: this.divPrefix
			},
			template: sliderTemplate
		});

		// Add the generated HTML to the template
		this.controller.element.update(html);
		// Get the two elements to be drawn/positioned by this widget
		this.background = this.controller.get(this.divPrefix + "-background");
		this.progressBar = this.controller.get(this.divPrefix + "-progress");
		this.slider = this.controller.get(this.divPrefix + "-slider-btn");

		// Determine the offset to get the middle of the slider
		this.offset = this.slider.getWidth() / 2;

		// Start listening for dragging of the slider button
		this.controller.listen(this.slider, Mojo.Event.dragStart, this.dragStartHandler);
		this.controller.listen(this.slider, Mojo.Event.dragging, this.draggingHandler);

		// Setup the container to do the drop positioning (keeps it within the bounds)
		Mojo.Drag.setupDropContainer(this.controller.element, this);

		// Update the download percentage drawn on screen and the slider percentage
		this.setDownloadPercentage();
		this.setPositionSlider();
	},
	/**
	 * Function is called and sets the sliders min and max values. This does not effect,
	 * their actual physical widths or postiions. It just affects the number that is
	 * calculated and returned as the sliders value.
	 */
	updateDraggingArea: function(newMin, newMax) {
		this.sliderMaxValue = newMax;
		this.sliderMinValue = newMin;
		this.sliderValDifference = this.sliderMaxValue - this.sliderMinValue;
	},
	/**
	 * Actually positions the slider on the screen.
	 */
	setPositionSlider: function() {
		var position = this.background.offsetLeft;
		var physicalWidthOfSlider = this.background.getWidth();
		var x1 = position - this.offset;
		var x2 = physicalWidthOfSlider - this.offset + position;
		var sliderModelValue = this.controller.model[this.sliderValueProperty];
		var sliderValue = (sliderModelValue >= this.sliderMinValue && sliderModelValue <= this.sliderMaxValue) ? sliderModelValue : this.sliderMaxValue;
		var xdiff = x2 - x1;
		var slidOffset = sliderValue - this.sliderMinValue;
		var sliderXPos = xdiff * slidOffset;
		sliderXPos /= this.sliderValDifference;
		sliderXPos += x1;
		this.slider.setStyle({
			left: sliderXPos + "px"
		});
	},
	/**
	 * Update the screen to show the download percentage.
	 */
	setDownloadPercentage: function() {
		var modelPercent = this.controller.model[this.progressEndProperty].roundNumber(2);
		var modelLowPercent = this.controller.model[this.progressStartProperty];
		if(this.percent < modelPercent) {
			this.percent = modelPercent;
			this.progressBar.setStyle({
				//left: modelLowPercent * 100 + "%", // Lower bound of the percentage
				width: modelPercent * 100 + "%" // Upper bound of the percentage
			});
		}
	},
	handleModelChanged: function() {
		if(!this.seeking) {
			this.setDownloadPercentage();
			this.setPositionSlider();
		}
	},
	/**
	 * When the user starts trying to drag the slider-btn, make it draggable.
	 */
	dragStartHandlerFunc: function(event) {
		event.stop();
		this.seeking = true;
		var position = this.background.offsetLeft;
		var physicalWidthOfSlider = this.background.getWidth();
		Mojo.Drag.startDragging(this.controller.scene, this.slider, event.down, {
			draggingClass: "wahvee-progress-slider-btn-drag",
			preventVertical: true,
			preventDropReset: true,
			minHorizontalPixel: position - this.offset,
			maxHorizontalPixel: physicalWidthOfSlider - this.offset + position
		});
		Mojo.Event.send(this.controller.element, Mojo.Event.sliderDragStart); //allow applications to see this event
	},
	/**
	 * function called whenever the item moves over this container.
	 */
	dragging: function(event) {
		event.stop();
		var pos = this.determineSliderValue(this.slider.offsetLeft);
		pos = pos.roundNumber(2);
		if(this.lastPos != pos) {
			this.lastPos = pos;
			Mojo.Event.send(this.controller.element, Mojo.Event.dragging, {value: pos});
		}
	},
	/**
	 * Called by the Mojo.Drag events.
	 */
	dragDrop: function(element) {
		this.slider.removeClassName("wahvee-progress-slider-btn-drag");
		this.updateModel();
		Mojo.Event.send(this.controller.element, Mojo.Event.sliderDragEnd); //allow applications to see this event
		this.seeking = false;
	},
	/**
	 * Function is given an x position, this value must be greater than the minimum
	 * slider position and less than the largest slider position. The value of the slider
	 * is then created and the value is stored in the model.
	 */
	determineSliderValue: function(x) {
		var position = this.background.offsetLeft;
		var physicalWidthOfSlider = this.background.getWidth();
		// Physical area able to allow sliding
		var x1 = position - this.offset;
		var x2 = physicalWidthOfSlider - this.offset + position;
		var xdiff = x2 - x1;
		var xoffset = x - x1;
		var sliderValue = this.sliderValDifference * xoffset;
		sliderValue /= xdiff;
		sliderValue += this.sliderMinValue;
		return sliderValue;
	},
	/**
	 * @private
	 * Cause the model to change. Send an event to anyone who is listening.
	 */
	updateModel: function() {
		var pos = this.determineSliderValue(this.slider.offsetLeft);
		if (pos !== this.controller.model[this.sliderValueProperty]) {
			this.controller.model[this.sliderValueProperty] = pos;
			Mojo.Event.send(this.controller.element, Mojo.Event.propertyChange, {value: pos});
		}
	},
	/**
	 * @private
	 * This is about to be destroyed. So I need to remove the event listeners.
	 */
	cleanup: function() {
		this.controller.stopListening(this.slider, Mojo.Event.dragStart, this.dragStartHandler);
		this.controller.stopListening(this.slider, Mojo.Event.dragging, this.draggingHandler);
	}
});


text:
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Management.Automation.Internal;
using System.Management.Automation.Language;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Loader;
using System.Security;
using System.Text;
using System.Text.RegularExpressions;

namespace System.Management.Automation
{
    /// <summary>
    /// ClrFacade contains all diverging code (different implementation for FullCLR and CoreCLR using if/def).
    /// It exposes common APIs that can be used by the rest of the code base.
    /// </summary>
    internal static class ClrFacade
    {
        /// <summary>
        /// Initialize powershell AssemblyLoadContext and register the 'Resolving' event, if it's not done already.
        /// If powershell is hosted by a native host such as DSC, then PS ALC might be initialized via 'SetPowerShellAssemblyLoadContext' before loading S.M.A.
        /// </summary>
        static ClrFacade()
        {
            if (PowerShellAssemblyLoadContext.Instance == null)
            {
                PowerShellAssemblyLoadContext.InitializeSingleton(string.Empty);
            }
        }

        #region Assembly

        internal static IEnumerable<Assembly> GetAssemblies(TypeResolutionState typeResolutionState, TypeName typeName)
        {
            string typeNameToSearch = typeResolutionState.GetAlternateTypeName(typeName.Name) ?? typeName.Name;
            return GetAssemblies(typeNameToSearch);
        }

        /// <summary>
        /// Facade for AppDomain.GetAssemblies.
        /// </summary>
        /// <param name="namespaceQualifiedTypeName">
        /// In CoreCLR context, if it's for string-to-type conversion and the namespace qualified type name is known, pass it in so that
        /// powershell can load the necessary TPA if the target type is from an unloaded TPA.
        /// </param>
        internal static IEnumerable<Assembly> GetAssemblies(string namespaceQualifiedTypeName = null)
        {
            return PSAssemblyLoadContext.GetAssembly(namespaceQualifiedTypeName) ?? GetPSVisibleAssemblies();
        }

        /// <summary>
        /// Return assemblies from the default load context and the 'individual' load contexts.
        /// The 'individual' load contexts are the ones holding assemblies loaded via 'Assembly.Load(byte[])' and 'Assembly.LoadFile'.
        /// Assemblies loaded in any custom load contexts are not consider visible to PowerShell to avoid type identity issues.
        /// </summary>
        private static IEnumerable<Assembly> GetPSVisibleAssemblies()
        {
            const string IndividualAssemblyLoadContext = "System.Runtime.Loader.IndividualAssemblyLoadContext";

            foreach (Assembly assembly in AssemblyLoadContext.Default.Assemblies)
            {
                if (!assembly.FullName.StartsWith(TypeDefiner.DynamicClassAssemblyFullNamePrefix, StringComparison.Ordinal))
                {
                    yield return assembly;
                }
            }

            foreach (AssemblyLoadContext context in AssemblyLoadContext.All)
            {
                if (IndividualAssemblyLoadContext.Equals(context.GetType().FullName, StringComparison.Ordinal))
                {
                    foreach (Assembly assembly in context.Assemblies)
                    {
                        yield return assembly;
                    }
                }
            }
        }

        /// <summary>
        /// Get the namespace-qualified type names of all available .NET Core types shipped with PowerShell.
        /// This is used for type name auto-completion in PS engine.
        /// </summary>
        internal static IEnumerable<string> AvailableDotNetTypeNames => PSAssemblyLoadContext.AvailableDotNetTypeNames;

        /// <summary>
        /// Get the assembly names of all available .NET Core assemblies shipped with PowerShell.
        /// This is used for type name auto-completion in PS engine.
        /// </summary>
        internal static HashSet<string> AvailableDotNetAssemblyNames => PSAssemblyLoadContext.AvailableDotNetAssemblyNames;

        private static PowerShellAssemblyLoadContext PSAssemblyLoadContext => PowerShellAssemblyLoadContext.Instance;

        #endregion Assembly

        #region Encoding

        /// <summary>
        /// Facade for getting default encoding.
        /// </summary>
        internal static Encoding GetDefaultEncoding()
        {
            if (s_defaultEncoding == null)
            {
                // load all available encodings
                EncodingRegisterProvider();
                s_defaultEncoding = new UTF8Encoding(false);
            }

            return s_defaultEncoding;
        }

        private static volatile Encoding s_defaultEncoding;

        /// <summary>
        /// Facade for getting OEM encoding
        /// OEM encodings work on all platforms, or rather codepage 437 is available on both Windows and Non-Windows.
        /// </summary>
        internal static Encoding GetOEMEncoding()
        {
            if (s_oemEncoding == null)
            {
                // load all available encodings
                EncodingRegisterProvider();
#if UNIX
                s_oemEncoding = new UTF8Encoding(false);
#else
                uint oemCp = NativeMethods.GetOEMCP();
                s_oemEncoding = Encoding.GetEncoding((int)oemCp);
#endif
            }

            return s_oemEncoding;
        }

        private static volatile Encoding s_oemEncoding;

        private static void EncodingRegisterProvider()
        {
            if (s_defaultEncoding == null && s_oemEncoding == null)
            {
                Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
            }
        }

        #endregion Encoding

#if !UNIX
        #region Security

        /// <summary>
        /// Facade to get the SecurityZone information of a file.
        /// </summary>
        internal static SecurityZone GetFileSecurityZone(string filePath)
        {
            Diagnostics.Assert(Path.IsPathRooted(filePath), "Caller makes sure the path is rooted.");
            Diagnostics.Assert(File.Exists(filePath), "Caller makes sure the file exists.");
            return MapSecurityZone(filePath);
        }

        /// <summary>
        /// Map the file to SecurityZone.
        /// </summary>
        /// <remarks>
        /// The algorithm is as follows:
        ///
        /// 1. Alternate data stream "Zone.Identifier" is checked first. If this alternate data stream has content, then the content is parsed to determine the SecurityZone.
        /// 2. If the alternate data stream "Zone.Identifier" doesn't exist, or its content is not expected, then the file path will be analyzed to determine the SecurityZone.
        ///
        /// For #1, the parsing rules are observed as follows:
        ///   A. Read content of the data stream line by line. Each line is trimmed.
        ///   B. Try to match the current line with '^\[ZoneTransfer\]'.
        ///        - if matching, then do step (#C) starting from the next line
        ///        - if not matching, then continue to do step (#B) with the next line.
        ///   C. Try to match the current line with '^ZoneId\s*=\s*(.*)'
        ///        - if matching, check if the ZoneId is valid. Then return the corresponding SecurityZone if the 'ZoneId' is valid, or 'NoZone' if invalid.
        ///        - if not matching, then continue to do step (#C) with the next line.
        ///   D. Reach EOF, then return 'NoZone'.
        /// After #1, if the returned SecurityZone is 'NoZone', then proceed with #2. Otherwise, return it as the mapping result.
        ///
        /// For #2, the analysis rules are observed as follows:
        ///   A. If the path is a UNC path, then
        ///       - if the host name of the UNC path is IP address, then mapping it to "Internet" zone.
        ///       - if the host name of the UNC path has dot (.) in it, then mapping it to "internet" zone.
        ///       - otherwise, mapping it to "intranet" zone.
        ///   B. If the path is not UNC path, then get the root drive,
        ///       - if the drive is CDRom, mapping it to "Untrusted" zone
        ///       - if the drive is Network, mapping it to "Intranet" zone
        ///       - otherwise, mapping it to "MyComputer" zone.
        ///
        /// The above algorithm has two changes comparing to the behavior of "Zone.CreateFromUrl" I observed:
        ///   (1) If a file downloaded from internet (ZoneId=3) is not on the local machine, "Zone.CreateFromUrl" won't respect the MOTW.
        ///       I think it makes more sense for powershell to always check the MOTW first, even for files not on local box.
        ///   (2) When it's a UNC path and is actually a loopback (\\127.0.0.1\c$\test.txt), "Zone.CreateFromUrl" returns "Internet", but
        ///       the above algorithm changes it to be "MyComputer" because it's actually the same computer.
        /// </remarks>
        private static SecurityZone MapSecurityZone(string filePath)
        {
            // WSL introduces a new filesystem path to access the Linux filesystem from Windows, like '\\wsl$\ubuntu'.
            // If the given file path is such a special case, we consider it's in 'MyComputer' zone.
            if (filePath.StartsWith(Utils.WslRootPath, StringComparison.OrdinalIgnoreCase))
            {
                return SecurityZone.MyComputer;
            }

            SecurityZone reval = ReadFromZoneIdentifierDataStream(filePath);
            if (reval != SecurityZone.NoZone)
            {
                return reval;
            }

            // If it reaches here, then we either couldn't get the ZoneId information, or the ZoneId is invalid.
            // In this case, we try to determine the SecurityZone by analyzing the file path.
            Uri uri = new Uri(filePath);
            if (uri.IsUnc)
            {
                if (uri.IsLoopback)
                {
                    return SecurityZone.MyComputer;
                }

                if (uri.HostNameType == UriHostNameType.IPv4 ||
                    uri.HostNameType == UriHostNameType.IPv6)
                {
                    return SecurityZone.Internet;
                }

                // This is also an observation of Zone.CreateFromUrl/Zone.SecurityZone. If the host name
                // has 'dot' in it, the file will be treated as in Internet security zone. Otherwise, it's
                // in Intranet security zone.
                string hostName = uri.Host;
                return hostName.Contains('.') ? SecurityZone.Internet : SecurityZone.Intranet;
            }

            string root = Path.GetPathRoot(filePath);
            DriveInfo drive = new DriveInfo(root);
            switch (drive.DriveType)
            {
                case DriveType.NoRootDirectory:
                case DriveType.Unknown:
                case DriveType.CDRom:
                    return SecurityZone.Untrusted;
                case DriveType.Network:
                    return SecurityZone.Intranet;
                default:
                    return SecurityZone.MyComputer;
            }
        }

        /// <summary>
        /// Read the 'Zone.Identifier' alternate data stream to determin SecurityZone of the file.
        /// </summary>
        private static SecurityZone ReadFromZoneIdentifierDataStream(string filePath)
        {
            if (!AlternateDataStreamUtilities.TryCreateFileStream(filePath, "Zone.Identifier", FileMode.Open, FileAccess.Read, FileShare.Read, out var zoneDataStream))
            {
                return SecurityZone.NoZone;
            }

            // If we successfully get the zone data stream, try to read the ZoneId information
            using (StreamReader zoneDataReader = new StreamReader(zoneDataStream, GetDefaultEncoding()))
            {
                string line = null;
                bool zoneTransferMatched = false;

                // After a lot experiments with Zone.CreateFromUrl/Zone.SecurityZone, the way it handles the alternate
                // data stream 'Zone.Identifier' is observed as follows:
                //    1. Read content of the data stream line by line. Each line is trimmed.
                //    2. Try to match the current line with '^\[ZoneTransfer\]'.
                //           - if matching, then do step #3 starting from the next line
                //           - if not matching, then continue to do step #2 with the next line.
                //    3. Try to match the current line with '^ZoneId\s*=\s*(.*)'
                //           - if matching, check if the ZoneId is valid. Then return the corresponding SecurityZone if valid, or 'NoZone' if invalid.
                //           - if not matching, then continue to do step #3 with the next line.
                //    4. Reach EOF, then return 'NoZone'.
                while ((line = zoneDataReader.ReadLine()) != null)
                {
                    line = line.Trim();
                    if (!zoneTransferMatched)
                    {
                        zoneTransferMatched = Regex.IsMatch(line, @"^\[ZoneTransfer\]", RegexOptions.IgnoreCase);
                    }
                    else
                    {
                        Match match = Regex.Match(line, @"^ZoneId\s*=\s*(.*)", RegexOptions.IgnoreCase);
                        if (!match.Success) { continue; }

                        // Match found. Validate ZoneId value.
                        string zoneIdRawValue = match.Groups[1].Value;
                        match = Regex.Match(zoneIdRawValue, @"^[+-]?\d+", RegexOptions.IgnoreCase);
                        if (!match.Success) { return SecurityZone.NoZone; }

                        string zoneId = match.Groups[0].Value;
                        SecurityZone result;
                        return LanguagePrimitives.TryConvertTo(zoneId, out result) ? result : SecurityZone.NoZone;
                    }
                }
            }

            return SecurityZone.NoZone;
        }

        #endregion Security
#endif

        #region Misc

        /// <summary>
        /// Facade for ManagementDateTimeConverter.ToDmtfDateTime(DateTime)
        /// </summary>
        internal static string ToDmtfDateTime(DateTime date)
        {
#if CORECLR
            // This implementation is copied from ManagementDateTimeConverter.ToDmtfDateTime(DateTime date) with a minor adjustment:
            // Use TimeZoneInfo.Local instead of TimeZone.CurrentTimeZone. System.TimeZone is not in CoreCLR.
            // According to MSDN, CurrentTimeZone property corresponds to the TimeZoneInfo.Local property, and
            // it's recommended to use TimeZoneInfo.Local whenever possible.

            const int maxsizeUtcDmtf = 999;
            string UtcString = string.Empty;
            // Fill up the UTC field in the DMTF date with the current zones UTC value
            TimeZoneInfo curZone = TimeZoneInfo.Local;
            TimeSpan tickOffset = curZone.GetUtcOffset(date);
            long OffsetMins = (tickOffset.Ticks / TimeSpan.TicksPerMinute);
            IFormatProvider frmInt32 = (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(int));

            // If the offset is more than that what can be specified in DMTF format, then
            // convert the date to UniversalTime
            if (Math.Abs(OffsetMins) > maxsizeUtcDmtf)
            {
                date = date.ToUniversalTime();
                UtcString = "+000";
            }
            else
                if ((tickOffset.Ticks >= 0))
            {
                UtcString = "+" + ((tickOffset.Ticks / TimeSpan.TicksPerMinute)).ToString(frmInt32).PadLeft(3, '0');
            }
            else
            {
                string strTemp = OffsetMins.ToString(frmInt32);
                UtcString = "-" + strTemp.Substring(1, strTemp.Length - 1).PadLeft(3, '0');
            }

            string dmtfDateTime = date.Year.ToString(frmInt32).PadLeft(4, '0');

            dmtfDateTime += date.Month.ToString(frmInt32).PadLeft(2, '0');
            dmtfDateTime += date.Day.ToString(frmInt32).PadLeft(2, '0');
            dmtfDateTime += date.Hour.ToString(frmInt32).PadLeft(2, '0');
            dmtfDateTime += date.Minute.ToString(frmInt32).PadLeft(2, '0');
            dmtfDateTime += date.Second.ToString(frmInt32).PadLeft(2, '0');
            dmtfDateTime += ".";

            // Construct a DateTime with the precision to Second as same as the passed DateTime and so get
            // the ticks difference so that the microseconds can be calculated
            DateTime dtTemp = new DateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, 0);
            Int64 microsec = ((date.Ticks - dtTemp.Ticks) * 1000) / TimeSpan.TicksPerMillisecond;

            // fill the microseconds field
            string strMicrosec = microsec.ToString((IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(Int64)));
            if (strMicrosec.Length > 6)
            {
                strMicrosec = strMicrosec.Substring(0, 6);
            }

            dmtfDateTime += strMicrosec.PadLeft(6, '0');
            // adding the UTC offset
            dmtfDateTime += UtcString;

            return dmtfDateTime;
#else
            return ManagementDateTimeConverter.ToDmtfDateTime(date);
#endif
        }

        #endregion Misc

        /// <summary>
        /// Native methods that are used by facade methods.
        /// </summary>
        private static class NativeMethods
        {
            /// <summary>
            /// Pinvoke for GetOEMCP to get the OEM code page.
            /// </summary>
            [DllImport(PinvokeDllNames.GetOEMCPDllName, SetLastError = false, CharSet = CharSet.Unicode)]
            internal static extern uint GetOEMCP();
        }
    }
}


text:
package org.jivesoftware.smackx.disco;

import org.jivesoftware.smackx.disco.packet.DiscoverInfo;

import org.jxmpp.jid.Jid;

public abstract class DiscoInfoLookupShortcutMechanism implements Comparable<DiscoInfoLookupShortcutMechanism> {

    private final String name;
    private final int priority;

    protected DiscoInfoLookupShortcutMechanism(String name, int priority) {
        this.name = name;
        this.priority = priority;
    }

    public final String getName() {
        return name;
    }

    /**
     * Get the priority of this mechanism. Lower values mean higher priority.
     *
     * @return the priority of this mechanism.
     */
    public final int getPriority() {
        return priority;
    }

    public abstract DiscoverInfo getDiscoverInfoByUser(ServiceDiscoveryManager serviceDiscoveryManager, Jid jid);

    @Override
    public final int compareTo(DiscoInfoLookupShortcutMechanism other) {
        int ourPriority = getPriority();
        return Integer.compare(ourPriority, other.getPriority());
    }
}


text:
<html>
<head>
<script>
window.addEventListener('message', function(evt) {
  if (evt.data === 'START') {
    var w = window.open('./');
    var sw = w.navigator.serviceWorker;
    w.close();
    w = null;
    sw.register('doesntmatter.js');
    parent.postMessage('OK', '*');
  }
});
</script>
</head>
</html>


text:
namespace Internal.TypeSystem
{
    // Functionality related to deterministic ordering of types
    partial class MethodForRuntimeDeterminedType
    {
        protected internal override int ClassCode => 719937490;

        protected internal override int CompareToImpl(MethodDesc other, TypeSystemComparer comparer)
        {
            var otherMethod = (MethodForRuntimeDeterminedType)other;

            int result = comparer.CompareWithinClass(_rdType, otherMethod._rdType);
            if (result != 0)
                return result;

            return comparer.Compare(_typicalMethodDef, otherMethod._typicalMethodDef);
        }
    }
}


text:
package com.deepoove.poi.tl.example;

import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.data.Numberings;
import com.deepoove.poi.data.Pictures;
import com.deepoove.poi.data.TextRenderData;
import com.deepoove.poi.data.style.Style;
import com.deepoove.poi.tl.render.ResumeDataV2;

@DisplayName("Foreach resume example")
public class ResumeIterableExample {

    ResumeDataV2 datas = new ResumeDataV2();

    @BeforeEach
    public void init() {
        datas.setPortrait(Pictures.ofLocal("src/test/resources/sayi.png").size(100, 100).create());
        datas.setName("卅一");
        datas.setJob("BUG工程师");
        datas.setPhone("18080809090");
        datas.setSex("男");
        datas.setProvince("杭州");
        datas.setBirthday("2000.08.19");
        datas.setEmail("adasai90@gmail.com");
        datas.setAddress("浙江省杭州市西湖区古荡1号");
        datas.setEnglish("CET6 620");
        datas.setUniversity("美国斯坦福大学");
        datas.setProfession("生命工程");
        datas.setEducation("学士");
        datas.setRank("班级排名 1/36");
        datas.setHobbies("音乐、画画、乒乓球、旅游、读书\nhttps://github.com/Sayi");

        // 技术栈部分
        TextRenderData textRenderData = new TextRenderData("SpringBoot、SprigCloud、Mybatis");
        Style style = Style.builder().buildFontSize(10).buildColor("7F7F7F").buildFontFamily("微软雅黑").build();
        textRenderData.setStyle(style);
        datas.setStack(Numberings.of(textRenderData, textRenderData, textRenderData).create());

        /*
         * {{?experiences}} {{company}} {{department}} {{time}} {{position}}
         * {{*responsibility}} {{/experiences}}
         */
        List<ExperienceData> experiences = new ArrayList<ExperienceData>();
        ExperienceData data0 = new ExperienceData();
        data0.setCompany("香港微软");
        data0.setDepartment("Office 事业部");
        data0.setTime("2001.07-2020.06");
        data0.setPosition("BUG工程师");
        textRenderData = new TextRenderData("负责生产BUG,然后修复BUG,同时有效实施招聘行为");
        textRenderData.setStyle(style);
        data0.setResponsibility(Numberings.of(textRenderData, textRenderData).create());
        ExperienceData data1 = new ExperienceData();
        data1.setCompany("自由职业");
        data1.setDepartment("OpenSource 项目组");
        data1.setTime("2015.07-2020.06");
        data1.setPosition("研发工程师");
        textRenderData = new TextRenderData("开源项目的迭代和维护工作");
        textRenderData.setStyle(style);
        TextRenderData textRenderData1 = new TextRenderData("持续集成、Swagger文档等工具调研");
        textRenderData1.setStyle(style);
        data1.setResponsibility(Numberings.of(textRenderData, textRenderData1, textRenderData).create());
        experiences.add(data0);
        experiences.add(data1);
        experiences.add(data0);
        experiences.add(data1);
        datas.setExperiences(experiences);
    }

    @Test
    public void testResumeExample() throws Exception {
        XWPFTemplate template = XWPFTemplate.compile("src/test/resources/template/iterable_resume.docx").render(datas);

        FileOutputStream out = new FileOutputStream("target/out_example_resume_iterable.docx");
        template.write(out);
        out.flush();
        out.close();
        template.close();
    }

}