|
||||||||||
| PREV NEXT | FRAMES NO FRAMES |
| Packages that use AprSession | |
|---|---|
| org.apache.mina.transport.socket.apr |
| Uses of AprSession in org.apache.mina.transport.socket.apr |
|---|
| Methods in org.apache.mina.transport.socket.apr that return AprSession | |
|---|---|
protected AprSession |
AprSocketAcceptor.accept(IoProcessor<AprSession> processor,
Long handle)
Accept a client connection for a server socket and return a new IoSession
associated with the given IoProcessor |
protected AprSession |
AprSocketConnector.newSession(IoProcessor<AprSession> processor,
Long handle)
Create a new IoSession from a connected socket client handle. |
| Methods in org.apache.mina.transport.socket.apr that return types with arguments of type AprSession | |
|---|---|
protected Iterator<AprSession> |
AprIoProcessor.allSessions()
Get an Iterator for the list of IoSession polled by this
IoProcessor |
IoProcessor<AprSession> |
AprSession.getProcessor()
|
protected Iterator<AprSession> |
AprIoProcessor.selectedSessions()
Get an Iterator for the list of IoSession found selected
by the last call of {@link AbstractPollingIoProcessor#select(int) |
| Methods in org.apache.mina.transport.socket.apr with parameters of type AprSession | |
|---|---|
protected void |
AprIoProcessor.destroy(AprSession session)
Destroy the underlying client socket handle |
protected SessionState |
AprIoProcessor.getState(AprSession session)
Get the state of a session (preparing, open, closed) |
protected void |
AprIoProcessor.init(AprSession session)
|
protected boolean |
AprIoProcessor.isInterestedInRead(AprSession session)
is this session registered for reading |
protected boolean |
AprIoProcessor.isInterestedInWrite(AprSession session)
is this session registered for writing |
protected boolean |
AprIoProcessor.isReadable(AprSession session)
Is the session ready for reading |
protected boolean |
AprIoProcessor.isWritable(AprSession session)
Is the session ready for writing |
protected int |
AprIoProcessor.read(AprSession session,
IoBuffer buffer)
Reads a sequence of bytes from a IoSession into the given
IoBuffer . |
protected void |
AprIoProcessor.setInterestedInRead(AprSession session,
boolean isInterested)
register a session for reading |
protected void |
AprIoProcessor.setInterestedInWrite(AprSession session,
boolean isInterested)
register a session for writing |
protected int |
AprIoProcessor.transferFile(AprSession session,
FileRegion region,
int length)
Write a part of a file to a IoSession , if the underlying API
isn't supporting system calls like sendfile(), you can throw a
UnsupportedOperationException so the file will be send using
usual AbstractPollingIoProcessor.write(AbstractIoSession, IoBuffer, int) call. |
protected int |
AprIoProcessor.write(AprSession session,
IoBuffer buf,
int length)
Write a sequence of bytes to a IoSession , means to be called when
a session was found ready for writing. |
| Method parameters in org.apache.mina.transport.socket.apr with type arguments of type AprSession | |
|---|---|
protected AprSession |
AprSocketAcceptor.accept(IoProcessor<AprSession> processor,
Long handle)
Accept a client connection for a server socket and return a new IoSession
associated with the given IoProcessor |
protected AprSession |
AprSocketConnector.newSession(IoProcessor<AprSession> processor,
Long handle)
Create a new IoSession from a connected socket client handle. |
| Constructor parameters in org.apache.mina.transport.socket.apr with type arguments of type AprSession | |
|---|---|
AprSocketAcceptor(Executor executor,
IoProcessor<AprSession> processor)
Constructor for AprSocketAcceptor with a given Executor for handling
connection events and a given AprIoProcessor for handling I/O events, useful for
sharing the same processor and executor over multiple IoService of the same type. |
|
AprSocketAcceptor(IoProcessor<AprSession> processor)
Constructor for AprSocketAcceptor with default configuration but a
specific AprIoProcessor , useful for sharing the same processor over multiple
IoService of the same type. |
|
AprSocketConnector(Executor executor,
IoProcessor<AprSession> processor)
Constructor for AprSocketConnector with a given Executor for handling
connection events and a given IoProcessor for handling I/O events, useful for sharing
the same processor and executor over multiple IoService of the same type. |
|
AprSocketConnector(IoProcessor<AprSession> processor)
Constructor for AprSocketConnector with default configuration but a
specific IoProcessor , useful for sharing the same processor over multiple
IoService of the same type. |
|
||||||||||
| PREV NEXT | FRAMES NO FRAMES |


@* * Copyright 2010-2013 Artima, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import controllers.Application.latestScaladocFor192 @userGuidePage("Writing ScalaCheck-style properties") {
ScalaTest supports two styles of property-based testing: ScalaTest style and ScalaCheck style. Both approaches use ScalaCheck to actually check properties when tests are run. This page describes the ScalaCheck style. (For information on the tradeoffs of each style, see the Selecting a property-based testing style section below.)
To write properties in the ScalaCheck style, mix in trait Checkers
or
import the members of its companion object. Trait Checkers
contains several check
methods that perform ScalaCheck property checks. If ScalaCheck finds a test case for which a property doesn't
hold, the problem will be reported as a ScalaTest test failure.
To use ScalaCheck, you specify properties and, in some cases, generators that generate test data. You need not always
create generators, because ScalaCheck provides many default generators for you that can be used in many situations.
ScalaCheck will use the generators to generate test data and with that data run tests that check that the property holds.
Property-based tests can, therefore, give you a lot more testing for a lot less code than assertion-based tests.
Here's an example of using ScalaCheck from a JUnitSuite
:
import org.scalatest.junit.JUnitSuite import org.scalatest.prop.Checkers import org.scalacheck.Arbitrary._ import org.scalacheck.Prop._
class MySuite extends JUnitSuite with Checkers { @Test def testConcat() { check((a: List[Int], b: List[Int]) => a.size + b.size == (a ::: b).size) } }
The check
method, defined in Checkers
, makes it easy to write property-based tests inside
ScalaTest, JUnit, and TestNG test suites. This example specifies a property that List
's :::
method
should obey. ScalaCheck properties are expressed as function values that take the required
test data as parameters. ScalaCheck will generate test data using generators and
repeatedly pass generated data to the function. In this case, the test data is composed of integer lists named a
and b
.
Inside the body of the function, you see:
a.size + b.size == (a ::: b).size
The property in this case is a Boolean
expression that will yield true if the size of the concatenated list is equal
to the size of each individual list added together. With this small amount
of code, ScalaCheck will generate possibly hundreds of value pairs for a
and b
and test each pair, looking for
a pair of integers for which the property doesn't hold. If the property holds true for every value ScalaCheck tries,
check
returns normally. Otherwise, check
will complete abruptly with a TestFailedException
that
contains information about the failure, including the values that cause the property to be false.
For more information on using ScalaCheck properties, see the documentation for ScalaCheck, which is available from http://code.google.com/p/scalacheck/.
To execute a suite that mixes in Checkers
with ScalaTest's Runner
, you must include ScalaCheck's jar file on the class path or runpath.
The property checks performed by the check
methods of this trait can be flexibly configured via the services
provided by supertrait Configuration
. The five configuration parameters for property checks along with their
default values and meanings are described in the following table:
| Configuration Parameter | Default Value | Meaning |
|---|---|---|
| minSuccessful | 100 | the minimum number of successful property evaluations required for the property to pass |
| maxDiscarded | 500 | the maximum number of discarded property evaluations allowed during a property check |
| minSize | 0 | the minimum size parameter to provide to ScalaCheck, which it will use when generating objects for which size matters (such as strings or lists) |
| maxSize | 100 | the maximum size parameter to provide to ScalaCheck, which it will use when generating objects for which size matters (such as strings or lists) |
| workers | 1 | specifies the number of worker threads to use during property evaluation |
The check
methods of trait Checkers
each take a PropertyCheckConfig
object as an implicit parameter. This object provides values for each of the five configuration parameters. Trait Configuration
provides an implicit val
named generatorDrivenConfig
with each configuration parameter set to its default value.
If you want to set one or more configuration parameters to a different value for all property checks in a suite you can override this
val (or hide it, for example, if you are importing the members of the Checkers
companion object rather
than mixing in the trait.) For example, if
you want all parameters at their defaults except for minSize
and maxSize
, you can override
generatorDrivenConfig
, like this:
implicit override val generatorDrivenConfig = PropertyCheckConfig(minSize = 10, maxSize = 20)
Or, if hide it by declaring a variable of the same name in whatever scope you want the changed values to be in effect:
implicit val generatorDrivenConfig = PropertyCheckConfig(minSize = 10, maxSize = 20)
In addition to taking a PropertyCheckConfig
object as an implicit parameter, the check
methods of trait
Checkers
also take a variable length argument list of PropertyCheckConfigParam
objects that you can use to override the values provided by the implicit PropertyCheckConfig
for a single check
invocation. You place these configuration settings after the property or property function, For example, if you want to
set minSuccessful
to 500 for just one particular check
invocation,
you can do so like this:
check((n: Int) => n + 0 == n, minSuccessful(500))
This invocation of check
will use 500 for minSuccessful
and whatever values are specified by the
implicitly passed PropertyCheckConfig
object for the other configuration parameters.
If you want to set multiple configuration parameters in this way, just list them separated by commas:
check((n: Int) => n + 0 == n, minSuccessful(500), maxDiscarded(300))
The previous configuration approach works the same in Checkers
as it does in GeneratorDrivenPropertyChecks
.
Trait Checkers
also provides one check
method that takes an org.scalacheck.Test.Params
object,
in case you want to configure ScalaCheck that way.
import org.scalacheck.Prop import org.scalacheck.Test.Params import org.scalatest.prop.Checkers._
check(Prop.forAll((n: Int) => n + 0 == n), Params(minSuccessfulTests = 5))
For more information, see the documentation
for supertrait Configuration
.
For the ScalaTest style, you mix in
trait GeneratorDrivenPropertyChecks
and
express properties with whenever
clauses and matcher expressions. For the ScalaCheck style, you mix in trait
Checkers
and
express properties as boolean expressions, using ScalaCheck's native operators such as ==>
, :|
, |:
, and so on, as
needed. The purpose of the ScalaTest style is to make property-based
testing more consistent with the other styles of testing that ScalaTest supports.
GeneratorDrivenPropertyChecks
is an alternative to Checkers
. Both are essentially front-ends to ScalaCheck, and both require that ScalaCheck's jar file be on the class path. The difference is Checkers
facilitates the traditional ScalaCheck style of writing properties, whereas GeneratorDrivenPropertyChecks
facilitates a ScalaTest style of writing properties that takes advantage of ScalaTest's assertions and matchers. To see the difference, consider an example written in each style. With Checkers
you'd usually write a property function like this:
check { (n: Int) => n > 1 ==> n / 2 > 0 }
This is the native ScalaCheck style: you write a function that takes some data, then use that data in a boolean expression, returning the result. If the property is only valid for a subset of the full range of values of the types being passed (for example, in this case the expression only makes sense for integers greater than one), you would use the implication operator ==>
. The code, n > 1 ==>
in front of n / 2 > 0
essentially means that whenever n > 1
, n / 2
should be greater than 0
. In the ScalaTest property style you use the word whenever
instead of ==>
and either an assertion or matcher expression instead of a boolean expression:
forAll { (n: Int) => whenever (n > 1) { n / 2 should be > 0 } }
The two main goals I have for providing a ScalaTest style of writing properties are consistency and clarity. By allowing people to write properties similarly to how they write regular unit test, I'm hoping it will make property-based tests easier to write and read, and thereby make property-based testing more accessible to the many programmers who have never seen it before. That's the consistency.
Clarity is a general goal I have when I make design decisions for ScalaTest. When someone looks at some ScalaTest code written by someone else, to the extent possible I want them to be able to understand the intent of the programmer without having to look anything up in the ScalaTest documentation. I want it to be plainly obvious. The ==>
operator does not pass that test, but whenever
does. Also I think readers may find it hard to parse properties where =>
is near ==>
because they look so similar. Moreover, things can get harder to read with the traditional ScalaCheck style when properties get more complex. Here's a Checkers
example inspired by code in the ScalaCheck documentation describing ScalaCheck labels:
def myMagicFunction(n: Int, m: Int) = n + m check { (m: Int, n: Int) => val res = myMagicFunction(n, m) (res >= m) :| "result > #1" && (res >= n) :| "result > #2" && (res < m + n) :| "result not sum" }
Like ==>
, the :|
operator doesn't pass the test of not needing to look things up in the documentation. What :|
(and its cousin, |:
) does is attach a string label to a part of the boolean expression. That way if a complex property fails, you can more easily figure out which part of the expression caused the failure. When you check the above labeled property it will fail with arguments (0, 0) and indicate the label of the failing part was "result not sum"
.
By contrast, the equivalent property in the ScalaTest style might look like this:
forAll { (m: Int, n: Int) => val res = myMagicFunction(n, m) res should be >= m res should be >= n res should be < m + n }
I think this style is easier to both write and read. When it fails, it tells you the failing arguments were (0, 0), gives you a failure message that reads, "0 was not less than 0
," and provides the line number of the failing expression, which is res should be < m + n
. Alternatively, you could write it this way:
forAll { (m: Int, n: Int) => val res = myMagicFunction(n, m) res should (be >= m and be >= n and be < m + n) }
This form would also fail indicating the args were (0, 0), giving the line number of the offending matcher expression and failure message that reads, "0 was greater than or equal to 0, and 0 was greater than or equal to 0, but 0 was not less than 0
." So either way you write this property in ScalaTest style, it is pretty easy to figure out what went wrong, and you figure it out the same way you would for regular (non-property-based) tests.
Next, learn about ScalaTest's philosophy and design.


A Roboticst and a Computer Vision EngineerCertified Deep Learning EngineerEmbedded Software Developer by Profession
About Me
I obtained a bachelors degree in Electronics and Communication Engineering from RGUKT RKV in 2015. Since then, I have been working as a Embedded Software Application Developer in McAfee Software India Pvt. Ltd. (Intel Security).
Built a model to predict the value of a given house in the Boston real estate market using various statistical analysis tools. Identified the best price that a client can sell their house utilizing machine learning.
Statistical Analysis, Metric Performance, Cross Validation, Bias/Underfitting & Variance Overfitting, Learning Curves, Model Complexity, Model Tuning
Reviewed unstructured data to understand the patterns and natural categories that the data fits into. Used multiple algorithms and both empirically and theoretically compared and contrasted their results. Made predictions about the natural categories of multiple types in a dataset, then checked these predictions against the result of unsupervised analysis.
Clustering, PCA, SKLearn, Feature Selection, Data Visualization
Investigated factors that affect the likelihood of charity donations being made based on real census data. Developed a naive classifier to compare testing results to. Trained and tested several supervised machine learning models on preprocessed census data to predict the likelihood of donations. Selected the best model based on accuracy, a modified F-scoring metric, and algorithm efficiency.
Sklearn, Classification, Model Fitting and Prediction, Decision Trees, Neural Networks, Support Vector Machines, Naïve Bayes, K-Nearest Neighbors, Ada Boosting
Applied reinforcement learning to build a simulated vehicle navigation agent. This project involved modeling a complex control problem in terms of limited available inputs, and designing a scheme to automatically learn an optimal driving strategy based on rewards and penalties.
Reinforcement Learning, Q – Learning, Optimization, Modeling, Model Tuning
Applied reinforcement learning to build a simulated vehicle navigation agent. This project involved modeling a complex control problem in terms of limited available inputs, and designing a scheme to automatically learn an optimal driving strategy based on rewards and penalties.
Reinforcement Learning, Q – Learning, Optimization, Modeling, Model Tuning
Applied reinforcement learning to build a simulated vehicle navigation agent. This project involved modeling a complex control problem in terms of limited available inputs, and designing a scheme to automatically learn an optimal driving strategy based on rewards and penalties.
Reinforcement Learning, Q – Learning, Optimization, Modeling, Model Tuning
Applied reinforcement learning to build a simulated vehicle navigation agent. This project involved modeling a complex control problem in terms of limited available inputs, and designing a scheme to automatically learn an optimal driving strategy based on rewards and penalties.
Reinforcement Learning, Q – Learning, Optimization, Modeling, Model Tuning
Applied reinforcement learning to build a simulated vehicle navigation agent. This project involved modeling a complex control problem in terms of limited available inputs, and designing a scheme to automatically learn an optimal driving strategy based on rewards and penalties.
Reinforcement Learning, Q – Learning, Optimization, Modeling, Model Tuning
Applied reinforcement learning to build a simulated vehicle navigation agent. This project involved modeling a complex control problem in terms of limited available inputs, and designing a scheme to automatically learn an optimal driving strategy based on rewards and penalties.
Reinforcement Learning, Q – Learning, Optimization, Modeling, Model Tuning


Preparation time
less than 30 mins
Cooking time
less than 10 mins
Serves
Makes 24
Mary Berry's miniature beef-and-horseradish tartlets are perfect as Christmas party canapés.
Equipment and preparation: for this recipe you will need a 24-hole mini muffin tin or two 12-hole ones.
Each serving provides 35kcal, 1.5g protein, 3g carbohydrate (of which 0.7g sugars), 2g fat (of which 0.8g saturates), 0.1g fibre and 0.1g salt.
Preheat the oven to 200C/180C Fan/Gas 6.
Brush both sheets of the filo pastry all over with the melted butter, then place them side by side. Using a 5cm/2in square pastry cutter, or a sharp knife, cut 25 squares from each sheet of pastry (there should be exactly the right amount of pastry to yield 50 squares with no trimmings).
Take one pastry square and place another on top of it, turning the top layer at an angle to create a star shape. Repeat this process with all of the pastry squares to create 25 stars.
Press one pastry star, buttered-side down, into each of the moulds of the muffin tin to create 24 mini tartlet cases. (The remaining pastry star can be cooked separately in an individual muffin mould, or discarded.)
Bake the tartlet cases in the oven for 5-10 minutes, or until golden-brown and crisp. Remove from the oven and carefully transfer to a wire rack to cool completely.
In a bowl, season the fillet steak cubes with salt and freshly ground black pepper, then drizzle over the honey and mix well to cover the meat.
Heat the oil in a frying pan over a very high heat, then fry the steak for 1-2 minutes on all sides, or until browned all over but still pink in the middle. Transfer to a plate and set aside to rest for a minute or two.
Spoon small, equally-sized dollops of the horseradish into the cooled pastry cases, then sit one warm cube of fillet steak on top of each. Sprinkle each tartlet with a pinch of chopped parsley just before serving.


class Inferno::Sequence::SequenceBaseExtension
Adds functionality on top of SequenceBase
Public Class Methods
initializer appeals to parent initializer
# File sequence_base_extension.rb, line 15 def initialize(instance, client, disable_tls_tests = false, sequence_result = nil, metadata_only = false) super(instance, client, disable_tls_tests, sequence_result, metadata_only) end
Public Instance Methods
Returns true
if param
is nil
or empty, false
otherwise
# File sequence_base_extension.rb, line 248 def blank?(param) param.nil? || param.empty? end
Checks validity of profiles by testing all resources against the provided params. (Defining a param will never increase the scope of the check, in fact in most cases it will narrow the scope)
-
resources
the array of resources to check a subset of. -
klasses
the array of klasses that all checked resources must be instances of. -
profiles
the array of profile urls to check the resources against. -
When any of these parameters are nil or empty, it is assumed to apply to the entire set of it's kind (i.e. a nil or empty
klasses
means all available klasses).
This means there are 2^3 (8) potential cases for using this method:
-
When no params are defined (all are or empty): this will check every resource in the server, regardless of klass, against all profiles they claim
-
When only
profiles
is defined: this will check every resource in the server, regardless of klass, against the defined profiles -
When only
klasses
is defined: this will check every resource in the server of the specified klasses against all profiles they claim -
When only
klass
andprofile
are defined: this will check every resource in the server of the specified klasses against the defined profiles -
When only
resources
is defined: this will check every provided resource, regardless of klass, against any profile they might claim -
When only
resources
andprofile
are defined: this will check every provided resource, regardless of klass, against the defined profiles -
When only
resources
andklass
and defined: this will check every provided resource of the specified klasses, against any profile they might claim -
When all params are defined: this will check every provided resource of the specified klasses against the defined profiles
Returns array of strings describing each inconsistency between a resource and it's profile encountered. This means an empty array indicates a fully consistent check.
# File sequence_base_extension.rb, line 103 def check_profiles(resources = nil, klasses = nil, profiles = nil) resources = get_resource_intersection(resources, klasses, profiles) profiles = coerce_to_a(profiles) profiles.uniq! if profiles errors = {} profileSDs = [] if blank?(profiles) resources.each { |resource| profileSDs.push(resource.meta.profile) } profileSDs.flatten! profileSDs.uniq! profileSDs.collect!{ |profile| Inferno::ValidationUtil.get_profile(profile) } else profileSDs = profiles.collect{ |profile| Inferno::ValidationUtil.get_profile(profile) } end profileSDs.compact! if profiles && profileSDs.length != profiles.length errors["params"] = "Not all profile urls in the profiles param are in Inferno" end profileSDs.each do |sd| errArr = resources.collect{ |resource| err = sd.validate_resource(resource) blank?(err) ? nil : {resource.id.to_s => err} } errArr.compact! errors[sd.name] = errArr unless blank?(errArr) end errors end
Checks validity of resources by checking if they conform to their definitions from HL7 (Defining a param will never increase the scope of the check, in fact in most cases it will narrow the scope)
-
resources
the array of resources to check a subset of. -
klasses
the array of klasses that all checked resources must be a part of. -
When either of these parameters are nil or empty, it is assumed to apply to the entire set of it's kind (i.e. a nil or empty
klasses
means all available klasses).
This means there are 2^2 (4) potential cases for using this method:
-
When no params are defined (all are nil or empty): this will check the validity of every resource in the server, regardless of klass
-
When only
klasses
is defined: this will check the validity of every resource in the server of the specified klasses -
When only
resources
is defined: this will check the validity of every provided resource, regardless of klass -
When all params are defined: this will check the validity of every provided resource of the specified klasses
Returns array of strings describing each inconsistency between a resource and its HL7 definition. This means an empty array indicates a fully consistent check.
# File sequence_base_extension.rb, line 161 def check_validity(resources = nil, klasses = nil) resources = get_resource_intersection(resources, klasses) errors = {} resources.each do |resource| errArr = resource.validate.values errors[resource.id] = errArr unless blank?(errArr) end errors end
Returns nil
if param
is falsy. If param
is truthy, returns param.clone.to_a
if possible, otherwise returns param
as the only element in a new Array
# File sequence_base_extension.rb, line 256 def coerce_to_a(param) return nil unless param param.respond_to?('to_a') ? param.clone.to_a : Array.[](param) end
Returns true
if str
conforms to HL7's dateTime
format, false
otherwise
# File sequence_base_extension.rb, line 239 def conforms_to_dateTime_format(str) dateTimeRegex = /\A(?:(?!0000)\d{4})(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1])(T([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d+)?(Z|(\+|-)((0\d|1[0-3]):[0-5]\d|14:00)))?)?)?\z/ dateTimeRegex.match(str) end
Retrieves all bundles from server when requesting every resource of each type in the klasses
array. If klasses
is undefined or empty, it defaults to nil, which will return bundles of every resource with no regard for type.
Returns [reply, reply, ...]
(array
of every unchanged server response), nil
if no replies
# File sequence_base_extension.rb, line 46 def get_all_replies(klasses = nil) klasses = coerce_to_a(klasses) replies = [] if !blank?(klasses) klasses.each do |klass| replies.push(@client.read_feed(klass)) while !replies.last.nil? replies.push(@client.next_page(replies.last)) end end else<EMAIL_ADDRESS>end replies.compact! blank?(replies) ? nil : replies end
Calls get_all_replies
with klasses
for server's responses. Filters responses to return an array where, for every klass indicated in the klasses
array, every applicable resource from the server is repesented in an element. If klasses
is undefined or empty, it defaults to nil, which will result in returning every resource available in the server.
Returns [resource, resource, ...]
(groomed array of every resource of any provided klass provided by the server), nil
if no replies
# File sequence_base_extension.rb, line 28 def get_all_resources(klasses = nil) replies = get_all_replies(klasses) return nil unless replies resources = [] replies.each do |reply| resources.push(reply.resource.entry.collect{ |singleEntry| singleEntry.resource }) end resources.compact! resources.flatten(1) end
Retrieve set of resources based on the intersection of the params. (Defining a param will never increase the resource set, in fact in most cases it will narrow it)
-
resources
the array of resources to start with. -
klasses
the array of klasses that all retrieved resources must be an instance of. -
profiles
the array of profile urls that all retrieved resources must claim in their metadata. -
When any of these parameters are nil or empty, it is assumed that all associated options are acceptable. (i.e. a nil or empty
klasses
means all possible klasses).
This means there are 2^3 (8) potential cases for using this method:
-
When no params are defined (all are nil or empty): this will retrieve every resource from the server, regardless of klass and profile
-
When only
profiles
is defined: this will retrieve every resource from the server, regardless of klass, that claims the identified profiles -
When only
klasses
is defined: this will retrieve every resource from the server of the specified klasses, regardless of the profile -
When only
klass
andprofile
are defined: this will retrieve every resource from the server of the specified klasses that claim the identified profiles -
When only
resources
is defined: this will return every provided resource, regardless of klass and profile (so it will just returnresources
unmodified) -
When only
resources
andprofile
are defined: this will return every provided resource, regardless of klass, that claims the identified profiles -
When only
resources
andklass
and defined: this will return every provided resource of the specified klasses, regardless of the profile -
When all params are defined: this will return every provided resource of the specified klasses that claims the identified resource
Returns an array of the requested resources, derived from the intersection of the three params.
# File sequence_base_extension.rb, line 210 def get_resource_intersection(resources = nil, klasses = nil, profiles = nil) resources = coerce_to_a(resources) klasses = coerce_to_a(klasses) profiles = coerce_to_a(profiles) if blank?(resources) resources = get_all_resources(klasses) elsif !blank?(klasses) resources.select!{ |resource| klasses.include?(resource.class) } end unless blank?(profiles) resources.select!{ |resource| !blank?(profiles & ((resource.meta.nil? || blank?(resource.meta.profile)) ? [] : resource.meta.profile)) } end resources end
Returns how many resources of the type klass
are stored in server
# File sequence_base_extension.rb, line 231 def how_many(klass) JSON.parse(@client.raw_read(resource: klass, summary: "count").response[:body])["total"].to_i end


