Testing
Testing
One of the most important things is to have a reliable software. Testing will help us increasing reliability.
Admission webhooks are hard to test mainly because of three things:
- It’s mandatory to use TLS.
- Apiserver is the one that makes the calls.
- The servie needs to be in a cluster or available in a exposed host.
Kubewebhook is tested, this means that it’s not necessary to test the infrastructure code, you just need to test your mutators and validators logic.
This doesn’t mean that you could create integration tests, but integration tests should be less than unit test.
Lets make a testing example of a mutator.
Example
The example is here also
Imagine a webhook like this. It only sets labels on every pod that it receives
package mutatortesting
import (
"context"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/slok/kubewebhook/pkg/webhook/mutating"
)
// PodLabeler is a mutator that will set labels on the received pods.
type PodLabeler struct {
labels map[string]string
}
// NewPodLabeler returns a new PodLabeler initialized.
func NewPodLabeler(labels map[string]string) mutating.Mutator {
if labels == nil {
labels = make(map[string]string)
}
return &PodLabeler{
labels: labels,
}
}
// Mutate will set the required labels on the pods. Satisfies mutating.Mutator interface.
func (p *PodLabeler) Mutate(ctx context.Context, obj metav1.Object) (bool, error) {
pod := obj.(*corev1.Pod)
if pod.Labels == nil {
pod.Labels = make(map[string]string)
}
for k, v := range p.labels {
pod.Labels[k] = v
}
return false, nil
}
You would make a test that check the business logic of the mutator itself and nothing more.
package mutatortesting_test
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/slok/kubewebhook/examples/mutatortesting"
)
func TestPodTaggerMutate(t *testing.T) {
tests := []struct {
name string
pod *corev1.Pod
labels map[string]string
expPod *corev1.Pod
expErr bool
}{
{
name: "Mutating a pod without labels should set the labels correctly.",
pod: &corev1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "test",
},
},
labels: map[string]string{"bruce": "wayne", "peter": "parker"},
expPod: &corev1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "test",
Labels: map[string]string{"bruce": "wayne", "peter": "parker"},
},
},
},
{
name: "Mutating a pod with labels should aggregate and replace the labels with the existing ones.",
pod: &corev1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "test",
Labels: map[string]string{"bruce": "banner", "tony": "stark"},
},
},
labels: map[string]string{"bruce": "wayne", "peter": "parker"},
expPod: &corev1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "test",
Labels: map[string]string{"bruce": "wayne", "peter": "parker", "tony": "stark"},
},
},
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
assert := assert.New(t)
pl := mutatortesting.NewPodLabeler(test.labels)
gotPod := test.pod
_, err := pl.Mutate(context.TODO(), gotPod)
if test.expErr {
assert.Error(err)
} else if assert.NoError(err) {
// Check the expected pod.
assert.Equal(test.expPod, gotPod)
}
})
}
}


WeeWikiPaint is the web's premier collaborative site. Go on, give it a try!
You can watch this site be developed at Let's Code: Test-Driven JavaScript!


Edit Patient
Edit Patient
Please Supply at least
ONE
of the following fields
Username:
First Name:
Last Name:
Footer


{% extends "base.html" %} {% block title %}Date Sleect{% endblock %} {% block header %}{% endblock %} {% include "navbar_manager.html" %} {% block content %}
Choose the Start Date from the drop down list
The system will collect all entries a month before and after your selection.


{{ comment }} This page should have many of the not-otherwise available attributes of individuals. Whichever the user should not be able to see are not displayed. {{ endcomment }}
{% extends "base.html" %} {% block title %} Patient Data {% endblock %} {% block top %}{{ concretize(data[1]) }}


Example of API calls.
Return a simple JSON object with the message "Api say Hello!".
Return a simple calc into two numbers.
Need three query params:
| Param | Type |
|---|---|
| first | Number |
| second | Number |
| operation | String |
The operation param accept the next options: "sum", "substraction", "multiplication" and "division".
Return the IP address, preferred languages (from header Accept-Language) and system infos (from header User-Agent) for my device.


Enumeration members
AUDIO_MESSAGE
AUDIO_MESSAGE: = "audio_message"
DOCUMENT
DOCUMENT: = "doc"
GRAFFITI
GRAFFITI: = "graffiti"
MARKET
MARKET: = "market"
MARKET_ALBUM
MARKET_ALBUM: = "market_album"
STICKER
STICKER: = "sticker"
WALL_REPLY
WALL_REPLY: = "wall_reply"
The attachment types