Source code for module_amoebae_nex_to_hmm
#!/usr/bin/env python3
# Copyright 2018 Lael D. Barlow
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
"""This module is for making HMMs from alignment files in nexus format by first
converting them to aligned fasta files and then running hmmbuild.
"""
import os
import sys
import subprocess
from module_afa_to_nex import nex_to_afa, delete_extra_mesquite_lines
[docs]def nex_to_hmm(infilepath, outfilepath=None):
"""Takes a nexus file and outputs an hmm."""
# Set output dir to input dir by default.
if outfilepath is None:
outfilepath = infilepath.rsplit('.', 1)[0] + '.hmm'
# ?
outdirpath = os.path.dirname(infilepath)
# Delete extra blocks added by Mesquite, if present.
delete_extra_mesquite_lines(infilepath)
# Convert nex to afa.
outafapath1 = os.path.join(outdirpath,
os.path.basename(infilepath).replace('.nex', '_tmp.afa'))
nex_to_afa(infilepath, outafapath1)
# Replace '?' characters with 'X'.
outafapath2 = os.path.join(outdirpath,
os.path.basename(infilepath).replace('.nex', '.afa'))
with open(outafapath1) as infh1, open(outafapath2, 'w') as o:
for i in infh1:
if not i.startswith('>'):
# Replace problematic characters with 'X'
o.write(i.replace('?', 'X'))
else:
o.write(i)
# Call hmmbuild to make HMM.
subprocess.call(["hmmbuild", outfilepath,
outafapath2])
# Delete intermediate afa file.
os.remove(outafapath1)
os.remove(outafapath2)
[docs]def afa_to_hmm(infilepath, outfilepath=None):
"""Takes a aligned fasta file and outputs an hmm."""
# Set output dir to input dir by default.
if outfilepath is None:
outfilepath = infilepath.rsplit('.', 1)[0] + '.hmm'
# ?
outdirpath = os.path.dirname(infilepath)
# Replace '?' characters with 'X'.
temp_afa_1 = infilepath.rsplit('.', 1)[0] + '_temp1.afa'
with open(infilepath) as infh1, open(temp_afa_1, 'w') as o:
for i in infh1:
if not i.startswith('>'):
# Replace problematic characters with 'X'
o.write(i.replace('?', 'X'))
else:
o.write(i)
# Call hmmbuild to make HMM.
subprocess.call(["hmmbuild", outfilepath,
temp_afa_1])
# Delete intermediate afa file.
os.remove(temp_afa_1)


A 2,200 miles/3,500 km un-routed race from the steeps of the Himalayan mountains all the way to the tropical shores at the apex of the Indian subcontinent. From Shillong (Megalaya) to Kochi (Kerala).
With the engineering's highest life form, the tri-wheeled Demi-god vehicle of vehicles, a rickshaw named "Tornado".
4th - 19th August if the spirits of chilli and carburetors are in our side.

"We must save every rainforest in the world so future generations have somewhere to get stuck". That's Cool Earth mantra, and we will try to support them with your donations.
Help us to make this adventure less no-sense, supporting Cool Earth and local local communities in Peru, Republic of Congo or New Guinea
For that purpose we have a plain painted Rickshaw waiting for your message.
You can keep an eye on what is going on with us and even track our position!


| ComputationStatistics |
The ComputationStatistics class : This is the class to implement the computation statistics of a myvelib system or network
|
| InitialSetup |
The InitialSetup class : This is the class to implement the initial setup when creating a new myvelib system or network
|
| InitialSetupTest |
|
| PlanningRide |
The PlanningRide class : This is the class to implement the planning simulations from the planning package when creating a new journey ride for a user
|
| RentalBicycle |
The RentalBicycle class : This class is responsible to implement and test the basic packages that implement the renting system
|
| RentalBicycleTest |
|
| SetupApp |
The SetupApp class from core.setup: This is the class to implement the setup methodology when creating a new myvelib system or network.
|
| VisualizationStatistics |
The VisualizationStatistics class : It is responsible to test and implement the visualization part of the project
|