Using aldn1000 instrument support in an application
Several files need minor modifications to use aldn1000 instrument support in
an application.
- Add the full path to the aldn1000 support directory to the
application configure/RELEASE file:
aldn1000=xxxx/modules/instrument/aldn1000/<release>
Where <release> is the release number of of the aldn1000 support.
- Add stream and asyn support to application database definition file
The application database definition file must include the database
definition files for the stream package and for any needed ASYN
drivers. There are two ways that this can be done:
- If you are building your application database definition file from
an xxxInclude.dbd file you include the additional database
definitions in that file:
include "base.dbd"
include "stream.dbd"
include "drvAsynIPPort.dbd"
- If you are building your application database definition file from
the application Makefile you specify the aditional database
definitions there:
xxx_DBD += base.dbd
xxx_DBD += stream.dbd
xxx_DBD += drvAsynIPPort.dbd
- Add the stream and asyn support libraries to the application
You must link the stream support library and the ASYN support library
with the application. Add the following lines:
xxx_LIBS += stream
xxx_LIBS += asyn
before the
xxx_LIBS += $(EPICS_BASE_IOC_LIBS)
in the application Makefile.
- Load the aldn1000 support database records in the application startup script:
cd $(aldn1000) (cd aldn1000 if using the vxWorks shell)
dbLoadRecords("db/devaldn1000.db,"P=<P>,R=<R>,PORT=<PORT>,A=<A>")
You'll have to provide appropriate values for the PV name prefixes
(<P> and <R>), the port name (<PORT>) and the device address
(<A>). The port name must match the value specified in
an ASYN drvxxxxxConfigure command.
Installation and Building
After obtaining a copy of the distribution, it must be installed and built
for use at your site.
- Create an installation directory for the module. The path name
of this directory should end with modules/instrument/aldn1000.
- Place the distribution file into this directory.
- Execute the following commands:
cd modules/instrument/aldn1000
gunzip aldn1000<release>.tar.gz
tar xvf aldn1000<release>.tar
cd <release>
Where <release> is the release number of of the aldn1000 support.
- Edit the configure/RELEASE file and set the paths to your
installation of EPICS base, stream and ASYN support modules.
- Execute make in the top level directory.


This Python 3 package is a collection of functions and classes for tribology research and education, including contact mechanics, lubrication science and data handling. The project is hosted on GitHub:
https://github.com/moritzploss/tribology
You can install the tribology package using pip:
pip install tribology
You can refer to the tribology package in scientific publications by using its DOI. The following DOI will resolve all releases of the package and automatically point to the latest release:
DOI: 10.5281/zenodo.1117727
It is generally recommended to import
the tribology package as follows.
This will import all modules of the package and you can use all classes and
functions without ever worrying about modules:
import tribology as tr
Alternatively, you can perform module level imports using the moule names given in the remainder of this documentation. For quick access to relevant information, package modules are loosely grouped by topic in the following.


2048 Game on Bitbucket
What is this?
This is a Game for Software developer for refreshment. When you are getting bored just click on icon and get started with Game.
Developer
My name is Jainish Shah. I'm a Software Developer. Did Masters in Software Engineering from ITU, San Jose. I build modern, simple, responsive application on Cloud Platforms like AWS, GCP, Azure, Mesosphere. I love containerizing applications. Reach me here.Was this useful? Have a question or suggestion? ☞ @Jainish Shah.


This is a Test Project.
Last updated 3 mins ago
This is a Test Project.
Last updated 6 mins ago
This is a Test Project.
Last updated 3 mins ago
This is a Test Project.
Last updated 6 mins ago
This is a Test Project.
Last updated 3 mins ago
This is a Test Project.
Last updated 6 mins ago


SweetFreeStuff.com
///////////////////////////////////////////
Free Southern Shirt Stickers
Posted: 01 Jan 2015 10:38 AM PST
http://feedproxy.google.com/&edburner&utm_medium=email
Free Southern Shirt Stickers
The post Free Southern Shirt Stickers appeared first on SweetFreeStuff.com.
///////////////////////////////////////////
Free Sticker Genius Stickers
Posted: 01 Jan 2015 10:35 AM PST
http://feedproxy.google.com/&edburner&utm_medium=email
Free Sticker Genius Stickers
The post Free Sticker Genius Stickers appeared first on SweetFreeStuff.com.
///////////////////////////////////////////
Free Bag of Skittles at Murphy USA
Posted: 01 Jan 2015 02:02 AM PST
http://feedproxy.google.com/&edburner&utm_medium=email
Login or sign up to get your free coupons. Expires 1/31.
The post Free Bag of Skittles at Murphy USA appeared first on
SweetFreeStuff.com.
///////////////////////////////////////////
Free Poland Spring Sparkling Water at Xtra Mart
Posted: 01 Jan 2015 12:57 AM PST
http://feedproxy.google.com/&edburner&utm_medium=email
Free Poland Spring Sparkling Water at Xtra Mart Expires 1/7/2015
The post Free Poland Spring Sparkling Water at Xtra Mart appeared first on
SweetFreeStuff.com.
///////////////////////////////////////////
Free LOreal Paris Advanced Haircare Samples
Posted: 31 Dec 2014 10:00 PM PST
http://feedproxy.google.com/&edburner&utm_medium=email
Free LOreal Paris Advanced Haircare Samples
The post Free LOreal Paris Advanced Haircare Samples appeared first on
SweetFreeStuff.com.
///////////////////////////////////////////
Free Can of Red Bull
Posted: 31 Dec 2014 08:27 PM PST
http://feedproxy.google.com/&edburner&utm_medium=email
Follow the steps to get a FREE can of Red Bull!
The post Free Can of Red Bull appeared first on SweetFreeStuff.com.
///////////////////////////////////////////
Free Barrel of Utz Cheese Balls at Midnight ET 1/1 (First 2,015) (Expired)
Posted: 31 Dec 2014 02:53 AM PST
http://feedproxy.google.com/&edburner&utm_medium=email
First 2,015 at 12:00am ET on 1/1 will receive a FREE Barrel of Utz Cheese
Balls!
The post Free Barrel of Utz Cheese Balls at Midnight ET 1/1 (First 2,015)
(Expired) appeared first on SweetFreeStuff.com.


Devil's Isle Survivor:
Do you want to enter Pailaka again?
Enter Pailaka.


 Not that anyone said that to me. In fact, I wish someone had said the opposite to me. I sat through two-plus hours of Sean Connery trying to pretend he was still young enough to be James Bond, more than twenty years after portraying 007 for the first time in DR. NO. His age makes the multiple fistfights and love scenes with beautiful women more absurd-looking than usual. I'd say the fact that six years later Sean Connery would start playing action heros' fathers (INDIANA JONES AND THE LAST CRUSADE and ROBIN HOOD: PRINCE OF THIEVES) should clue you in on what I'm talking about. Why Connery couldn't leave the legend as it was instead of returning for the most bland Bond movie he's ever done is what puzzles me. No, I don't ponder the mysteries of the universe and the mortality of life. I ponder this for hours on end.
NEVER SAY NEVER AGAIN is a remake of 1965's THUNDERBALL, one of the more mediocre efforts from the Connery years. (Why they couldn't redo GOLDFINGER or DIAMONDS ARE FOREVER is another thing I stay awake nights pondering.) It keeps the basic premise of that movie--villain Largo, owner of an enormous yacht, steals two nuclear devices and threatens their detonation on the world if a ransom is not met--but changes almost everything else.
Bond is reactivated as a double-o agent, only to be shipped off to a health farm to purge him of his ancient habits of eating red meat and drinking martinis shaken not stirred (when it's so much better for your body to have them stirred and not shaken). He does engage in a couple other old habits of his--sex with his masseuse and a destructive fight with a goon trying to kill him. He also stumbles upon the evil nurse (Barbara Carrera) working for Largo. That's conquest number two for Bond, who attracts beautiful women like flies... actually, mosquitoes might be a better comparison when you think about it.
He then ends up playing a high-stakes video game with Largo (They had to take advantage of that 80's technology.) and doing the tango (vertically and horizontally) with Kim Basinger. Then there's the motorcycle chase, laser watch, Carrera's combustion and endless scuba diving. But it never seems like a full-fledged Bond movie. Besides the fact that Connery is over the action hero hill, British inventor Q. is played by a different actor and Moneypenny only has two lines. Wouldn't you think if Connery aged twenty years since the first movie that Moneypenny would be pushing fifty too? Nope, she's still unexplainably thirtyish. That's something else I'll be pondering at great lengths tonight.
Visit the Movie Critic at LARGE website at http://www.missouri.edu/~c667778/movies.html
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


Free Yoga in the Park at Southbank
This dynamic mind and body activity is invigorating and will help you feel relaxed, refreshed and calm. The easy-to-follow moves are repeated each week to enable participants to get a feel for the gentle flowing exercise 'moving meditation'.
Posted by Brisbane Council on October 16, 2015


open/[3,4]
open/3 – open a stream
open/4 – open a stream with options
FORMS
open(Name,Mode,Stream)
open(Name,Mode,Stream,Options)
DESCRIPTION
open/3 and open/4 are used to open a file or other entities for input or output. Calling open/3 is the same as calling open/4 where Options is the empty list.
Once a stream has been opened with open/3 or open/4, read_term/3 or write_term/3 might then be used to read or write terms to the opened stream. get_char/2 or put_char/2 can be used to read or write characters. A source refers to some entity which may be opened as a stream for read access. Such
streams, once open, are called input streams. A sink refers to some entity which may be written to. Such a stream is called an
output stream. There are streams which are both sources and sinks; such streams
may be both read from and written to.
Name specifies the source/sink to be opened. Whether Name is a source or a sink will depend on the value of Mode. Mode may either be read, indicating that Name is a source or write, which indicating that Name is a sink. If the source/sink specified by Name, Mode, and the options in Options is successfully opened, then Stream will be unified with a stream descriptor which may be used in I/O operations
on the stream. If the stream could not be successfully opened, then an error
is thrown.
If Name is an atom, then the contents of the stream are the contents of the file with
name Name. Mode may take on additional values for file streams. The values which Mode may take on for file streams are:
read – open the file for read access
write – open the file for write access; truncate or create as necessary
read_write – both reading and writing are permitted; file is not truncated on open
append – open file with write access and position at end of stream
If Name has the form atom(A), then Name represents an atom stream. When opened with Mode equal to read, A must be an atom. The contents of the stream are simply the characters
comprising the atom A. When opened for write access, A will be unified with the atom formed from the characters written to the
stream during the time that the stream was open. The unification is carried out at
the time that the stream is closed.
If Name has the form code_list(CL) or string(CL), then Name represents a (character) code list stream. When opened for read access, the
contents of such a stream are the character codes found in the list CL. When opened for write access, CL will be unified with a list of character codes. This list is formed from the charcters written to the stream
during the lifetime of the stream. The unification is carried out when the
stream is closed.
If Name has the form char_list(CL), then Name represents a character list stream. The behavior of character list streams
is identical to that of code list streams with the exception that the types of
the objects in the lists are different. A code list consists of character
codes, whereas a character list consists of a list of characters.
Name may also take on one of the following forms representing a socket:
socket(unix,PathName)
socket(inet_stream,Host)
socket(inet_stream,Host,Port)
socket(inet_dgram,Host,Port)
socket(clone,Stream_Or_Alias)
Regardless of the mode (read or write), the call to open/[3,4] will attempt to open the stream as a server (if appropriate). Failing that,
it will attempt to open the stream as a client. If a connection-oriented
socket is opened as a server, then prior to the first buffer read or write, the stream will wait for a client to connect. If the stream is opened as a
client, the connection (in a connection-oriented socket) is established as part
of the open.
socket(unix,PathName): Open a unix domain socket. Addresses in the unix domain are merely path
names which are specified by PathName. Unix domain sockets are somewhat limited in that both the server and client
process must reside on the same machine. The stream will be opened as a
server if the name specified by PathName does not currently exist (and the requisite permissions exist to create a
directory entry). Otherwise, the stream will be opened as a client.
socket(inet_stream,Host): Open an internet domain stream socket on the host given by Host using port number 1599. The stream will be opened as a server if Host is set to the name of the host on which the process is running and no other
process has already established a server stream on this port. Otherwise, the
stream will be opened as a client. A permission error will be generated if
neither operation can be performed. The host specification may either be a host
name or an internet address.
socket(inet_stream,Host,Port): Similar to the above, but the Port may specified. This permits an application to choose its own "well known"
port number and act as either a server or client. Alternately, both Host and Port may be variable in which case the system will open a stream at a port of its
choosing. When variable, Host and Port will be instantiated to values of the current host and the port which was
actually opened.
socket(inet_dgram,Host,Port): Similar to inet_stream, but a datagram socket is created instead. A datagram socket is an endpoint
which is not connected. The datagram socket will be opened as a server socket
if the Host is either variable or bound to the name of the current host and Port is either variable or bound to a port number which is not currently in use.
Otherwise, a client socket is established which (by default) will write to the
host and port indicated by Host and Port. A server socket is initially set up to write out to UDP port 9 which will
discard any messages sent. Datagram sockets will set the end-of-file indication
for each datagram read. This mechanism permits code written in Prolog to
fully process each incoming datagram without having to worry about running over
into the next datagram. flush_input/1 should be used to reset the stream attached to the datagram in order for more
input to be read. Programmers using datagrams should strive to make each
datagram self contained. If this is a hardship, stream sockets should be used
instead.
socket(clone,Stream_or_Alias): This specification will create a new (prolog) stream descriptor for a socket
from an existing socket stream descriptor. This gives the programmer the
ability to create more than one buffer which refers to the same socket. This
cloning mechanism has two uses. Firstly, sockets are full duplex which means that
they may be both read from and written to. Yet, the interface which ALS Prolog
provides will only naturally provide read access or write access, not both
simultaneously. The cloning mechanism accommodates this problem by allowing
separate (prolog) stream descriptors for each mode which refer to the same unix
socket descriptor. Secondly, server socket streams will only act as a server until
a connection is established. Once the connection is made, they lose their
"server" property. An application which wants to service more than one client will
want to clone its "server" descriptor prior to performing any reads to or
writes from the stream.
The behavior and disposition of a stream may be influenced by the Options argument. Options is a list comprising one or more of the following terms:
type(T) – T may be either text or binary. This defines whether the stream is a text
stream or a binary stream. At present, ALS Prolog makes no distinction between
these two types.
alias(Alias) – Alias must be an atom. This option specifies an alias for the stream. If an alias
is established, the alias may be passed in lieu of the stream descriptor to
predicates requiring a stream handle.
reposition(R) – R is either true or false. reposition(true) indicates that the stream must be repositionable. If it is not, open/3 or open/4 will throw an error. reposition(false) indicates that the stream is not repositionable and any attempt to reposition
the stream will result in an error. If neither option is specified, the
stream will be opened as repositionable if possible. A program can find out if a
stream is repositionable or not by calling stream_property/2.
eof_action(Action) – Action may be one of error, eof_code, or reset. Action instantiated to error indicates that an existence error should be triggered when a stream attempts
to read past end-of-file. The default action is eof_code which will cause an input predicate reading past end-of-file to return a
distinguished value as the output of the predicate (either end_of_file, or -1). Finally, Action instantiated to reset indicates that the stream should be reset upon end-of-file.
snr_action(Action) – Action may be one of error, snr_code, or wait. As with eof_action, Action instantiated to error will generate an existence error when an input operation attempts to read
from a stream for which no input is ready. snr_code will force the input predicate to return a distinguished code when the stream
is not ready. This code will be either -2 or the atom stream_not_ready. The default action is wait which will force the input operation to wait until the stream is ready.
buffering(B) – B is either byte, line, or block. This option applies to streams open for output. If byte buffering is
specified, the stream buffer will be flushed (actually written out) after each
character. Line buffering is useful for streams which interact with a user; the
buffer is flushed when a newline character is put into the buffer. Block
buffering is the default; the buffer is not flushed until the block is full or until a
call to flush_output/1 is made.
bufsize(Size) – Size must be a positive integer. The Size parameter indicates the size of buffer to allocate the associated stream.
The default size should be adequate for most streams.
prompt_goal(Goal) – Goal is a ground callable term. This option is used when opening an input stream.
Goal will be run each time a new buffer is read. This option is most useful
when used in conjunction with opening an output stream where a prompt should
be written to whenever new input is required from the input stream.
maxdepth(Depth) – Depth is a positive integer. This option when specified for an output stream sets
the default maximum depth used to write out a term with write_term/3, et. al. Explicit options to write_term/3 may be used to override this option.
depth_computation(DC) – DC should be either flat or nonflat. This option indicates the default mechanism to be used for write_term to
compute the depth of a term. flat indicates that all arguments in a list or structured term should be
considered to be at the same depth. nonflat indicates that each successive element of a structured term or list is at
depth one greater than its predecessor.
line_length(Length) – Length is a positive integer. This option is used to set the default line length
associated with the stream. Predicates which deal with term output use this
parameter to break the line at appropriate points when outputting a term which will
span several lines. Explicit options to write_term/3 may be used to override this option.
write_eoln_type(Type) - allows control over which end-of-line (eoln) characters are output by nl/1. The values for Type and the corresponding eoln characters are: cr (“\r”), lf (“\n”), and crlf (“\r\n”). The default is determined by the operating system: MacOS (cr), Unix (lf), and Win32/DOS (crlf).
read_eoln_type(Type) - determines what read/2 and get_line/3 recognize as an end-of-line. The values for Type and the corresponding
ends-of-line are: cr - carriage return (“\r”), lf - line feed (“\n”), crlf - carriage return followed by a line feed (“\r\n”) , universal - indicates that any of the end-of-line types (cr, lf, crlf) should be interpreted as an end-of-line. The default is universal since this allows the correct end-of-line interpretation for text files on
all operating systems.
EXAMPLES
Open file named example.dat for write access, write a term to it and close it.
?- open('example.dat',write,S), writeq(S, example(term)),
?-_ put_char(S,'.'), nl(S), close(S).
S = stream_descriptor('',closed,file,'example.dat',
[noinput|output], true,2,0,0,0,0,true,0,
wt_opts(78,40000,flat),[],true,text,eof_code,0,0)
Open file named example.dat for read access with alias example.
?- open('example.dat',read,_,[alias(example)]).
Read a term from stream with alias example.
?- read(example,T).
T = example(term)
Read another term from with stream with alias example.
?- read(example,T).
T = end_of_file
Close the stream aliased example.
?- close(example).
The following procedure will open two source/sinks, one for read access, the
other for write access. It will read one term from the source and write it to
the sink. Finally, it will close both streams.
copy_one_term(In,Out) :-
open(In,read,SI),
open(Out,write,SO),
read(SI,Term),
writeq(SO,Term),
put_char(SO,'.'),
nl(SO),
close(SI),
close(SO).
Call copy_one_term/2 to copy the term in example.dat to a character list
stream.
?- copy_one_term('example.dat', char_list(L)).
L = [e,x,a,m,p,l,e,'(',t,e,r,m,')',.,'\n']
Call copy_one_term/2 to overwrite 'example.dat' with a new term specified by a character code list
stream.
?- copy_one_term(code_list("new(term).\n"),'example.dat').
Call copy_one_term/2 to read a term from example.dat and put it into an atom
stream.
?- copy_one_term('example.dat',atom(A)).
A = 'new(term).\n'
Attempt to open a stream with read access which does not exist.
?- open(foobar,read,S).
Error: The open operation is not permitted on the source_sink object foobar.
- Goal: sio:open(foobar,read,_A,?)
- Throw pattern: error(
permission_error(open,source_sink,foobar),
[sio:open(foobar,read,_A,?)])
ERRORS
Name, Mode, or Options is a variable
––––> instantiation_error.
Name does not refer to either a variable or a source/sink
––––> domain_error(source_sink,Name).
Mode is neither a variable nor an atom
––––> type_error(atom,Mode).
Mode is an atom, but not a valid I/O mode for the given source/sink
––––> domain_error(io_mode,Mode).
Stream is not a variable
––––> type_error(variable,Stream).
Options is neither a variable nor a list
––––> type_error(list,Options).
Options is a list with a variable element
––––> instantiation_error.
Options is a list with element E which is not a valid stream option
––––> domain_error(stream_option,E).
Name specifies a valid source/sink, but can not be opened. If Name refers to a file, the file may not exist or the protection on the file or
containing directory might be set to be incompatible with the open mode
––––> permission_error(open,source_sink,Name).
Options contains an element alias(A) and A is already associated with another stream
––––> permission_error(open,source_sink,alias(A)).
Options contains an element reposition(true) and it is not possible to reposition a stream corresponding to the
source/sink Name.
––––> permission_error(open,source_sink,reposition(true)).
NOTES
The structured term comprising a stream descriptor is visible to the
programmer. The programmer should not directly use the stream descriptor to learn of
properties or attributes associated with the stream or otherwise rely on the
representation of stream descriptors. Use stream_property/2 to examine the properties associated with a stream.
The DEC-10 compatibility predicates see/1 and tell/1 are defined in terms of open/4. When a stream is opened with either of these predicates it is assigned an
alias which is the name of the source/sink. Thus the single argument to see/1 and tell/1 may be considered to be both the name of the stream and an alias for the
stream.
SEE ALSO
close/1, current_input/1, current_output/1, flush_input/1, flush_output/1,
stream_property/2, read_term/3, write_term/3, get_char/1, put_char/1,
set_stream_position/2,User Guide (Prolog I/O).


| I l@ve RuBoard |
There are times when the standard Python file objects can't meet your requirements, and you need to use the Windows API to manipulate files. This can happen in a number of situations, such as:
You need to read or write data to or from a Windows pipe.
You need to set custom Windows security on a file you are creating.
You need to perform advanced techniques for performance reasons, such as "Overlapped" operations or using completion ports.
|
The win32file.CreateFile() function opens or creates standard files, returning a handle to the file. Standard files come in many flavors, including synchronous files (where read or write operations don't return until the operation has completed); asynchronous (or overlapped I/O) files, where read and write operations return immediately; and temporary files that are automatically deleted when the handle is closed. Files may also be opened requesting that Windows not cache any file operations, that no buffering is performed, etc. All the variations that CreateFile() can use are too numerous to list here. For full details, please see the Windows API documentation for CreateFile().
The CreateFile() function takes the following parameters:
Name of the file
Integer indicating the type of access requested on the file
Integer-sharing options for the file
Security attributes for the new file or None
A flag, indicating what action to take depending on if the file exists
A set of flags and attributes for the file itself
Another file to act as a template or None
This function returns a PyHANDLE object. PyHANDLEs are simply objects that wrap standard Win32 HANDLEs. When a PyHANDLE object goes out of scope, it's automatically closed; thus, it's generally not necessary to close these HANDLEs as it is necessary when using these from C or C++.
Let's see how these parameters interact and test out some of the documented semantics. Here's a small script that uses the win32file module to work with Win32 file handles. The code creates a file, then checks that other attempts to open the file either succeed or fail, based on the flags passed to CreateFile(). You will also find that auto-delete files behave as expected; i.e., after the last handle is closed, the file no longer exists on disk:
# CheckFileSemantics.py # Demonstrate the semantics of CreateFile. # To keep the source code small, # we import all win32file objects. from win32file import * import win32api import os # First, lets create a normal file h1 = CreateFile( \ "\\file1.tst", # The file name \ GENERIC_WRITE, # we want write access. \ FILE_SHARE_READ, # others can open for read \ None, # No special security requirements \ CREATE_ALWAYS, # File to be created. \ FILE_ATTRIBUTE_NORMAL, # Normal attributes \ None ) # No template file. # now we will print the handle, # just to prove we have one! print "The first handle is", h1 # Now attempt to open the file again, # this time for read access h2 = CreateFile( \ "\\file1.tst", # The same file name. \ GENERIC_READ, # read access \ FILE_SHARE_WRITE | FILE_SHARE_READ, \ None, # No special security requirements \ OPEN_EXISTING, # expect the file to exist. \ 0, # Not creating, so attributes dont matter. \ None ) # No template file # Prove we have another handle print "The second handle is", h2 # Now attempt yet again, but for write access. # We expect this to fail. try: h3 = CreateFile( \ "\\file1.tst", # The same file name. \ GENERIC_WRITE, # write access \ 0, # No special sharing \ None, # No special security requirements \ CREATE_ALWAYS, # attempting to recreate it! \ 0, # Not creating file, so no attributes \ None ) # No template file except win32api.error, (code, function, message): print "The file could not be opened for write mode." print "Error", code, "with message", message # Close the handles. h1.Close() h2.Close() # Now lets check out the FILE_FLAG_DELETE_ON_CLOSE fileAttributes = FILE_ATTRIBUTE_NORMAL | \ FILE_FLAG_DELETE_ON_CLOSE h1 = CreateFile( \ "\\file1.tst", # The file name \ GENERIC_WRITE, # we want write access. \ FILE_SHARE_READ, # others can open for read \ None, # no special security requirements \ CREATE_ALWAYS, # file to be created. \ fileAttributes, \ None ) # No template file. # Do a stat of the file to ensure it exists. print "File stats are", os.stat("\\file1.tst") # Close the handle h1.Close() try: os.stat("\\file1.tst") except os.error: print "Could not stat the file - file does not exist"
When you run this script, you see the following output:
The first handle is <PyHANDLE at 8344464 (80)> The second handle is <PyHANDLE at 8344400 (112)> The file could not be opened for write mode. Error 32 with message The process cannot access the file because it is being used by another process. File stats are (33206, 0, 11, 1, 0, 0, 0, 916111892, 916111892, 916111892) Could not stat the file - file does not exist
Thus, the semantics are what you'd expect:
A file opened to allow reading can be opened this way.
A file opened to disallow writing can't be opened this way.
A file opened for automatic delete is indeed deleted when the handle is closed.
The win32file module has functions for reading and writing files. Not surprisingly, win32file.ReadFile() reads files, and win32file.WriteFile() writes files.
win32file.ReadFile() takes the following parameters:
The file handle to read from
The size of the data to read (see the reference for further details)
Optionally, an OVERLAPPED or None
win32file.ReadFile() returns two pieces of information in a Python tuple: the error code for ReadFile and the data itself. The error code is either zero or the value winerror.ERROR_IO_PENDING if overlapped I/O is being performed. All other error codes are trapped and raises a Python exception.
win32file.WriteFile() takes the following parameters:
A file handle opened to allow reading
The data to write
Optionally, an OVERLAPPED or None
win32file.WriteFile() returns the error code from the operation. This is either zero or win32error.ERROR_IO_PENDING if overlapped I/O is used. All other error codes are converted to a Python exception.
Windows provides a number of techniques for high-performance file I/O. The most common is overlapped I/O. Using overlapped I/O, the win32file.ReadFile() and win32file.WriteFile() operations are asynchronous and return before the actual I/O operation has completed. When the I/O operation finally completes, a Windows event is signaled.
Overlapped I/O does have some requirements normal I/O operations don't:
The operating system doesn't automatically advance the file pointer. When not using overlapped I/O, a ReadFile or WriteFile operation automatically advances the file pointer, so the next operation automatically reads the subsequent data in the file. When using overlapped I/O, you must manage the location in the file manually.
The standard technique of returning a Python string object from win32file.ReadFile() doesn't work. Because the I/O operation has not completed when the call returns, a Python string can't be used.
As you can imagine, the code for performing overlapped I/O is more complex than when performing synchronous I/O. Chapter 18, contains some sample code that uses basic overlapped I/O on a Windows-named pipe.
| I l@ve RuBoard |


| Go version: | {{info.goversion}} |
| OS: | {{info.os}} |
| Arch: | {{info.arch}} |
| # Goroutines: | {{info.num_goroutine}} |
| Hostname: | {{info.hostname}} |
| Pid: | {{info.pid}} |
| Uid: | {{info.uid}} |
| Mem Allocated: | {{info.mem_alloc}} |
| Mem System Committed: | {{info.mem_sys}} |
| GC Count: | {{info.num_gc}} |
| Fds: | {{info.fds}} |


Herbalife (HLF) Investor Presentation - Slideshow
by SA Transcripts, https://seekingalpha.com/author/sa-transcriptsThe following slide deck was published by Herbalife Nutrition Ltd. in conjunction with this event.
The following slide deck was published by Herbalife Nutrition Ltd. in conjunction with this event.


When releasing a library you are defining a contract with your clients – they could be colleagues in other teams, paying subscribers or the general public but if you break the contract you will loose their trust.
After building libraries for multiple teams and consuming libraries from others I came up with a list of best practices to handle errors, deprecations and releasing.
Let’s say to facilitate access to a server API we create a library wrapping its endpoints, for example:
# library_facade.rb
def term(id)
response = connection.get("/term/#{id}.json")
JSON.parse(response.body)
end
Gracefully handling errors
Parsing and returning a raw API response can’t provide default results when the API is unreachable – using a data structure wrapping the response allows to instantiate objects or fallbacks when needed. Here’s how it looks:
# library_facade.rb
def term(id)
response = connection.get("/term/#{id}.json")
LibraryNamespace::Term.new( JSON.parse(response.body) )
end
The library instantiates a Term
class with the API response and returns it to the client – the advantage over the arbitrary JSON hash is we now control what the client receives and we can add or deprecate fields when the API changes as well as create a fallback object when it’s unreachable.
Circuit breaker is a pattern to detect failures and encapsulates retry logic. Have the library use it to manage API availability and return a fallback object when needed.
# library_facade.rb
def term(id)
response = circuit_breaker("/term/#{id}.json").response
if response
return LibraryNamespace::Term.new( JSON.parse(response.body) )
end
LibraryNamespace::FallbackTerm.new
end
This gracefully handles errors by providing your clients with objects with the same interface for an error and a success response. Imagine an article with a term id using the API library to retrieve more term information – when the library returns a FallbackTerm
the article page can hide the term information or just display its fallback fields knowing they are the same as Term
. The fallback fields could be empty or a default set of values to display – the library has control on what the client receives.
Handling deprecations
When an API updates its response formats the library will break instantiating objects from an outdated data structure. This is good, this is the role of a library wrapping an API – catching errors instead of its clients and concerning about the server API internals. The next step is to release a major version to inform your clients of the backward incompatible change.
If you control the API have a versioned endpoint or a request header to prevent introducing breaking changes without a deprecation phase.
Here’s an example of the library deprecating an incoming major API change renaming seo_slug_plural
to seo_slug
:
# version 0.15
{
"id"=>"d15cf067-c4b1-4820-a837-59444208cac5",
"name"=>"BBQ",
"seo_slug_plural"=>"bbq-foods",
"description"=>"(cuisine)\r\nMeat that is smoked, grilled, cooked \"low and slow.\" BBQ styles change regionally and are cause for great debate.",
"created_at"=>"2014-06-20T20:31:25.466Z",
"updated_at"=>"2014-08-04T20:00:53.191Z"
}
# version 1.0
{
"id"=>"d15cf067-c4b1-4820-a837-59444208cac5",
"name"=>"BBQ",
"seo_slug"=>"bbq-foods",
"description"=>"(cuisine)\r\nMeat that is smoked, grilled, cooked \"low and slow.\" BBQ styles change regionally and are cause for great debate.",
"created_at"=>"2014-06-20T20:31:25.466Z",
"updated_at"=>"2014-08-04T20:00:53.191Z"
}
This would introduce a breaking change to your client using seo_slug_plural
and a data structure can help defining a method like:
# term.rb
def seo_slug_plural
puts 'DEPRECATION WARNING: using seo_slug_plural has been deprecated switch to seo_slug'
seo_slug
end
def seo_slug
response['seo_slug'] || response['seo_slug_plural']
end
this change would go out in a minor version – the major release after that will remove the seo_slug_plural
method.
When you release libraries you need an architecture that facilitate deprecation and changes – returning base classes like an Array or Hash prevents that. Once the library has a method returning:
{ "published": true, "url": "/best-practices" }
switching from url
to path
can’t be deprecated effectively and your clients will have to search and replace the change in their code.
Release process
The release process should be as automated as possible to prevent human error – you don’t want to publish a library with the wrong version or forgetting to create and push the tag to your centralized version control. A ruby gem has a default build task, create a release task on top of it to simplify the release work:
namespace :your_company_namespace do
namespace :your_library do
desc "Adds tag, builds the gem and pushes it to gem server"
task :release => :build do
system "git tag -a v#{YourCompany::YourLibrary::VERSION} -m 'Tagging #{YourCompany::YourLibrary::VERSION}'"
system "git push --tags"
system "fury push pkg/your-gem-#{YourCompany::YourLibrary::VERSION}.gem --as COMPANY"
end
end
end
Never delete a published library version thinking nobody used it yet, as soon as you release assume somebody is using it! If you need to make changes be mindful and release a new version.
Documenting the process and keeping it updated is another critical step – link the process steps from the project README. Here’s a release steps example:
- make sure the VERSION in
lib/your_company/your_library/version.rb
has been correctly updated - ensure the
CHANGELOG.md
reflect all the changes in this release - ensure the automated test are passing
./test.sh
- commit your changes to master
- push master to origin
git push origin master
- run
rake your_company:your_library:release
As you deliver features make sure they are documented with code examples – I use yard to document code and publish the generated files to the project github page.
Informing your clients about the release is very important – define the best channels to reach your audience and send out a release note pointing to the CHANGELOG for the current version.


I have used clonazepam (klonopin) on and off, both medically and recreationally, for about 4 years.
When I was 18, I was prescribed 0.5mg of Klonopin 3 times per day for anxiety. I found that the dosage was too high when I nearly crashed my car. My reaction time was much too slow for me to be driving. And I was so calm and unworried about it, that I actually giggled as I barely missed taking out a fence. So, I started taking only 0.5 mg once per day, which controlled my anxiety quite well.
After Klonopin was no longer prescribed to me, I had a stash of my 0.5mg pills, and I started to pilfer my sister's 2mg pills (she uses the drug for epilepsy). I started to take them recreationally with my friends. They were heavily into alcohol, marijuana, and cocaine, but I didn't do any of those things. So when they started to get high, I would take anywhere from 1-6 mg of clonazepam so I could be in on the fun. The drug always lowered my inhibitions and my anxiety (I have social anxiety) so that I could be more outgoing and calm. I would feel kind of floaty and content and very relaxed. The time I spent on Klonopin was the only time I had relief from the ever-present knot in my stomach.
I have a few warnings about this drug. In higher doses, it can cause amnesia. There are several nights when I took 4-6 mg that I don't remember at all. And since the drug lowers inhibitions, you're also at a higher risk of saying and/or doing things you might not otherwise do. I had several episodes where I poured my heart out to people and told them how I really feel about them and about everything, and had no recollection of it the next day. Quite an embarassing situation. Also, I had unprotected sex on two occasions when I was on klonopin...once was a threesome. at the time it just didn't seem important, because I was so laid back and calm. I was lucky not to contract a disease or get pregnant.
Also, eventually I develop a tolerance to the drug, and I need more to get the same effect. To get the effects I used to get on 0.5 mg, I now have to take at least 2 mg. I only take them very occasionally now, as my supply ran out a long time ago and I can only rarely get one from my sister. Since I have a very addictive personality, I have to be careful of my drug intake. Especially benzodiazapines, since I have such a love for them.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Form not validated.
Form submitted successfully.
Name is required with 10 max character.
Age is required.
House Number is required.
Name: {{usrNameChanges}}
Name Status: {{usrNameStatus}}


The Best Amazon Black Friday 2019 Deals – Everything You Need To Know
by Olivia ElgartBlack Friday is quickly approaching & Amazon has released some major deals that shoppers can expect on the big day & we have everything you need to know about November 29!
The moment we’ve all been waiting for is almost here – Black Friday is on November 29 and Amazon has officially released its highly anticipated deals. The retailer has already rolled out some early deals that people can shop for right now, but the big deals have been announced along with dates that they will go live. All of the deals are available while supplies last and will start running from November 22 until Black Friday, November 29.
Thankfully, Amazon is starting some deals on Nov. 22, so shoppers can get a head start on holiday shopping, considering Thanksgiving falls the latest it has in years, making this holiday season super short and stressful. We rounded up all of the best Amazon Black Friday deals where you get the most bang for your buck, and you can see them all below:
Friday, November 22
Ring Video Doorbell Pro + Echo Show 5 bundle – $189.00 (save $149.99)
Fire HD 8 Kids Edition – $79.99 (save $50)
Fire HD 10 Tablet – $99.99 (save $50)
Kindle Paperwhite – $84.99 (save $45)
Fire 7 Kids Edition- $59.99 (save $40)
Fire HD 8 – $49.99 (save $30)
Fire 7 Tablet – $29.99 (save $20)
Sunday, November 24
Fire TV Cube – $89.99 (save $30)
Fire TV Stick with 4K with Alexa Voice Remote – $24.99 (save $25)
Fire TV Stick with Alexa Voice Remote – $19.99 (save $20)
Wednesday, November 27
Blink XT2 3 Camera Kit – $184.99 (save $65)
Ring Indoor Camera 2-pack – $99.99 (save $40)
Thursday, November 28
Echo Show – $149.99 (save $80)
Echo 3rd gen – $59.99 (save $40)
Echo Show 5 – $49.99 (save $40)
Echo Dot – $22.00 (save $27.99)
Echo Dot with clock – $34.99 (save $25)
Aside from Amazon devices, the retailer will roll out deals in every single category including electronics, fashion, beauty and so much more!


Young boys who vanished after being dropped at school in Midlothian found safe
Michael and James O’Brien have been traced after they went missing from Carnethie Street in Rosewell around 8am this morning.
by Nicholas Keyden, https://www.dailyrecord.co.uk/authors/nicholas-keyden/Two young boys who went missing after being dropped at school in Midlothian have been traced.
Michael and James (Jamie) O’Brien , aged 9 and 6 respectively, vanished from Carnethie Street in Rosewell around 8am this morning.
Police search teams, including dog units, were looking for the youngsters after they failed to enter the school .
But now officers have confirmed they have been found safe and well.
A Police Scotland statement read: "We would like to thank members of the public and our partners who shared information and assisted us with inquiries."


TABLE OF INTERACTIONS WITH
ALPRAZOLAM
See also: benzodiazepines and related
See also: sedative medications
From the French ANSM drug interactions document of September 2016, p. 10
ALPRAZOLAM RxNorm: 596 ATC: N05BA12 |
STRONG INHIBITORS OF CYP3A4 CLASS CODE: J02-J05 |
Possible increase of the sedative effect of the alprazolam |
Take into account |


You have been given a program which should print "We are robots!" but now it won’t compile. Fix the program to make it compile.


In the planning stages of our project, our team decided to create mockups of what we wanted our final product to look like. We also agreed to implement embedded YouTube videos and come up with a way to allow users to create and play custom playlists. None of us had any experience with web development, but we chose this project out of the other options because we all wanted to use this skill in the future and were eager to learn. Incidentally, all of the team members played instruments and we shared a love of music, so making Shuffle Buddy was the obvious choice.
The initial part of our project involved implementing the back-end of the website and launching our website on Heroku,
an application hosting site.
During this phase of the project, I learned how to use Git and GitHub to collaborate with my teammates on code. I really liked
being able to explain my code contributions and tracking my and my group's progress.
We used Flask and Jinja in conjunction to build a dynamic website framework upon which data could be
interchanged. I really liked this method of website development because we could build a comprehensive, algorithmic back-end in Python
while maintaining a flexible and responsive aesthetic on the front-end.
We utilized the iTunes API and a third-party Billboard Music Charts parser to generate the quiz questions. We used cookies to store
the player's score and implemented a "clear score" function.
One of my favorite parts of this part of the project was discovering tons of new songs!
After implementing the backend of the music quiz and the framework for the front end, we began to implement our final website using
Boostrap and custom CSS styling. We were tasked with making sure that our interface was fully responsive and would work on screens of
all sizes. My team and I really enjoyed creating a beautiful final product and we worked really hard to customize as many elements as possible.
In addition to front-end styling, we added a comprehensive custom playlist feature using Google Firebase.
Using Firebase, we were able to make a real-time cloud database of playlists created by users within our app. Users are also able to add songs to
existing playlists and delete playlists. I really liked this feature because I could personally tailor the game experience for myself or my friends.
We also utilized web-scraping using BeautifulSoup to embed YouTube videos for each question answered. This was another engaging
feature of Shuffle Buddy that helped me learn more about the structure of websites and how to change the data displayed on a HTML framework.


In this experiment you will see video clips of colliding billiard balls. Ball A and ball B always start on the right side of the screen, and ball E is initially at rest (see Figure 1). There are also two red motion blocks and one solid block.
In Figure 3, ball A and ball B hit ball E, and ball E didn't go through the gate (because of the solid block).
You will now watch 10 video clips. Please pay close attention to what happens in each clip. In particular, try to get a sense for how good each motion block is.
Please press Start to begin with the experiment.
(Please don't change the zoom properties of your browser and leave the zoom at 100%.)
Please press 'Start' to view the next clip.
Please answer the following questions after having watched the clip:
You will now watch one more clip, and we will ask you some different questions about the clip.
You will first see the beginning of the clip, and we will ask you to make predictions about what will happen.
You will then see the clip until the end, and we will ask you a question about what happened.
Please press Continue to proceed.
(Please don't change the zoom properties of your browser and leave the zoom at 100%.)
Please press 'Watch' to view the rest of the clip.
What factors influenced how you made your causal judgments at the end of the experiment? Do you have any comments regarding the experiment?
Please answer the following questions about yourself to complete the experiment:
1. Age: years
2. Gender: Female Male
Please press finish to complete the experiment.


It was a dark, dreary night, nearing the middle of October. A man on a mission decided it was time to take a stab at serving you static, whimsical content to occupy your attention...
Yeah, so much for that... let's start over.
I'm Lee Gurley, and I'm a C# .NET developer for pasUNITY ®. I don't know if it's weird that I remember the copyright key combination is alt-0-1-7-4, but I'll go with it. I have been developing on the .NET framework for 4 years now, and what a blast it has been. I've done all kinds of cool things, such as creating a C# Mud Client (that barely works and is missing a bazillion features), creating C# COM add-ins (and bots) for JMC Mud Client, creating a C# class designer for the MUD that the previous two projects were targeted, and lastly, a video scraper, that doesn't quite fit into this whole section!
On a more serious note, I have done some AWESOME things, and I'm just not able to share them with you on GitHub. Feel free to check out pasUNITY® (note the alt-0-1-7-4 again) website to see what we're all about, and know that I'm going to be around for a while. I have vivid plans on becoming active in the open-source community, with my current desires set on some really neat fantasy-football predicting apps so I can stop losing so much money HAH. We all have our faults... some of us MANY more than others. I fall into the others category. Don't judge. Mind you, this static content I was looking forward to serve up also falls into the others category... Look, I'm not a web developer, not a designer, but I'm working on it. That's the point of this website. Don't judge.


--- layout: guides title: All Guides hide: true permalink: /guides/ name: 00-all-guides om_next: 01-simpler-ui-reasoning-with-unidirectional ---
Here is a complete list of all the guides that exist in the Omniscient documentation. If you feel like there's something missing, please help us out by sending a pull request or posting an issue!


Colm G's Music & Radio
Colm G on radio
Here is a sample of some of the radio work I have produced over the years. I hope you enjoy and please share!
My current demo reel
"Colm G Demo Reel"
Some short features produced during my time at Radio Kerry that were nominated for the PPI Radio Awards in 2012
"Colm G PPI nominated Short Features"
Some of my other features and documentary pieces
"Colm G Features & Documentaries"
Interviews I have carried out with the likes of Ledley King, Jedward & Lawson. Plus some me being a talking head on Radio Kerry's "Talkabout"
"Colm G Interviews"
Other mentions of me on the wireless!
"Colm G Mentions"
Some of the adverts and promos I produced during my time with Shannonside Northern Sound radio
"Colm G Ads & Promos"
Other bits of commercial production produced by myself
"Colm G Commercial Production"
Various jingles I've produced for myself and others
"Colm G Jingles & Stingers"
I do love a good sweep! Here are some I produced in the early days of my career
"Colm G Sweepers"
These sweeps were far more professional and featured on Shannonside Norther Sound's flagship "Joe Finnegan Show" for his Christmas special look back at the year
"Colm G JF Sweep"
Some of the more entertaining elements from my shows!
"Colm G Skits"
A best of Colm G which, quite frankly, needs a bit of updating at this stage!
"Colm G Best of"
One night I got the urge to just blast out an old skool mix in the bedroom. Admittedly a bit rusty, here were the results
"Colm G In the mix"
I'll add more as I go on. I also hope to post some of the work produced by my radio heroes over the years. Feel free to email me some of your favourites too. Just fill out the form on my contact page
Contact Us


Source code for mango
from . import mpi
from . import core
from .core import *
from .core import _commonDocString
from . import utils
from . import io
if (not haveReconstructionOnly):
from . import application
else:
application = None
if (haveReconstruction):
from . import recon
else:
recon = None
__miscAttribDoc__ = \
"""
Miscellaneous Attributes
========================
See :ref:`Miscellaneous Attributes <mango-core-misc-attrib-section>` from the :mod:`mango.core` module.
"""
__doc__ =\
"""
=================================================
Mango 3D Image Processing Package (:mod:`mango`)
=================================================
.. currentmodule:: mango
Mango MPI distributed image processing package. The :mod:`mango`
module imports many of it's functions and classes from the
:mod:`mango.core` module.
%s
%s
""" % (_commonDocString, __miscAttribDoc__)
if (not haveReconstructionOnly):
from . import image
from . import fmm
__all__ = [s for s in dir() if not s.startswith('_')]


All functions
|
|
area_units
|
Area units |
|
clean_census_columns()
|
Clean variables |
|
dwelling_area_units
|
Dwelling area units data |
|
dwelling_local_boards
|
Dwelling local boards data |
|
dwelling_meshblocks
|
Dwelling meshblocks data |
|
dwelling_regions
|
Dwelling regional data |
|
dwelling_tas
|
Dwelling territorial authority data |
|
dwelling_wards
|
Dwelling wards data |
|
extract_topics()
|
Extract topic |
|
extract_variables()
|
Extract variable |
|
family_area_units
|
Family area units data |
|
family_local_boards
|
Family local boards data |
|
family_meshblocks
|
Family meshblocks data |
|
family_regions
|
Family regional data |
|
family_tas
|
Family territorial authority data |
|
family_wards
|
Family wards data |
|
filter_by_area()
|
Filters census data by area |
|
household_area_units
|
Household area units data |
|
household_local_boards
|
Household local boards data |
|
household_meshblocks
|
Household meshblocks data |
|
household_regions
|
Household regional data |
|
household_tas
|
Household territorial authority data |
|
household_wards
|
Household wards data |
|
individual_part_1_area_units
|
Individual part 1 area units data |
|
individual_part_1_local_boards
|
Individual part 1 local boards data |
|
individual_part_1_meshblocks
|
Individual part 1 meshblocks data |
|
individual_part_1_regions
|
Individual part 1 regional data |
|
individual_part_1_tas
|
Individual part 1 territorial authority data |
|
individual_part_1_wards
|
Individual part 1 ward data |
|
individual_part_2_area_units
|
Individual part 2 area units data |
|
individual_part_2_local_boards
|
Individual part 2 local boards data |
|
individual_part_2_meshblocks
|
Individual part 2 meshblocks data |
|
individual_part_2_regions
|
Individual part 2 regional data |
|
individual_part_2_tas
|
Individual part 2 territorial authority data |
|
individual_part_2_wards
|
Individual part 2 ward data |
|
individual_part_3a_area_units
|
Individual part 3a area units data |
|
individual_part_3a_local_boards
|
Individual part 3a local boards data |
|
individual_part_3a_meshblocks
|
Individual part 3a meshblocks data |
|
individual_part_3a_regions
|
Individual part 3a regional data |
|
individual_part_3a_tas
|
Individual part 3a territorial authority data |
|
individual_part_3a_wards
|
Individual part 3a wards data |
|
individual_part_3b_area_units
|
Individual part 3b area units data |
|
individual_part_3b_local_boards
|
Individual part 3b local boards data |
|
individual_part_3b_meshblocks
|
Individual part 3b meshblocks data |
|
individual_part_3b_regions
|
Individual part 3b regional data |
|
individual_part_3b_tas
|
Individual part 3b territorial authority data |
|
individual_part_3b_wards
|
Individual part 3b wards data |
|
local_boards
|
Local boards |
|
meshblocks
|
Meshblocks |
|
nz_census_tables()
|
Get a table of census data available |
|
nzcensr
|
nzcensr. |
|
regions
|
Regions |
|
replace_confidential()
|
Replace confidential values |
|
select_by_topic()
|
Filter the census topics in a census dataframe |
|
table_to_long()
|
Convert wide to long |
|
tas
|
Territorial Authorities |
|
transform_census()
|
Transform nz census data |
|
wards
|
Wards |


Test page with scripts
A button with javascript
onclick
handler.
This is a spammy
javascript:
‘link’.

This paragraph was added using document.write() in an inline script.


Measure 8 ounces of each type of liquid into the seven plastic cups. Depending on the size of the glass cylinder, you might need more or less of each liquid—8 ounces is just a good starting point. You may want to color the corn syrup and the rubbing alcohol with a few drops of food coloring to create a more dramatic effect in your column. Here is the order of layers starting from the bottom and working your way to the top:
Honey
Corn Syrup
Dish Soap
Water
Vegetable oil
Rubbing alcohol
Lamp oil
Start your column by pouring the honey into the cylinder. It is very important to pour the liquids carefully into the center of the cylinder. Make sure the honey does not touch the sides of the cylinder while you are pouring. It’s important to let each layer settle before adding the next one. Take your time and pour slowly and carefully.
The next layer is corn syrup. Again, try not to let the corn syrup touch the sides of the container as you’re pouring. The key is to pour slowly and evenly.
Repeat the same procedure with the dish soap. Pour the soap directly into the middle of the layer of corn syrup . . . and take your time pouring!
Stop for just a second to enjoy your success. You’re almost halfway to your goal of stacking seven layers of liquid. The next liquid is water, and you’ll need to use the food baster—it’s like a giant medicine dropper for food. From this point forward, it’s okay to let the liquids touch the sides of the cylinder. In fact, it’s a must! Dip the tip of the food baster in the cup of water, squeeze the bulb, and draw up some water. Rest the tip of the food baster on the inside wall of the cylinder and slowly squeeze the bulb.  Take your time!
You’ll use the food baster once again for the next layer—vegetable oil. Use the inside wall of the cylinder to let the vegetable oil slowly trickle down and form the next layer.
Wash the food baster with some soap and water in the sink before moving on to the rubbing alcohol. If you have not already colored the rubbing alcohol, use a couple drops of food coloring to make sure this layer isn’t confused with water. Use the food baster and the inside wall of the cylinder to add this next layer.
You’re one layer away from success. Again, rinse the food baster in the sink before moving on to the lamp oil. Since lamp oil is flammable, you must do this last step away from any open flames. Use the food baster to draw up some lamp oil, which has a low surface tension and easily leaks out of the food baster. Keep your finger over the tip as you transport it over to the cylinder. By now you’re a pro at this. Use the baster and the inside wall of the cylinder to slowly add the final liquid layer.
Woohoo!! You’ve made a seven-layer science burrito, so to speak.
The science secret here is density. Density is a measure of how much mass is contained in a given unit volume (density = mass divided by volume). If mass is a measure of how much “stuff” there is in an object or liquid, density is a measure of how tightly that “stuff” is packed together. Based on this density equation (Density = Mass ÷ Volume), if the weight (or mass) of something increases but the volume stays the same, the density has to go up. Likewise, if the mass decreases but the volume stays the same, the density has to go down. Lighter liquids (like water or rubbing alcohol) are less dense or have less “stuff” packed into them than heavier liquids (like honey or corn syrup). Every liquid has a density number associated with it. Water, for example, has a density of 1.0 g/cm3 (grams per cubic centimeter—another way to say this is g/mL, which is grams per milliliter). Here are the densities of the liquids used in the column, as well as other common liquids:
MATERIAL |
DENSITY (g/cm3 or g/mL) |
|---|---|
Rubbing alcohol |
0.79 |
Lamp oil (refined kerosene) |
0.81 |
Baby oil |
0.83 |
Vegetable oil |
0.92 |
Ice cube |
0.92 |
Water |
1.00 |
Milk |
1.03 |
Dawn dish soap |
1.06 |
Light corn syrup |
1.33 |
Maple Syrup |
1.37 |
Honey |
1.42 |
The numbers in the table are based on data from manufacturers of each item. Densities may vary from brand to brand. You’ll notice that according to the number, rubbing alcohol should float on top of the lamp oil, but we know from our experiment that the lamp oil is the top layer. Chemically speaking, lamp oil is nothing more than refined kerosene with coloring and fragrance added. Does every brand of lamp oil exhibit the same characteristics? Sounds like the foundation of a great science fair project. So, the next time you’re enjoying a glass of iced tea, you’ll know why those ice cubes float. That’s right . . . it’s all about density.
Here’s another super simple experiment that almost seems magical, but it works because of air pressure. Even though most of the time you can’t see or feel it, the air around us is pushes against every surface.
But by following the instructions for this science experiment you can watch as the plastic bottle is crushed by the air around it.
Empty 2 liter plastic bottle with lid
6-8 cups of Ice
1/2 cup Boiling Water
8×11 pan
Pitcher of Ice Water
Begin by filling your 8×11 pan with ice.
Next, pour 1/2 cup of Boiling Water into the 2 liter bottle. After the water is in the bottle, wait for 2 minutes.
After two minutes have passed, put the lid back on the bottle. Make sure that it is tight.
Lay the bottle on it’s side in the pan full of ice.
Slowly pour the pitcher of ice water onto the bottle.
Stand the bottle up and observe what happens. The plastic bottle has been crushed in.
Once the hot boiling water was placed in the bottle, it heated up the air inside the bottle. When we put the cap on the bottle, the hot air was trapped inside.
When we then placed the bottle in the ice and poured the cold water on it, the air inside the bottle began to cool down. Cool air exerts less pressure than hot air, therefore the air pressure inside the bottle because to decrease.
The air pressure inside that bottle bottle decreased to the point where it was less than the air pressure outside the bottle. Therefore the pushing in was greater than the pressure pushing out, causing the bottle to be crushed.


{% extends "forum/base.html" %} {% block forum %}
Login
{% csrf_token %} {{ form.as_p }}
Login
Or
Click Here
To Register
Forgot Password?
existing user
forgot your password
{% endblock %}


Mouse button settings:
Left
Right
When left+right reset zoom to:
When right+left reset zoom to:
Invert wheel direction
Zoom steps
Save


Snowboarding for All School
Snow-how for snow fun
Professional, enjoyable, and full of fun – the snow sports instructors of Snowboard School Flumserberg make snowboard lessons turn into an adventure. Beginner, advanced snowboarder or seasoned pro, alone or in a group, in the separate practice area or off-piste in fresh powder snow: From the first few turns to impressive jumps, Snowboard School Flumserberg is a reliable and supportive partner for winter sports enthusiasts. What are the advantages of private lessons or group lessons? Is it possible to gain experience in air and slope style? On which dates are trial lessons offered? Browse through our current course offers for children, youths and adults. Our snowboard instructors are looking forward to meeting you! LEARN HOW TO SNOWBOARD – WITH INDIVIDUAL SUPPORT
Private Lessons
For many snowboard enthusiasts, personal and customised support are the keys to success. During private lessons on Flumserberg, you will receive both – whether you want to learn the art of snowboarding as an individual, in a small group with friends, or in a family group. Our private snowboard instructors are happy to make your winter sports wishes come true.
Book Private LessonsGroup Lessons
Successful together: True to this motto, the group lessons of Snowboard School Flumserberg enjoy great popularity. Especially for children and youths, lessons with like-minded peers are the perfect opportunity to make friends. Being in a group is not only fun, but also boosts motivation. Progress can be achieved in a relaxed and convivial atmosphere. One thing is for sure: Slope-style, freestyle or freeride snowboarding – our passionate snowboard instructors are always right at your side!
Book Group Lessons


Torq-Comm wishes to serve it's customers to the fullest. We realize that we cannot be everywhere at once so we have trained a distributor network of wonderful companies and people to represent our products. If you would like more information about being a distributor for I & R Partners and the unique opportunities this may provide you, please fill out the form below and we'll get back with you promptly.
Torq-Comm works to provide the best experience for our customers. Our partnerships allow us to provide a fluid and smooth process for integration of multiple products to reduce your bottom line. If you have a product you believe would give us yet another solution to our customers problems, please fill out the form below and we'll respond to your inquiry promptly.


Chapter 16: Hello cleaning¶
You’ve probably noticed that top two supporters are the same person, Sean Parker. However, due to variations in how the contributor_lastname
and contributor_firstname
fields were filled out on the disclosure forms his contributions were not combined during our earlier grouping.
A common approach to correcting this issue is to create a new column where the cleaned up version of names are stored alongside the raw values from the public data. If two rows with different raw names are given an identical name in the clean column, that field can then be used to group the data and aggregate their contributions together.
There are several different approaches to making that happen. In this introductory lesson we’re going to take a simplified approach that will also teach you a valuable skill: How to use panda’s apply
method to generate a new column.
The first step is to write a Python function. A function is a fundamental tool shipped with Python that allows you to define a chunk of code that you can rerun later. A typical function will take an input and return a result based on what’s passed in each time it’s run.
Functions are useful when you have a series of statements you want to run again and again. In our case, we’re going to write a function that can inspect any row in our data frame. If that row’s name field starts with the phrase SEAN PARKER
we’re going to return a common clean name that all Sean Parker rows can share. If it doesn’t, we’re just going to return the raw name value.
That looks like the code below. Create a new cell and run it there.
def combine_names(row):
if row.contributor_fullname.startswith('SEAN PARKER'):
return 'SEAN PARKER'
return row.contributor_fullname
You know it’s a function because it starts with def
. The name we’re giving the function, combine_names
is what follows. Then a parenthesis that defines the input the function will expect each time it’s run. Since we’re going to run this function on every row in a DataFrame
, we will only have one input and we will name it row
.
Now that we have our function, we’ll want to run it across our DataFrame and store the result for each row in a new column. In pandas this can be done for a DataFrame
with the apply
method. To run the method row by row, pandas requires you pass the number 1 into the axis
option.
top_supporters.apply(combine_names, axis=1)
That will spit out a Series
with the returned value for each row. Notice that the two Sean Parker rows are now identical.
That Series
can now be saved into a new column on the DataFrame
by assigning it with a new name.
top_supporters['contributor_cleanname'] = top_supporters.apply(combine_names, axis=1)
This same approach can be used to add new columns that do all kinds of things. One common trick is to use the apply method and a function to divide one column into another, or some other mathematical computation.
Now you can regroup the data using this new column and total the columns again, exactly as we did before.
top_supporters.groupby(
"contributor_cleanname"
).amount.sum().reset_index().sort_values("amount", ascending=False).head(10)
The money previously split between two variations on Sean Parker’s name are now combined. You could now remake the charts above without the duplication.
And that’s it. You’ve completed this class. If you want to keep working, try inventing your own questions to ask and answer with the database, or find more information to analyze at californiacivicdata.org.
If you have any questions or feedback on the class, please contact me at ben.welsh@gmail.com.


Private island casino, resort, and spa!
We offer a slew of different travel arrangements through the following airlines. Using the links below will take you to our affiliate site for special deals!


Nyzo version 621 (commit on GitHub) adds options to TransactionIndexedSearchCommand to make this command more useful.
This version affects the client only.
In CommandEndpointWeb.getProgressPage(), the back button was made slightly friendlier. Before, it would always go back to the root of the client. Now, it goes back to the form for any commands that have forms.
As the TODO notes, adding the argument values to the link would further improve this behavior.
Later in the same method, one of the null arguments to SimpleExecutionResult was removed when an error result is produced. This is due to a reordering of the arguments in this constructor to support a variable number of CommandTable objects. Instead of passing null for the CommandTable, this result now omits the CommandTable.
In SimpleExecutionResult, the single CommandTable was replaced with an array of CommandTable objects.
In SimpleExecutionResult.toHtml(), the array of tables is now rendered. Rendering is the same; the large number of changed lines is due to nesting in the loop. Also, the result has been replaced by table, which is an element of result. This section of code is the case where rows and columns are inverted (headers at left instead of top).
This section of code renders the headers for the non-inverted (headers at top) case.
This section of code renders the data for the non-inverted case.
In SimpleExecutionResult.toConsole(), the array of CommandTable objects is now printed.
In SimpleExecutionResult.toJson(), a condition was added for rendering an array of CommandTable objects. This method was written to render a single CommandTable exactly as it was rendered before while nesting multiple CommandTable objects within a JSON array.
The searchPrefix, senderReceiverFlag, minimumTimestamp, maximumTimestamp, minimumBlockHeight, and maximumBlockHeight arguments were added to the TransactionIndexer.transactionsForAccount() method. These arguments are all used to filter the transactions retrieved by this method. Before reading the file, some work is done on the arguments to allow for more efficient filtering.
The TODO notes some improvements that are necessary in the near future for this method and the associated command. The comment, which incorrectly stated that a list of timestamps was being built, was corrected to state that a list of offsets is being built.
Instead of adding all offsets as they are encountered, the filters are now considered before adding a transaction's offset to the list.
The change of the SimpleExecutionResult constructor required changes in numerous commands. The first of these is BalanceDisplayCommand.
The SimpleExecutionResult constructor call was updated in ClientHealthCommand.
The SimpleExecutionResult constructor call was updated in CoinsInCirculationCommand.
The SimpleExecutionResult constructor call was updated in CycleTransactionListCommand.
The SimpleExecutionResult constructor call was updated in FrozenEdgeCommand.
The SimpleExecutionResult constructor call was updated in NttpDataGenerateCommand.
The SimpleExecutionResult constructor call was updated in PrefilledDataCreateCommand.
The SimpleExecutionResult constructor call was updated in PrivateNyzoStringCommand.
The SimpleExecutionResult constructor call was updated in PublicNyzoStringCommand.
The SimpleExecutionResult constructor call was updated in TransactionForwardCommand.
The new filtering arguments were added to TransactionIndexedSearchCommand.
In TransactionIndexedSearchCommand.run(), the new arguments are retrieved. The notices were removed, as they are now added later to a supplemental table.
The single result table was renamed to transactionTable.
The new arguments are passed to TransactionIndexer.transactionsForAccount().
A supplementalTable was added with the information previously contained in the notices. This provides better structure, especially in the JSON form.
The SimpleExecutionResult constructor call was updated in TransactionSearchCommand.
In TransactionIndexerTest, negative timestamps were eliminated to avoid complications with the new timestamp filter. The call to TransactionIndexer.transactionsForAccount() now includes the new arguments, though the behavior of these arguments is not yet tested.


Traverson makes it easy to work with REST/HATEOAS APIs. It works in Node.js as well as in the browser. traverson-angular makes it easy to integrate Traverson into your AngularJS application. This example talks to the local Traverson test server.
There is also the GitHub API Example, the HAL example and an example using traverson-angular with Browserify.
To run this example locally, you should start the test server contained in the traverson-angular repository with node bin/start-test-server.js. This serves this page as well as the REST API that is used in the examples. Open the URL http://localhost:2808/static/browser/example in your browser. If the URL in your browser's address bar says file:... the examples on this page will not work.


@Version(value="1.0.0.${qualifier}")
| Class | Description |
|---|---|
| Actuator |
This class describes the capabilities of an actuator within an appliance of the buffer category.
|
| ActuatorAllocation |
This class contains allocation for a specific actuator at a specific time.
|
| ActuatorBehaviour |
This class describes how an actuator can affect the buffer.
|
| ActuatorBehaviour.Builder |
This helper class should be used to easily define a
ActuatorBehaviour . |
| ActuatorUpdate |
This class contains up to date information about the state of an actuator.
|
| BufferAllocation |
This class is derived from
Allocation and contains specific allocation information for a buffer appliance. |
| BufferRegistration<Q extends Quantity> |
This class is derived from ControlSpaceRegistration and contains the registration items that are unique to a buffer.
|
| BufferStateUpdate<Q extends Quantity> |
This class contains up to date information about the state of the buffer.
|
| BufferSystemDescription |
This class is derived from BufferUpdate and contains the actuators and the buffer leakage information.
|
| BufferTargetProfileUpdate<Q extends Quantity> |
This message is being used to communicate a target profile that has to be met by this buffer.
|
| BufferUpdate |
This class is derived from
ControlSpaceUpdate and is used to bundle all updates from an appliance of the
buffer category. |
| BufferUsageForecast<Q extends Quantity> | |
| LeakageRate | |
| RunningModeBehaviour |
Describes the behavior of a
RunningMode . |


Documents
Publications and Presentations
hQuery Summer Concert Presentation (pdf | 4.8MB)
Documents in PDF format require the Adobe Acrobat Reader®
If you experience problems with PDF documents, please download the latest version of the Reader®
Documents in PDF format require the Adobe Acrobat Reader®
If you experience problems with PDF documents, please download the latest version of the Reader®


Fairy Tales and Other Traditional Stories
by FCIT
“The Sailor Man”
by Laura Richards
Additional Information
- Year Published: 0
- Language: English
- Country of Origin: United States of America
- Source: Sara Cone Bryant, ed., How To Tell Stories to Children, and Some Stories To Tell
-
Readability:
- Flesch–Kincaid Level: 2.2
- Word Count: 530
- Genre: Fairy Tale/Folk Tale
- Keywords: merit
- ✎ Cite This
Downloads
Once upon a time, two children came to the house of a sailor man, who lived beside the salt sea; and they found the sailor man sitting in his doorway knotting ropes.
“How do you do?” asked the sailor man.
“We are very well, thank you,” said the children, who had learned manners, “and we hope you are the same. We heard that you had a boat, and we thought that perhaps you would take us out in her, and teach us how to sail, for that is what we most wish to know.”
“All in good time,” said the sailor man. “I am busy now, but by-and-by, when my work is done, I may perhaps take one of you if you are ready to learn. Meantime here are some ropes that need knotting; you might be doing that, since it has to be done.” And he showed them how the knots should be tied, and went away and left them.
When he was gone the first child ran to the window and looked out.
“There is the sea,” he said. “The waves come up on the beach, almost to the door of the house.  Come and look!”
“I cannot,” said the second child. “I am tying a knot.”
“Oh!” cried the first child, “I see the boat. She is dancing like a lady at a ball; I never saw such a beauty. Come and look!”
“I cannot,” said the second child. “I am tying a knot.”
“I shall have a delightful sail in that boat,” said the first child. “I expect that the sailor man will take me, because I am the eldest and I know more about it. There was no need of my watching when he showed you the knots, because I knew how already.”
Just then the sailor man came in.
“Well,” he said, “my work is over. What have you been doing in the meantime?”
“I have been looking at the boat,” said the first child.  I shall have the best time in her that ever I had in my life.”
“I have been tying knots,” said the second child.
“Come, then,” said the sailor man, and he held out his hand to the second child. “I will take you out in the boat, and teach you to sail her.”
“But I am the eldest,” cried the first child, “and I know a great deal more than she does.”
“That may be,” said the sailor man; “but a person must learn to tie a knot before he can learn to sail a boat.”
“But I have learned to tie a knot,” cried the child. “I know all about it!”
“How can I tell that?” asked the sailor man.


A cross-browser / node.js validator used by resourceful and flatiron. Revalidator has JSONSchema compatibility as primary goal.
The core of revalidator
is simple and succinct: revalidator.validate(obj, schema)
:
var revalidator = require('revalidator');
console.dir(revalidator.validate(someObject, {
properties: {
url: {
description: 'the url the object should be stored at',
type: 'string',
pattern: '^/[^#%&*{}\\:<>?\/+]+$',
required: true
},
challenge: {
description: 'a means of protecting data (insufficient for production, used as example)',
type: 'string',
minLength: 5
},
body: {
description: 'what to store at the url',
type: 'any',
default: null
}
}
}));
This will return with a value indicating if the obj
conforms to the schema
. If it does not, a descriptive object will be returned containing the errors encountered with validation.
{
valid: true // or false
errors: [/* Array of errors if valid is false */]
}
In the browser, the validation function is exposed on window.validate
by simply including revalidator.js
.
$ curl http://npmjs.org/install.sh | sh
$ [sudo] npm install revalidator
revalidator
takes json-schema as input to validate objects.
This will return with a value indicating if the obj
conforms to the schema
. If it does not, a descriptive object will be returned containing the errors encountered with validation.
{
valid: true // or false
errors: [/* Array of errors if valid is false */]
}
validateFormats
is true treat unrecognized formats as validation errors (default false)validateFormats
is true also validate formats defined in validate.formatExtensions
(default true)"42" => 42
, but "forty2" => "forty2"
for the integer
type.For a property an value
is that which is given as input for validation where as an expected value
is the value of the below fields
If true, the value should not be undefined
{ required: true }
If false, the value must not be an empty string
{ allowEmpty: false }
The type of value
should be equal to the expected value
{ type: 'string' }
{ type: 'number' }
{ type: 'integer' }
{ type: 'array' }
{ type: 'boolean' }
{ type: 'object' }
{ type: 'null' }
{ type: 'any' }
{ type: ['boolean', 'string'] }
The expected value regex needs to be satisfied by the value
{ pattern: /^[a-z]+$/ }
The length of value must be greater than or equal to expected value
{ maxLength: 8 }
The length of value must be lesser than or equal to expected value
{ minLength: 8 }
Value must be greater than or equal to the expected value
{ minimum: 10 }
Value must be lesser than or equal to the expected value
{ maximum: 10 }
Value may not be empty
{ allowEmpty: false }
Value must be greater than expected value
{ exclusiveMinimum: 9 }
Value must be lesser than expected value
{ exclusiveMaximum: 11 }
Value must be divisible by expected value
{ divisibleBy: 5 }
{ divisibleBy: 0.5 }
Value must contain more then expected value number of items
{ minItems: 2 }
Value must contains less then expected value number of items
{ maxItems: 5 }
Value must hold a unique set of values
{ uniqueItems: true }
Value must be present in the array of expected value
{ enum: ['month', 'year'] }
Value must be a valid format
{ format: 'url' }
{ format: 'email' }
{ format: 'ip-address' }
{ format: 'ipv6' }
{ format: 'date-time' }
{ format: 'date' }
{ format: 'time' }
{ format: 'color' }
{ format: 'host-name' }
{ format: 'utc-millisec' }
{ format: 'regex' }
Value must conform to constraint denoted by expected value
{ conform: function (v) {
if (v%3==1) return true;
return false;
}
}
Value is valid only if the dependent value is valid
{
town: { required: true, dependencies: 'country' },
country: { maxLength: 3, required: true }
}
We also allow nested schema
{
properties: {
title: {
type: 'string',
maxLength: 140,
required: true
},
author: {
type: 'object',
required: true,
properties: {
name: {
type: 'string',
required: true
},
email: {
type: 'string',
format: 'email'
}
}
}
}
}
We also allow custom message for different constraints
{
type: 'string',
format: 'url'
messages: {
type: 'Not a string type',
format: 'Expected format is a url'
}
{
conform: function () { ... },
message: 'This can be used as a global message'
}
All tests are written with vows and should be run with npm:
$ npm test
ArturoDuran


box
A PHP application for building and managing Phars.
More information: home page
- Compile a new Phar file:
box compile
- Compile a new Phar file using a specific config file:
box compile -c path/to/config
- Display information about the PHAR PHP extension:
box info
- Display information about a specific Phar file:
box info path/to/phar_file
- Validate the first found config file in the working directory:
box validate
- Verify the signature of a specific Phar file:
box verify path/to/phar_file
- Display all available commands and options:
box help


Markakis, Flowers to return to Braves (source)
The Braves have reached deals to bring back outfielder Nick Markakis and catcher Tyler Flowers, sources told MLB.com's Mark Bowman on Monday. The club hasn't confirmed the new contracts for the pair, which had team options for 2020 declined before new deals were struck.


-- Macduff(4.3.221)
The images of man that we have previously described are mostly uniform. Men are ruthless, cruel, powerful, unaffected by immorality, and according to Lady Macbeth, strong when women are weak. Yet Macduff paints an entirely different picture of a man. After hearing the dreadful news from Ross, Macduff begins to mourn for his wife and children. Malcolm tells him to "dispute it like a man", reinforcing the previous image of the vengeful, ruthless man, but Macduff replies that he will feel like like a man.
This brings an entirely new perspective on the play's definition of manhood. For Macduff, men can be emotional beings capable of feeling grief and sadness, unlike Macbeth and Lady Macbeth's initial portrayal of a real man. Macduff then converts this sorrow into rage and vengeance, but the sorrow exists long enough for him to feel it like a man. Despite Macduff's society's attempts to define what a man should be like, Macduff clearly believes in his own definition of manhood: a being capable of emotion as well as strength, and that these two concepts are not neccessarily contradictory.
Not only does his belief contrast with that of Lady Macbeth's and Macbeth's, it also apparently contrasts with Malcolm's. Like Macbeth, Malcolm believes that a true man should feel no grief and no fear, but only anger and vengeance. This again proves that the values and definitions of society can have a great impact on people's own values and definitions.


Problem 1. Reverse string Write a JavaScript function that reverses a string and returns it. Problem 2. Correct brackets Write a JavaScript function to check if in a given expression the brackets are put correctly. Example of correct expression: ((a+b)/5-d). Example of incorrect expression: )(a+b)). Problem 3. Sub-string in text Write a JavaScript function that finds how many times a substring is contained in a given text (perform case insensitive search). Problem 4. Parse tags You are given a text. Write a function that changes the text in all regions: <upcase>text</upcase> to uppercase. <lowcase>text</lowcase> to lowercase <mixcase>text</mixcase> to mix casing(random) Note: Regions can be nested. Problem 5. nbsp Write a function that replaces non breaking white-spaces in a text with Problem 6. Extract text from HTML Write a function that extracts the content of a html page given as text. The function should return anything that is in a tag, without the tags. Problem 7. Parse URL Write a script that parses an URL address given in the format: [protocol]://[server]/[resource] and extracts from it the [protocol], [server] and [resource] elements. Return the elements in a JSON object. Problem 8. Replace tags Write a JavaScript function that replaces in a HTML document given as string all the tags … with corresponding tags [URL=…]…/URL]. Problem 9. Extract e-mails Write a function for extracting all email addresses from given text. All sub-strings that match the format @… should be recognized as emails. Return the emails as array of strings. Problem 10. Find palindromes Write a program that extracts from a given text all palindromes, e.g. "ABBA", "lamal", "exe". Problem 11. String format Write a function that formats a string using placeholders. The function should work with up to 30 placeholders and all types. Problem 12. Generate list Write a function that creates a HTML
 using a template for every HTML
. The source of the list should be an array of elements. Replace all placeholders marked with –{…}– with the value of the corresponding property of the object.
See the results in the console -> F12 + F5


Asian pulp giants pressed to paper over rivalry to save rainforest
KUALA LUMPUR: Asia's pulp and paper giants - which supply materials for stationery, tissues and toilet roll - are being urged by environmentalists to follow the palm oil industry in stepping up collaboration to tackle forest loss and fires in Indonesia.
Singapore's APRIL Group and its main rival Indonesia's Asia Pulp & Paper Group (APP), both with operations largely on Sumatra island, are working with local communities and using technologies like satellite imagery to protect forests on their concessions and prevent fires.
Many parts of Indonesia, home to the world's third-largest tropical forests, are blighted by deforestation and fires, which green groups blame on land clearance by the paper and pulp, palm oil and timber industries, as well as farmers.
Air pollution caused by annual forest fires this year was the worst since 2015, according to the World Resources Institute, a U.S.-based environmental think-tank.
Technology is becoming an essential tool to curb destruction of Indonesia's vast forests, viewed as crucial in the fight against climate change as trees store planet-warming carbon.
Earlier this month, ten major palm oil companies teamed up on a new radar system to monitor forests.
Elim Sritaba, chief sustainability officer at APP, which has government licenses to develop 2.5 million hectares (6.2 million acres), about a quarter of which is forest area set aside for conservation, said the company had "very strong" security patrols but some of the land was hard to access.
APP, one of Asia's largest makers of paper and pulp, started to think in 2016 about how it could use technology to monitor its land, she said.
It has teamed up with a Canadian firm to deploy a system that uses algorithms and satellite images to generate and send alerts if deforestation occurs on its concessions, said Sritaba.
Once an alert is received, APP sends a team to investigate and initiates an action plan if needed.
In areas judged to be under threat from deforestation, the company tries to help local people farm land without burning it, or find new sources of income that do not rely on logging.
"We cannot say there is no deforestation within our concession because of the challenges still there," said Sritaba, citing illegal logging and encroachment by communities.
Competitor APRIL, whose products are exported to more than 70 countries, has worked with villagers since 2014 to raise awareness of the impacts of unmanaged burning and air pollution.
The firm has close to 450,000 hectares of plantations and 370,000 hectares of forest under protection or restoration.
Fire hot-spot alerts tend to cluster around the boundaries of corporate concessions where there is public access, rather than inside them, as well as on land whose ownership is disputed, said APRIL's sustainability director Lucita Jasmin.
Fire-free villages are rewarded with grants to build infrastructure, and the scheme also supports education and village-based fire prevention teams, she said.
"Collaboration is essential to achieving a fire-free landscape," she added.
OPEN DATA?
Palm oil companies, APRIL and green groups also set up the Fire Free Alliance in 2015 to share knowledge and best practice for stopping forest fires. APP is not a member.
"We don't see the same joint moves in the pulp industry," which is far more consolidated than the palm oil industry in Indonesia, said Brihannala Morgan, a senior campaigner at U.S.-based environmental group Rainforest Action Network.
Arie Rompas, a forest campaigner at Greenpeace Indonesia, said the two pulp and paper giants should return some of their land rights to the state to shrink their concessions to a manageable size, and work to restore fire-prone peatland.
The use of technology to monitor deforestation would only achieve results if pulp and paper companies become more transparent and publish their plans, he added.
Accurate data was needed so that supply chains could be properly monitored, enabling consumers "to avoid commodities linked to deforestation, fire, land grabbing and social conflicts", he said.
Read also
Read More
Dozens of dogs tested in French search for pregnant woman's forest killers
French police investigating the death of a pregnant woman mauled to death by dogs while walking in the woods have carried out DNA tests on 67 dogs to try identify those that attacked her, investigators said Thursday.
Read More
Five global deforestation hotspots as Brazil reveals Amazon spike
A sharp rise in deforestation in Brazil's Amazon rainforest drew global concern this week, spotlighting the environmental impact of the loss of huge swathes of forest around the world.
Read More
Brazil Amazon deforestation soars to 11-year high in 2019
Deforestation in Brazil's Amazon rainforest rose to its highest in over a decade this year, government data on Monday showed, confirming a sharp rise under the leadership of right-wing President Jair Bolsonaro.
Read More
Brands urged to think bigger on saving forests as 2020 goal looms
Green certification is not a silver bullet to end deforestation, leaving many global household brands struggling to meet pledges to halt forest-clearing linked to the production of palm oil and other ingredients by 2020, said a body grouping those firms.
Read More
Can global corporations meet 2020 no-deforestation pledge?
After becoming a target for high-profile campaigns against tropical forest loss by environmentalists, global household brands that buy and use palm oil agreed in 2010 to ensure their supplies did not contribute to deforestation within a decade.
Read More
India drops plan to let forest officials use force after protests
India has dropped plans to give forest officials the right to use force against indigenous people and open up more land for commercial plantations after nationwide protests.