EBD - Easton Bible DIctionary
Botch
BOTCH
"BOTCH "the name given in
Deuteronomy 28:27, 35
to one of the Egyptian plagues (
Exodus 9:9
). The word so translated is usually rendered“boil” (q.v.).
"BOTCH "the name given in Deuteronomy 28:27, 35 to one of the Egyptian plagues (Exodus 9:9). The word so translated is usually rendered“boil” (q.v.).


object Easing
Proxy object to scope adding inbuilt interpolators provided with the support library.
val accelerateEasing: FastOutLinearInInterpolator
Material Design standard's Accelerate Easing(FastOutLinearInInterpolator) |
|
val decelerateEasing: LinearOutSlowInInterpolator
Material Design standard's Decelerate Easing(LinearOutSlowInInterpolator) |
|
val standardEasing: FastOutSlowInInterpolator
Material Design standard's Standard Easing(FastOutSlowInInterpolator) |


The Start of Something Great
Hello there, awesome person!
Bespoke Post
Adidas
Frye Company
Red Bubble


PURPLE NOON (1960) A film review by Edwin Jahiel Copyright 1996 Edwin Jahiel
PURPLE NOON (PLEIN SOLEIL) (France, 1960) *** Directed by Rene Clement. Written by Rene Clement and Paul Gegauff from the novel "The Talented Mr. Ripley" by Patricia Highsmith. Photography, Henri Decae. Art design, Paul Bertrand. Opening credits, Maurice Binder. Choreography, Jean Guelis. Music, Nino Rota. Produced by Raymond Hakin and Robert Hakim. Cast: Alain Delon (Tom Ripley),Maurice Ronet(Philippe Greenleaf),Marie Laforet (Marge),Elvire Popesco(Mme. Popova), Erno Crisa (Inspector Riccordi), Frank Latimore(O'Brien), Billy Kearns(Freddy),Ave Ninchi(Signora Gianna),Viviane Chantel( Belgian woman). In French with subtitles.116 min. PG-13. 25 and 33 yrs old
The French title means Full Sun, which admittedly wouldn't sound too good in English. But at least "Full" has more implications than "Purple" which baffles me. The reference is to the strong summer sun of Italy, which at one point burns badly the back of one of the main characters (he recovers overnight!) and, in general, like a full moon, makes people do unusual and extreme things.
Essentially this is a two-and--half characters yarn. The two are Tom Ripley and Philippe (sic) Greenleaf. The half is Marge, Philippe's girlfriend who has no real personality -- or a last name, for that matter. The script is faithfully based on "TheTalented Mr.Ripley," a novel by Patricia Highsmith whose books were also adapted for Hitchcock's "Strangers on a Train" (1951). Her "Ripley's Game" became the Wim Wenders movie "The American Friend" (1977) in which Dennis Hopper plays Tom Ripley.(I cannot connect the two cine-Ripleys with each another).
Tom is played by Alain Delon, then 25 and well on his way to becoming a heartthrob and a mega-star. That same year(1960), he was Rocco in "Rocco and His Brothers," and in 1963, he had the second big part in "The Leopard." Both films are classics by Luchino Visconti.
Philippe is played by Maurice Ronet, then 33. He was another hearthrob whose career was shorter than Delon's. He made fewer movies and died in 1983.
The copy now playing in the US is a reissue whose colors are good in some scenes, a bit faded in others. The photography and the compositions are excellent, thanks to master cinematographer Henri Decae and no doubt because director Clement had himself worked behind the camera.
Production values are very good. Nino Rota's music is unlike the splendidly Italian, familiar scores he wrote for Italian movies (including many Fellinis) and for all the "Godfather" films. It is interestingly "modern" and jolting, with small incursions into Italianate passages.
We meet Philippe and Tom in a Rome cafe on the chic Via Veneto. They seem to be best friends, look beautifully sun-tanned and fit (the actors' age difference is hardly noticeable), yet there's something about their relationship that is peculiar. Itmakes the viewer uncomfortable, as in the way Philippe uses Tom as an errand boy, or the cavalier fashion with which they speak about women or treat them.There is much to mine here for a feminist analysis.
Philippe wonders what gift he can give Marge. "A book on [painter] Fra Angelico" says Tom. "But she is writing one." "So, all she's got to do is to copy" retorts Tom, and he is sent to get the book. Both suggestion and action are entirely in the spirit of the movie.
(In this sequence, when an acquaintance stops by, his barely glimpsed,silent companion is,I am sure, the uncredited, Austrian-born movie actress Romy Schneider. She had already been in many pictures, many of them German-speaking, but did not become an international star and the darling of the European public until the early 60s).
The men sound and behave like kinky playboys on the loose within a Dolce Vita society. Philippe is the rich son of a wealthy American who has offered penniless Tom $5,000 if he can deliver Philippe back to San Francisco. The "boys" do much joking about this, followed by callousness --indeed cruelty--as the men buy a white cane off a blind man, play tricks on an easy-to-conquer lady, then drop her. Menacing, unhealthy undertones are ever present.
When we meet Marge we also see the angels in the book on Fra Angelico. Sharp eyes might notice the hint that the two male "friends" are devils who play cat-and-mouse games with each other.Tom seems to covet Marge, Philippe knows it. Entering his own bedroom, and finding Tom trying out his clothes and imitating his voice, he rebukes him nastily. Tom, on the other hand, bit by bit lets us understand that he would like to take Philippe's place, girl, bank account and all--even to impersonate him.
The trio go on a trip on Philippe's sailboat "Marge." There, everyone lies to everyone else. A current of crypto-homosexual tensions may be sensed. Philippe first mistreatsTom, then, in one of his moods, he throws Marge's manuscript in the sea. She leaves the boat. End of Part One.
In Part Two many much happens to keep you in merciless suspense. Violence escalates along with major complications, unexpected developments, changes,disguises,role-playing and surprises.
At no time do we feel any sympathy for any of the main characters. But then morality is not our concern, while the thriller side of the film is, in beautiful, warm Italy, skillfully treated with clinical coldness.
The thriller is strong and good, in part because of the time devoted to building up the characters. That they remain ciphers to the end is no defect. Where the minuses come in is in the absence of leavening humor. The film shares this characteristic with many Continental thrillers that have not learned the advantage of using humor, as Alfred Hitchcock did.
Clement, however, chose, matched and directed his two male protagonists very well. They both have a pretty-boy physique that only semi-masks their potential for nastiness. (This is a trait of both Ronet and Delon in several of their other movies). But for American audiences to accept them as Americans requires more faith than is possible.
One flaw may affect only those viewers who like matters to be logical. The plot has several improbabilities a well as much vagueness about time and space, such as several instant, credibility-taxing changes of abodes.Yet since the tempo is minutely calculated to keep picking up speed until it reaches breathlessness, much of the audience is kept too busy to spot the holes in the story.
Director Rene Clement died in March 1996. His obituary in the New York Times rightly mentions his Oscar-winning, 1952 "Forbidden Games" as the film that Clement will be mostly remembered for. It is about a little girl orphaned when the Germans were invading France in World War II and strafing fleeing civilians on country roads. The French critics would agree but also call it a tie with "The Battle of the Rails," which dealt in documentary fashion with the same war and railway workers sabotaging German trains during the Occupation. The French would rate "Purple Noon" right after those two.
Other than the above, among Clement's two dozen movies, few had an unconditionally positive critical reception."Gervaise," "The Damned," "The Walls of Malapaga" and " Monsieur Ripois" came closest. He also made the too ambitious and too loose-jointed "Is Paris Burning?" with a huge number of international stars.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Services
Massage
Come enjoy a relaxing Massage!
Products
Buy our fresh and Natural Products!
Hand Care
We do pedicure and manicures with every purchase!
Hair Care
We help with healthy scalp and hair as well as styling!
Spa Highlights
Healthy Ingredients
I'm baby mustache snackwave pickled truffaut humblebrag scenester vinyl swag activated charcoal tousled chillwave...
Calming Atmosphere
IFreegan fanny pack gochujang plaid vegan fam intelligentsia. Kombucha mixtape neutra, craft photo booth...
Gifts & Hours
Gifts
Hours
- Monday 6 AM - 5 PM
- Tuesday 7 AM - 7 PM
- Wednesday 7 AM - 7 PM
- Thursday 7 AM - 7 PM
- Friday 9 AM - 4 PM
- Friday 7 AM - 7 PM


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object core.grammar.ElementImpl core.grammar.ProductionImpl
public class ProductionImpl
Class that offers a concrete implementation of the interface Production. It belongs to the Public API.
| Constructor Summary | |
|---|---|
ProductionImpl(int l,
int id,
java.lang.String symbol)
Constructor that receives the amount of symbols of the right side of the Production. |
|
ProductionImpl(NonTerminal left,
int l,
int id,
java.lang.String symbol)
Constructor that receives the NonTerminal symbol of the left side of the Production, and the amount of symbols of the right side of the Production. |
| Method Summary | |
|---|---|
boolean |
addRightElement(Element e,
int pos)
Insert the symbol that is in the position pos at the right side of the Production. |
void |
clearProduction()
Clear the structures used by the Production Object. |
Production |
cloneProduction()
Clone the Production returning a new one. |
NonTerminal |
getLeft(Grammar g)
|
java.util.Collection<NonTerminal> |
getNonTerminalsRight(Grammar g)
|
java.util.Collection<java.lang.Integer> |
getRightPosition(Element e)
If the Element e belongs to the right side of the Production, then returns an ordered Collection with the positions where the Element appears, oterwise returns NULL. |
java.util.Collection<Element> |
getRights(Grammar g)
|
java.util.Collection<Terminal> |
getTerminalsRight(Grammar g)
|
void |
setLeft(NonTerminal nt)
Set the NonTerminal nt as the left side symbol of the Production. |
| Methods inherited from class core.grammar.ElementImpl |
|---|
getId, getSymbol, setId, setSymbol |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface core.grammar.Element |
|---|
getId, getSymbol, setId, setSymbol |
| Constructor Detail |
|---|
public ProductionImpl(int l, int id, java.lang.String symbol) throws GrammarExceptionImpl
l
- The amount of symbols of the right side of the Production.id
- The ID of the Production.symbol
- The symbol associated to the Production.
*
GrammarExceptionImpl
public ProductionImpl(NonTerminal left, int l, int id, java.lang.String symbol) throws GrammarExceptionImpl
left
- The NonTerminal symbol of the left side of the Production.l
- The amount of symbols of the right side of the Production.id
- The ID of the Production.symbol
- The symbol associated to the Production.
*
GrammarExceptionImpl
| Method Detail |
|---|
public void clearProduction()
Production
clearProduction
in interface Production
public boolean addRightElement(Element e, int pos)
Production
addRightElement
in interface Production
e
- The symbol that is at the right side of the Production.pos
- The absolute position (starting in 1) of the symbol at the right side of the
Production.public NonTerminal getLeft(Grammar g)
getLeft
in interface Production
g
- The Grammar associated to the Production.
Returns the NonTerminal symbol that is in the left side of the Production.
It does not belong to the Public API.public void setLeft(NonTerminal nt) throws GrammarExceptionImpl
Production
setLeft
in interface Production
nt
- The NonTerminal symbol to be associated to the Production.
GrammarExceptionImpl
public java.util.Collection<NonTerminal> getNonTerminalsRight(Grammar g) throws GrammarExceptionImpl
getNonTerminalsRight
in interface Production
g
- The Grammar associated to the Production.
Returns a collection with the NonTerminals that are at the right side of the
Production.
Throws a GrammarException if it isnīt possible to add a NonTerminal to the Collection.
Return NULL if there arenīt symbols at the right side.
GrammarExceptionImpl
public java.util.Collection<Terminal> getTerminalsRight(Grammar g) throws GrammarExceptionImpl
getTerminalsRight
in interface Production
g
- The Grammar associated to the Production.
Returns a collection with the Terminals that are at the right side of the
Production.
Throws a GrammarException if it isnīt possible to add a Terminal to the Collection.
Return NULL if there arenīt symbols at the right side.
GrammarExceptionImpl
public java.util.Collection<Element> getRights(Grammar g) throws GrammarExceptionImpl
getRights
in interface Production
g
- The Grammar associated to the Production.
Returns a Collection with all the symbols at the right side with the order preserved.
Throws a GrammarException if it isnīt possible to add an Element to the Collection, or
if there are NULL elements mixed with non NULL elements at the right side of
the Production.
Return NULL if there arenīt symbols at the right side of the production.
GrammarExceptionImpl
public java.util.Collection<java.lang.Integer> getRightPosition(Element e) throws GrammarExceptionImpl
Production
getRightPosition
in interface Production
e
- The Element symbol to be checked with the Production.
GrammarExceptionImpl
public Production cloneProduction() throws GrammarExceptionImpl
Production
cloneProduction
in interface Production
GrammarExceptionImpl
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


@(firstName : String, email : String, link : String)
Welcome @firstName,
Thank you for completing the registration for the Clemson RESOLVE Web IDE: @link.
Your username is: @email
You should now be able to login and use all the benefits associated. This includes:
If you have any issues or questions, please contact Murali Sitaraman
Thanks,
Clemson RSRG


General information about the WiPy¶
No floating point support¶
Due to space reasons, there’s no floating point support, and no math module. This means that floating point numbers cannot be used anywhere in the code, and that all divisions must be performed using ‘//’ instead of ‘/’. Example:
>>> r = 4 // 2 # this will work
>>> r = 4 / 2 # this WON'T
Before applying power¶
Warning
The GPIO pins of the WiPy are NOT 5V tolerant, connecting them to voltages higher than 3.6V will cause irreparable damage to the board. ADC pins, when configured in analog mode cannot withstand voltages above 1.8V. Keep these considerations in mind when wiring your electronics.
WLAN default behaviour¶
When the WiPy boots with the default factory configuration starts in Access Point
mode with ssid
that starts with: wipy-wlan
and key: www.wipy.io
.
Connect to this network and the WiPy will be reachable at <IP_ADDRESS>
. In order
to gain access to the interactive prompt, open a telnet session to that IP address on
the default port (23). You will be asked for credentials:
login: micro
and password: python
Telnet REPL¶
Linux stock telnet works like a charm (also on OSX), but other tools like putty
work quite well too. The default credentials are: user: micro
, password: python
.
See network.Server
for info on how to change the defaults.
For instance, on a linux shell (when connected to the WiPy in AP mode):
$ telnet <IP_ADDRESS>
Local file system and FTP access¶
There is a small internal file system (a drive) on the WiPy, called /flash
,
which is stored within the external serial flash memory. If a micro SD card
is hooked-up and mounted, it will be available as well.
When the WiPy starts up, it always boots from the boot.py
located in the
/flash
file system. On boot up, the current directory is /flash
.
The file system is accessible via the native FTP server running in the WiPy. Open your FTP client of choice and connect to:
url: ftp://<IP_ADDRESS>
, user: micro
, password: python
See network.Server
for info on how to change the defaults.
The recommended clients are: Linux stock FTP (also in OSX), Filezilla and FireFTP.
For example, on a linux shell:
$ ftp <IP_ADDRESS>
The FTP server on the WiPy doesn’t support active mode, only passive, therefore, if using the native unix ftp client, just after logging in do:
ftp> passive
Besides that, the FTP server only supports one data connection at a time. Check out the Filezilla settings section below for more info.
FileZilla settings¶
Do not use the quick connect button, instead, open the site manager and create a new
configuration. In the General
tab make sure that encryption is set to: Only use
plain FTP (insecure)
. In the Transfer Settings tab limit the max number of connections
to one, otherwise FileZilla will try to open a second command connection when retrieving
and saving files, and for simplicity and to reduce code size, only one command and one
data connections are possible. Other FTP clients might behave in a similar way.
Upgrading the firmware Over The Air¶
OTA software updates can be performed through the FTP server. Upload the mcuimg.bin
file
to: /flash/sys/mcuimg.bin
it will take around 6s. You won’t see the file being stored
inside /flash/sys/
because it’s actually saved bypassing the user file system, so it
ends up inside the internal hidden file system, but rest assured that it was successfully
transferred, and it has been signed with a MD5 checksum to verify its integrity. Now, reset
the WiPy by pressing the switch on the board, or by typing:
>>> import machine
>>> machine.reset()
Software updates can be found in: https://github.com/wipy/wipy/releases (Binaries.zip). It’s always recommended to update to the latest software, but make sure to read the release notes before.
Note
The bootloader.bin
found inside Binaries.zip
is there only for reference, it’s not
needed for the Over The Air update.
In order to check your software version, do:
>>> import os
>>> os.uname().release
If the version number is lower than the latest release found in the releases, go ahead and update your WiPy!
Boot modes and safe boot¶
If you power up normally, or press the reset button, the WiPy will boot
into standard mode; the boot.py
file will be executed first, then
main.py
will run.
You can override this boot sequence by pulling GP28
up (connect
it to the 3v3 output pin) during reset. This procedure also allows going
back in time to old firmware versions. The WiPy can hold up to 3 different
firmware versions, which are: the factory firmware plus 2 user updates.
After reset, if GP28
is held high, the heartbeat LED will start flashing
slowly, if after 3 seconds the pin is still being held high, the LED will start
blinking a bit faster and the WiPy will select the previous user update to boot.
If the previous user update is the desired firmware image, GP28
must be
released before 3 more seconds elapse. If 3 seconds later the pin is still high,
the factory firmware will be selected, the LED will flash quickly for 1.5 seconds
and the WiPy will proceed to boot. The firmware selection mechanism is as follows:
Safe Boot Pin GP28
released during:
1st 3 secs window |
2nd 3 secs window |
Final 1.5 secs window |
|---|---|---|
Safe boot, latest
firmware is selected
|
Safe boot, previous
user update selected
|
Safe boot, the factory
firmware is selected
|
On all of the above 3 scenarios, safe boot mode is entered, meaning that
the execution of both boot.py
and main.py
is skipped. This is
useful to recover from crash situations caused by the user scripts. The selection
made during safe boot is not persistent, therefore after the next normal reset
the latest firmware will run again.
The heartbeat LED¶
By default the heartbeat LED flashes once every 4s to signal that the system is
alive. This can be overridden through the wipy
module:
>>> import wipy
>>> wipy.heartbeat(False)
There are currently 2 kinds of errors that you might see:
If the heartbeat LED flashes quickly, then a Python script (eg
main.py
) has an error. Use the REPL to debug it.If the heartbeat LED stays on, then there was a hard fault, you cannot recover from this, the only way out is to press the reset switch.
Details on sleep modes¶
machine.idle()
: Power consumption: ~12mA (in WLAN STA mode). Wake sources: any hardware interrupt (including systick with period of 1ms), no special configuration required.machine.lightsleep()
: 950uA (in WLAN STA mode). Wake sources arePin
,RTC
andWLAN
machine.deepsleep()
: ~350uA. Wake sources arePin
andRTC
.
Additional details for machine.Pin¶
On the WiPy board the pins are identified by their string id:
from machine import Pin
g = machine.Pin('GP9', mode=Pin.OUT, pull=None, drive=Pin.MED_POWER, alt=-1)
You can also configure the Pin to generate interrupts. For instance:
from machine import Pin
def pincb(pin):
print(pin.id())
pin_int = Pin('GP10', mode=Pin.IN, pull=Pin.PULL_DOWN)
pin_int.irq(trigger=Pin.IRQ_RISING, handler=pincb)
# the callback can be triggered manually
pin_int.irq()()
# to disable the callback
pin_int.irq().disable()
Now every time a falling edge is seen on the gpio pin, the callback will be executed. Caution: mechanical push buttons have “bounce” and pushing or releasing a switch will often generate multiple edges. See: http://www.eng.utah.edu/~cs5780/debouncing.pdf for a detailed explanation, along with various techniques for debouncing.
All pin objects go through the pin mapper to come up with one of the gpio pins.
For the drive
parameter the strengths are:
Pin.LOW_POWER
- 2mA drive capability.
Pin.MED_POWER
- 4mA drive capability.
Pin.HIGH_POWER
- 6mA drive capability.
For the alt
parameter please refer to the pinout and alternate functions
table at <https://raw.githubusercontent.com/wipy/wipy/master/docs/PinOUT.png>`_
for the specific alternate functions that each pin supports.
For interrupts, the priority
can take values in the range 1-7. And the
wake
parameter has the following properties:
If
wake_from=machine.Sleep.ACTIVE
any pin can wake the board.If
wake_from=machine.Sleep.SUSPENDED
pinsGP2
,GP4
,GP10
,GP11
, GP17`` orGP24
can wake the board. Note that only 1 of this pins can be enabled as a wake source at the same time, so, only the last enabled pin as amachine.Sleep.SUSPENDED
wake source will have effect.If
wake_from=machine.Sleep.SUSPENDED
pinsGP2
,GP4
,GP10
,GP11
,GP17
andGP24
can wake the board. In this case all of the 6 pins can be enabled as amachine.Sleep.HIBERNATE
wake source at the same time.
Additional Pin methods:
- machine.Pin.alt_list()¶
Returns a list of the alternate functions supported by the pin. List items are a tuple of the form:
('ALT_FUN_NAME', ALT_FUN_INDEX)
Additional details for machine.I2C¶
On the WiPy there is a single hardware I2C peripheral, identified by “0”. By default this is the peripheral that is used when constructing an I2C instance. The default pins are GP23 for SCL and GP13 for SDA, and one can create the default I2C peripheral simply by doing:
i2c = machine.I2C()
The pins and frequency can be specified as:
i2c = machine.I2C(freq=400000, scl='GP23', sda='GP13')
Only certain pins can be used as SCL/SDA. Please refer to the pinout for further information.
Known issues¶
Incompatible way to create SSL sockets¶
SSL sockets need to be created the following way before wrapping them with.
ssl.wrap_socket
:
import socket
import ssl
s = socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_SEC)
ss = ssl.wrap_socket(s)
Certificates must be used in order to validate the other side of the connection, and also to authenticate ourselves with the other end. Such certificates must be stored as files using the FTP server, and they must be placed in specific paths with specific names.
The certificate to validate the other side goes in: ‘/flash/cert/ca.pem’
The certificate to authenticate ourselves goes in: ‘/flash/cert/cert.pem’
The key for our own certificate goes in: ‘/flash/cert/private.key’
Note
When these files are stored, they are placed inside the internal hidden file system (just like firmware updates), and therefore they are never visible.
For instance to connect to the Blynk servers using certificates, take the file ca.pem
located
in the blynk examples folder.
and put it in ‘/flash/cert/’. Then do:
import socket
import ssl
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_SEC)
ss = ssl.wrap_socket(s, cert_reqs=ssl.CERT_REQUIRED, ca_certs='/flash/cert/ca.pem')
ss.connect(socket.getaddrinfo('cloud.blynk.cc', 8441)[0][-1])
Incompatibilities in hashlib module¶
Due to hardware implementation details of the WiPy, data must be buffered before being
digested, which would make it impossible to calculate the hash of big blocks of data that
do not fit in RAM. In this case, since most likely the total size of the data is known
in advance, the size can be passed to the constructor and hence the HASH hardware engine
of the WiPy can be properly initialized without needing buffering. If block_size
is
to be given, an initial chunk of data
must be passed as well. When using this extension,
care must be taken to make sure that the length of all intermediate chunks (including the
initial one) is a multiple of 4 bytes. The last chunk may be of any length.
Example:
hash = hashlib.sha1('abcd1234', 1001) # length of the initial piece is multiple of 4 bytes
hash.update('1234') # also multiple of 4 bytes
...
hash.update('12345') # last chunk may be of any length
hash.digest()
Adhoc way to control telnet/FTP server via network module¶
The Server
class controls the behaviour and the configuration of the FTP and telnet
services running on the WiPy. Any changes performed using this class’ methods will
affect both.
Example:
import network
server = network.Server()
server.deinit() # disable the server
# enable the server again with new settings
server.init(login=('user', 'password'), timeout=600)
- class network.Server(id, ...)¶
Create a server instance, see
init
for parameters of initialization.
- server.init(\*, login=('micro', 'python'), timeout=300)¶
Init (and effectively start the server). Optionally a new
user
,password
andtimeout
(in seconds) can be passed.
- server.deinit()¶
Stop the server
- server.timeout([timeout_in_seconds])¶
Get or set the server timeout.
- server.isrunning()¶
Returns
True
if the server is running,False
otherwise.
Adhoc VFS-like support¶
WiPy doesn’t implement full MicroPython VFS support, instead following
functions are defined in os
module:
- mount(block_device, mount_point, \*, readonly=False)¶
Mounts a block device (like an
SD
object) in the specified mount point. Example:os.mount(sd, '/sd')
- unmount(path)¶
Unmounts a previously mounted block device from the given path.
- mkfs(block_device or path)¶
Formats the specified path, must be either
/flash
or/sd
. A block device can also be passed like anSD
object before being mounted.


Tag Engine can copy tags from BigQuery tables to views as long as those views reference tagged tables. This is called tag propagation.
If you want Tag Engine to propagate your tags, fill out the fields below. You must set at least one source project and at least one destination project.
You may optionally specify the frequency with which the tag propagate job should run. The default frequency is every 24 hours.


Unemployment Application
This is a form for you to fill out for your unemployment benefits.
Here you will select what your situation is:
Let us know if you will recommend us!
Any Additional Comments You Have Can Be Written Below.
This is a form for you to fill out for your unemployment benefits.
Here you will select what your situation is:
Let us know if you will recommend us!
Any Additional Comments You Have Can Be Written Below.


Furious cabbie takes 'fare dodgers' to their parents' houses over £46 journey
Cabbie Kev beeped his horn at a passing police van in Liverpool after claiming two passengers tried to make a run for it
by Kelly-Ann Mills, Charlotte Hadfield, https://www.facebook.com/dailymirror/A taxi driver told how he took two fare dodgers to their parents' houses when they refused to pay for a £46 journey.
Cabbie Kev beeped his horn at a passing police van in Liverpool after claiming two passengers tried to make a run for it after their friend left.
Video footage taken by Kev and shared with his fans on social media, shows the moment he flagged down police officers and told them: "£46 on the clock and they haven't paid me", the Liverpool Echo reports.

"I said to them at the end of the day I've got to get paid, I've got a family to feed."
Kev said the two passengers who went searching for their missing friend, eventually got back into the cab but told him they couldn't pay until "they had got some stuff from the shop."
He said: "I didn't want stuff, I just wanted the money I was owed on the meter.
"One's f***ed off - excuse the language"
"Then I saw a police van at the lights so I beeped my horn.
"They pulled up further down the road and I said to them they're not paying their fare."
Kev and the officers then took the passengers to their parents' house to get the fare he was owed.
He added: "The police were brilliant. They took them to their parents' houses and I followed behind in my cab.
"The parents were the ones that paid me in the end, I can't thank the police enough for their help."
Kev, who regularly posts videos taken in his cab to fans on social media, filmed what happened on his phone and uploaded it to Youtube.
The footage shows the moment he beeped his horn at the passing police van and pulled up to speak to an officer.
In the video Kev can be heard saying to the officer: "£46 on the clock and they haven't paid me they're going round the shop and god knows what, there was three of them but one's f***ed off - excuse the language.
"I didn't want to blow them up but I've got a family to feed, I don't want to be a grass but I want my money."
While speaking to the passengers Kev said: "I've given you loads of chances and you've f***ed up."
Kev said: "I was fuming, I just want to make an honest living.
"Sometimes if someone is a bit short of a pound or two I'll say It's okay but I would have had to stay out for three or four hours to make that back.

"I love this city and that's why I film what I do because I like to show what goes on everyday as a real life taxi driver."