module Format:{
..}
This module implements a pretty-printing facility to format text within 'pretty-printing boxes'. The pretty-printer breaks lines at specified break hints, and indents lines according to the box structure.
For a gentle introduction to the basics of pretty-printing using
Format
, read
http://caml.inria.fr/resources/doc/guides/format.en.html.
You may consider this module as providing an extension to the
printf
facility to provide automatic line breaking. The addition of
pretty-printing annotations to your regular printf
formats gives you
fancy indentation and line breaks.
Pretty-printing annotations are described below in the documentation of
the function Format.fprintf
.
You may also use the explicit box management and printing functions
provided by this module. This style is more basic but more verbose
than the fprintf
concise formats.
For instance, the sequence
open_box 0; print_string "x ="; print_space ();
print_int 1; close_box (); print_newline ()
that prints x = 1
within a pretty-printing box, can be
abbreviated as printf "@[%s@ %i<EMAIL_ADDRESS>"x =" 1
, or even shorter
printf "@[x =@ %i<EMAIL_ADDRESS>1
.
Rule of thumb for casual users of this library:
open_box 0
);print_cut ()
that outputs a
simple break hint, or by print_space ()
that outputs a space
indicating a break hint);print_int
and print_string
);close_box ()
to
close the box;print_newline ()
.open_
functions below must be closed using close_box
for proper formatting. Otherwise, some of the material printed in the
boxes may not be output, or may be formatted incorrectly.
In case of interactive use, the system closes all opened boxes and
flushes all pending text (as with the print_newline
function)
after each phrase. Each phrase is therefore executed in the initial
state of the pretty-printer.
Warning: the material output by the following functions is delayed
in the pretty-printer queue in order to compute the proper line
breaking. Hence, you should not mix calls to the printing functions
of the basic I/O system with calls to the functions of this module:
this could result in some strange output seemingly unrelated with
the evaluation order of printing commands.
let open_box : int => unit
open_box d
opens a new pretty-printing box
with offset d
.
This box is the general purpose pretty-printing box.
Material in this box is displayed 'horizontal or vertical':
break hints inside the box may lead to a new line, if there
is no more room on the line to print the remainder of the box,
or if a new line may lead to a new indentation
(demonstrating the indentation of the box).
When a new line is printed in the box, d
is added to the
current indentation.let close_box : unit => unit
let print_string : string => unit
print_string str
prints str
in the current box.let print_as : int => string => unit
print_as len str
prints str
in the
current box. The pretty-printer formats str
as if
it were of length len
.let print_int : int => unit
let print_float : float => unit
let print_char : char => unit
let print_bool : bool => unit
let print_space : unit => unit
print_space ()
is used to separate items (typically to print
a space between two words).
It indicates that the line may be split at this
point. It either prints one space or splits the line.
It is equivalent to print_break 1 0
.let print_cut : unit => unit
print_cut ()
is used to mark a good break position.
It indicates that the line may be split at this
point. It either prints nothing or splits the line.
This allows line splitting at the current
point, without printing spaces or adding indentation.
It is equivalent to print_break 0 0
.let print_break : int => int => unit
print_break nspaces offset
indicates that the line may
be split (a newline character is printed) at this point,
if the contents of the current box does not fit on the
current line.
If the line is split at that point, offset
is added to
the current indentation. If the line is not split,
nspaces
spaces are printed.let print_flush : unit => unit
let print_newline : unit => unit
print_flush
followed by a new line.let force_newline : unit => unit
let print_if_newline : unit => unit
let set_margin : int => unit
set_margin d
sets the value of the right margin
to d
(in characters): this value is used to detect line
overflows that leads to split lines.
Nothing happens if d
is smaller than 2.
If d
is too large, the right margin is set to the maximum
admissible value (which is greater than 10^9
).let get_margin : unit => int
let set_max_indent : int => unit
set_max_indent d
sets the value of the maximum
indentation limit to d
(in characters):
once this limit is reached, boxes are rejected to the left,
if they do not fit on the current line.
Nothing happens if d
is smaller than 2.
If d
is too large, the limit is set to the maximum
admissible value (which is greater than 10^9
).let get_max_indent : unit => int
let set_max_boxes : int => unit
set_max_boxes max
sets the maximum number of boxes simultaneously
opened.
Material inside boxes nested deeper is printed as an ellipsis (more
precisely as the text returned by get_ellipsis_text ()
).
Nothing happens if max
is smaller than 2.let get_max_boxes : unit => int
let over_max_boxes : unit => bool
let open_hbox : unit => unit
open_hbox ()
opens a new pretty-printing box.
This box is 'horizontal': the line is not split in this box
(new lines may still occur inside boxes nested deeper).let open_vbox : int => unit
open_vbox d
opens a new pretty-printing box
with offset d
.
This box is 'vertical': every break hint inside this
box leads to a new line.
When a new line is printed in the box, d
is added to the
current indentation.let open_hvbox : int => unit
open_hvbox d
opens a new pretty-printing box
with offset d
.
This box is 'horizontal-vertical': it behaves as an
'horizontal' box if it fits on a single line,
otherwise it behaves as a 'vertical' box.
When a new line is printed in the box, d
is added to the
current indentation.let open_hovbox : int => unit
open_hovbox d
opens a new pretty-printing box
with offset d
.
This box is 'horizontal or vertical': break hints
inside this box may lead to a new line, if there is no more room
on the line to print the remainder of the box.
When a new line is printed in the box, d
is added to the
current indentation.let open_tbox : unit => unit
let close_tbox : unit => unit
let print_tbreak : int => int => unit
print_tbreak spaces offset
moves the insertion point to
the next tabulation (spaces
being added to this position).
Nothing occurs if insertion point is already on a
tabulation mark.
If there is no next tabulation on the line, then a newline
is printed and the insertion point moves to the first
tabulation of the box.
If a new line is printed, offset
is added to the current
indentation.let set_tab : unit => unit
let print_tab : unit => unit
print_tab ()
is equivalent to print_tbreak 0 0
.let set_ellipsis_text : string => unit
.
, by default).let get_ellipsis_text : unit => string
type tag=
string
By default, those tags do not influence line breaking calculation: the tag 'markers' are not considered as part of the printing material that drives line breaking (in other words, the length of those strings is considered as zero for line breaking).
Thus, tag handling is in some sense transparent to pretty-printing
and does not interfere with usual indentation. Hence, a single
pretty printing routine can output both simple 'verbatim'
material or richer decorated output depending on the treatment of
tags. By default, tags are not active, hence the output is not
decorated with tag information. Once set_tags
is set to true
,
the pretty printer engine honours tags and decorates the output
accordingly.
When a tag has been opened (or closed), it is both and successively 'printed' and 'marked'. Printing a tag means calling a formatter specific function with the name of the tag as argument: that 'tag printing' function can then print any regular material to the formatter (so that this material is enqueued as usual in the formatter queue for further line-breaking computation). Marking a tag means to output an arbitrary string (the 'tag marker'), directly into the output device of the formatter. Hence, the formatter specific 'tag marking' function must return the tag marker string associated to its tag argument. Being flushed directly into the output device of the formatter, tag marker strings are not considered as part of the printing material that drives line breaking (in other words, the length of the strings corresponding to tag markers is considered as zero for line breaking). In addition, advanced users may take advantage of the specificity of tag markers to be precisely output when the pretty printer has already decided where to break the lines, and precisely when the queue is flushed into the output device.
In the spirit of HTML tags, the default tag marking functions
output tags enclosed in "<" and ">": hence, the opening marker of
tag t
is "<t>"
and the closing marker "</t>"
.
Default tag printing functions just do nothing.
Tag marking and tag printing functions are user definable and can
be set by calling set_formatter_tag_functions
.
let open_tag : tag => unit
open_tag t
opens the tag named t
; the print_open_tag
function of the formatter is called with t
as argument;
the tag marker mark_open_tag t
will be flushed into the output
device of the formatter.let close_tag : unit => unit
close_tag ()
closes the most recently opened tag t
.
In addition, the print_close_tag
function of the formatter is called
with t
as argument. The marker mark_close_tag t
will be flushed
into the output device of the formatter.bool => unit
: set_tags b
turns on or off the treatment of tags (default is off).bool => unit
: set_print_tags b
turns on or off the printing of tags.bool => unit
: set_mark_tags b
turns on or off the output of tag markers.unit => bool
: unit => bool
: let set_formatter_out_channel : Pervasives.out_channel => unit
let set_formatter_output_functions : (string => int => int => unit) => (unit => unit) => unit
set_formatter_output_functions out flush
redirects the
pretty-printer output functions to the functions out
and
flush
.
The out
function performs all the pretty-printer string output.
It is called with a string s
, a start position p
, and a number of
characters n
; it is supposed to output characters p
to p + n - 1
of
s
.
The flush
function is called whenever the pretty-printer is flushed
(via conversion %!
, or pretty-printing indications @?
or @.
, or
using low level functions print_flush
or print_newline
).
let get_formatter_output_functions : unit => ((string => int => int => unit), (unit => unit))
Format
module is versatile enough to let you completely redefine
the meaning of pretty printing: you may provide your own functions to define
how to handle indentation, line breaking, and even printing of all the
characters that have to be printed!type formatter_out_functions
= {
|
out_string : |
|
out_flush : |
|
out_newline : |
|
out_spaces : |
let set_formatter_out_functions : formatter_out_functions => unit
set_formatter_out_functions f
Redirect the pretty-printer output to the functions f.out_string
and f.out_flush
as described in
set_formatter_output_functions
. In addition, the pretty-printer function
that outputs a newline is set to the function f.out_newline
and
the function that outputs indentation spaces is set to the function
f.out_spaces
.
This way, you can change the meaning of indentation (which can be
something else than just printing space characters) and the meaning of new
lines opening (which can be connected to any other action needed by the
application at hand). The two functions f.out_spaces
and f.out_newline
are normally connected to f.out_string
and f.out_flush
: respective
default values for f.out_space
and f.out_newline
are
f.out_string (String.make n ' ') 0 n
and f.out_string "\n" 0 1
.
let get_formatter_out_functions : unit => formatter_out_functions
type formatter_tag_functions
= {
|
mark_open_tag : |
|
mark_close_tag : |
|
print_open_tag : |
|
print_close_tag : |
mark
versions are the 'tag marking' functions that associate a string
marker to a tag in order for the pretty-printing engine to flush
those markers as 0 length tokens in the output device of the formatter.
print
versions are the 'tag printing' functions that can perform
regular printing when a tag is closed or opened.let set_formatter_tag_functions : formatter_tag_functions => unit
set_formatter_tag_functions tag_funs
changes the meaning of
opening and closing tags to use the functions in tag_funs
.
When opening a tag name t
, the string t
is passed to the
opening tag marking function (the mark_open_tag
field of the
record tag_funs
), that must return the opening tag marker for
that name. When the next call to close_tag ()
happens, the tag
name t
is sent back to the closing tag marking function (the
mark_close_tag
field of record tag_funs
), that must return a
closing tag marker for that name.
The print_
field of the record contains the functions that are
called at tag opening and tag closing time, to output regular
material in the pretty-printer queue.
let get_formatter_tag_functions : unit => formatter_tag_functions
type formatter
Defining new pretty-printers permits unrelated output of material in
parallel on several output channels.
All the parameters of a pretty-printer are local to this pretty-printer:
margin, maximum indentation limit, maximum number of boxes
simultaneously opened, ellipsis, and so on, are specific to
each pretty-printer and may be fixed independently.
Given a Pervasives.out_channel
output channel oc
, a new formatter
writing to that channel is simply obtained by calling
formatter_of_out_channel oc
.
Alternatively, the make_formatter
function allocates a new
formatter with explicit output and flushing functions
(convenient to output material to strings for instance).
let formatter_of_out_channel : Pervasives.out_channel => formatter
formatter_of_out_channel oc
returns a new formatter that
writes to the corresponding channel oc
.let std_formatter : formatter
formatter_of_out_channel stdout
.let err_formatter : formatter
formatter_of_out_channel stderr
.let formatter_of_buffer : Buffer.t => formatter
formatter_of_buffer b
returns a new formatter writing to
buffer b
. As usual, the formatter has to be flushed at
the end of pretty printing, using pp_print_flush
or
pp_print_newline
, to display all the pending material.let stdbuf : Buffer.t
str_formatter
writes.let str_formatter : formatter
stdbuf
string buffer.
str_formatter
is defined as formatter_of_buffer stdbuf
.let flush_str_formatter : unit => string
str_formatter
, flushes
the formatter and resets the corresponding buffer.let make_formatter : (string => int => int => unit) => (unit => unit) => formatter
make_formatter out flush
returns a new formatter that writes according
to the output function out
, and the flushing function flush
. For
instance, a formatter to the Pervasives.out_channel
oc
is returned by
make_formatter (Pervasives.output oc) (fun () -> Pervasives.flush oc)
.let pp_open_hbox : formatter => unit => unit
let pp_open_vbox : formatter => int => unit
let pp_open_hvbox : formatter => int => unit
let pp_open_hovbox : formatter => int => unit
let pp_open_box : formatter => int => unit
let pp_close_box : formatter => unit => unit
let pp_open_tag : formatter => string => unit
let pp_close_tag : formatter => unit => unit
let pp_print_string : formatter => string => unit
let pp_print_as : formatter => int => string => unit
let pp_print_int : formatter => int => unit
let pp_print_float : formatter => float => unit
let pp_print_char : formatter => char => unit
let pp_print_bool : formatter => bool => unit
let pp_print_break : formatter => int => int => unit
let pp_print_cut : formatter => unit => unit
let pp_print_space : formatter => unit => unit
let pp_force_newline : formatter => unit => unit
let pp_print_flush : formatter => unit => unit
let pp_print_newline : formatter => unit => unit
let pp_print_if_newline : formatter => unit => unit
let pp_open_tbox : formatter => unit => unit
let pp_close_tbox : formatter => unit => unit
let pp_print_tbreak : formatter => int => int => unit
let pp_set_tab : formatter => unit => unit
let pp_print_tab : formatter => unit => unit
formatter => bool => unit
: formatter => bool => unit
: formatter => bool => unit
: formatter => unit => bool
: formatter => unit => bool
: let pp_set_margin : formatter => int => unit
let pp_get_margin : formatter => unit => int
let pp_set_max_indent : formatter => int => unit
let pp_get_max_indent : formatter => unit => int
let pp_set_max_boxes : formatter => int => unit
let pp_get_max_boxes : formatter => unit => int
let pp_over_max_boxes : formatter => unit => bool
let pp_set_ellipsis_text : formatter => string => unit
let pp_get_ellipsis_text : formatter => unit => string
let pp_set_formatter_out_channel : formatter => Pervasives.out_channel => unit
let pp_set_formatter_output_functions : formatter => (string => int => int => unit) => (unit => unit) => unit
let pp_get_formatter_output_functions : formatter => unit => ((string => int => int => unit), (unit => unit))
let pp_set_formatter_tag_functions : formatter => formatter_tag_functions => unit
let pp_get_formatter_tag_functions : formatter => unit => formatter_tag_functions
let pp_set_formatter_out_functions : formatter => formatter_out_functions => unit
let pp_get_formatter_out_functions : formatter => unit => formatter_out_functions
print_string
is equal to pp_print_string std_formatter
.let pp_print_list : pp_sep::(formatter => unit => unit)? =>
(formatter => 'a => unit) => formatter => list 'a => unit
pp_print_list ?pp_sep pp_v ppf l
prints the list l
. pp_v
is
used on the elements of l
and each element is separated by
a call to pp_sep
(defaults to Format.pp_print_cut
). Does nothing on
empty lists.let pp_print_text : formatter => string => unit
pp_print_text ppf s
prints s
with spaces and newlines
respectively printed with Format.pp_print_space
and
Format.pp_force_newline
.printf
like functions for pretty-printing.let fprintf : formatter => Pervasives.format 'a formatter unit => 'a
fprintf ff fmt arg1 ... argN
formats the arguments arg1
to argN
according to the format string fmt
, and outputs the resulting string on
the formatter ff
.
The format fmt
is a character string which contains three types of
objects: plain characters and conversion specifications as specified in
the Printf
module, and pretty-printing indications specific to the
Format
module.
The pretty-printing indication characters are introduced by
a @
character, and their meanings are:
@[
: open a pretty-printing box. The type and offset of the
box may be optionally specified with the following syntax:
the <
character, followed by an optional box type indication,
then an optional integer offset, and the closing >
character.
Box type is one of h
, v
, hv
, b
, or hov
,
which stand respectively for an horizontal box, a vertical box,
an 'horizontal-vertical' box, or an 'horizontal or
vertical' box (b
standing for an 'horizontal or
vertical' box demonstrating indentation and hov
standing
for a regular'horizontal or vertical' box).
For instance, @[<hov 2>
opens an 'horizontal or vertical'
box with indentation 2 as obtained with open_hovbox 2
.
For more details about boxes, see the various box opening
functions open_*box
.@]
: close the most recently opened pretty-printing box.@,
: output a good break hint, as with print_cut ()
.@
: output a good break space, as with print_space ()
.@;
: output a fully specified good break as with print_break
. The
nspaces
and offset
parameters of the break may be
optionally specified with the following syntax:
the <
character, followed by an integer nspaces
value,
then an integer offset
, and a closing >
character.
If no parameters are provided, the good break defaults to a
good break<EMAIL_ADDRESS>: flush the pretty printer and output a new line, as with
print_newline ()
.@<n>
: print the following item as if it were of length n
.
Hence, printf "@<0>%s" arg
prints arg
as a zero length string.
If @<n>
is not followed by a conversion specification,
then the following character of the format is printed as if
it were of length n
.@{
: open a tag. The name of the tag may be optionally
specified with the following syntax:
the <
character, followed by an optional string
specification, and the closing >
character. The string
specification is any character string that does not contain the
closing character '>'
. If omitted, the tag name defaults to the
empty string.
For more details about tags, see the functions open_tag
and
close_tag
.@}
: close the most recently opened tag.@?
: flush the pretty printer as with print_flush ()
.
This is equivalent to the conversion %!
.@\n
: force a newline, as with force_newline ()
.@@
: print a single @
character.printf "@[%s@ %d<EMAIL_ADDRESS>"x =" 1
is equivalent to
open_box (); print_string "x ="; print_space ();
print_int 1; close_box (); print_newline ()
.
It prints x = 1
within a pretty-printing box.
Note: If you need to prevent the interpretation of a @
character as a
pretty-printing indication, you can also escape it with a %
character.
let printf : Pervasives.format 'a formatter unit => 'a
fprintf
above, but output on std_formatter
.let eprintf : Pervasives.format 'a formatter unit => 'a
fprintf
above, but output on err_formatter
.let sprintf : Pervasives.format 'a unit string => 'a
printf
above, but instead of printing on a formatter,
returns a string containing the result of formatting the arguments.
Note that the pretty-printer queue is flushed at the end of each
call to sprintf
.
In case of multiple and related calls to sprintf
to output
material on a single string, you should consider using fprintf
with the predefined formatter str_formatter
and call
flush_str_formatter ()
to get the final result.
Alternatively, you can use Format.fprintf
with a formatter writing to a
buffer of your own: flushing the formatter and the buffer at the end of
pretty-printing returns the desired string.
let asprintf : Pervasives.format4 'a formatter unit string => 'a
printf
above, but instead of printing on a formatter,
returns a string containing the result of formatting the arguments.
The type of asprintf
is general enough to interact nicely with %a
conversions.let ifprintf : formatter => Pervasives.format 'a formatter unit => 'a
fprintf
above, but does not print anything.
Useful to ignore some material when conditionally printing.let kfprintf : (formatter => 'a) =>
formatter => Pervasives.format4 'b formatter unit 'a => 'b
fprintf
above, but instead of returning immediately,
passes the formatter to its first argument at the end of printing.let ikfprintf : (formatter => 'a) =>
formatter => Pervasives.format4 'b formatter unit 'a => 'b
kfprintf
above, but does not print anything.
Useful to ignore some material when conditionally printing.let ksprintf : (string => 'a) => Pervasives.format4 'b unit string 'a => 'b
sprintf
above, but instead of returning the string,
passes it to the first argument.let bprintf : Buffer.t => Pervasives.format 'a formatter unit => 'a
If you need to print to some buffer b
, you must first define a
formatter writing to b
, using let to_b = formatter_of_buffer b
; then
use regular calls to Format.fprintf
on formatter to_b
.
let kprintf : (string => 'a) => Pervasives.format4 'b unit string 'a => 'b
ksprintf
.let set_all_formatter_output_functions : out::(string => int => int => unit) =>
flush::(unit => unit) =>
newline::(unit => unit) => spaces::(int => unit) => unit
set_formatter_out_functions
.let get_all_formatter_output_functions : unit =>
((string => int => int => unit), (unit => unit), (unit => unit),
(int => unit))
get_formatter_out_functions
.let pp_set_all_formatter_output_functions : formatter =>
out::(string => int => int => unit) =>
flush::(unit => unit) =>
newline::(unit => unit) => spaces::(int => unit) => unit
pp_set_formatter_out_functions
.let pp_get_all_formatter_output_functions : formatter =>
unit =>
((string => int => int => unit), (unit => unit), (unit => unit),
(int => unit))
pp_get_formatter_out_functions
.


Conix Inc
on 2012-02-18 21:31:24
i want to use it
Brett Zamir
on 2011-04-14 13:52:10
Yes, Tom, thanks. We're aware of the issue, and since Chrome might not address this issue, given that the ECMAScript specification indeed does state that the iteration order is in fact implementation dependent (though it's worked pretty well to date with a minor exception before Chrome changed the behavior), I'm doing initial work now (see the array() function) on supporting an associative array representation which is slightly more cumbersome (unfortunately necessarily so). Feel free to help out--great way to learn some more JavaScript or at least do a little brain puzzles....Lots of array functions to port...
So, to ensure order is predictable cross-browser, you would use something like this:
// Returns a PHPJS_Array object--our own class which can
// have all the same PHP methods on it, but using a chainable
// style, and ensuring sequence is preserved
var arr = array({key1:value1}, {key2:value2});
Note that this would be treated as an associative array a single level deep (i.e., it would actually be treated like {key1:value1, key2:value2}).
Or, once I finish updating the array_merge() implementation to work on PHPJS_Array, you could import arrays or objects too, bearing in mind that you'd have to first perform a sort in order to guarantee order:
var arr = array().merge({key1:value1, key2:value2}).sort(); // After the sort, we would have a reliable fixed order
On the bright side, one benefit of moving to this model is that it is forcing us to implement what has been a goal for some time: a jQuery-like chainable object which would allow us to do such as:
arr.sort().change_key_case('UPPER_CASE').values(); // Notice "array_" is removed from "array_values" since we know the object is an array.
We should also be able to do the like for strings, etc.:
string(user_input).str_replace(...).strip_tags().rev(); // I didn't remove "str_" from "str_replace" to avoid conflict with the built-in replace() method.
Besides this syntax being more "JavaScript-like" and favorable to some JavaScript users, perhaps because it avoids one needing to go backwards to add parentheses around a sequence--you just keep adding to the right instead--it also addresses some of the objections to PHP's API in not having predictable argument order--there's no need to remember needle-haystack for example, because the haystack argument will be eliminated, as it will be assumed to be the object on which we are calling methods.
Some libraries like Underscore.js already offer some of these abilities, and maybe offer some innovations not present in PHP, but the PHP library is both familiar in naming to PHP users, as well as quite rich, so hopefully this may bring our library into wider favor among regular JavaScript users, as well as continue to provide convenience for PHP users moving to JavaScript (as well as give piece of mind for this implementation order issue). Thanks for bringing this up!
Tom
on 2011-04-13 20:53:02
This is not working on Chrome. Objects are not specified as having to return properties in any particular order.
More info here: http://code.google.com/p/chromium/issues/detail?id=883
Brett Zamir
on 2010-05-03 21:34:10
@Adam Wallner: I see now I hadn't looked carefully; I see that it was actually messed up for the more common use case. Oh, that is annoying, but glad it is now fixed.
Brett Zamir
on 2010-05-03 21:32:06
@Adam Wallner: Argh...Yes, you are right, and that was what I originally meant to do...Very glad you found that since it affected a good number of functions (though thankfully, fewer people probably using that option--still...). Now fixed in Git... Thank you...
Adam Wallner
on 2010-05-03 17:57:26
It doesn't work in Firefox 3.6 (I haven't tested in other browsers, I need it only in firefox). The problem is in js you don't have associative arrays only objects.
Workaround: change the
populateArr = []
to
populateArr = {}
in the first line.
Brett Zamir
on 2009-12-07 15:03:30
@Paulo Kuong: I have now fixed the function (and all others like it except for array_multisort which still needs to be fixed and array_unique which hasn't implemented its sorting argument at all yet) to return a (shallow) copy of the array unless the user does "ini_set('phpjs.strictForIn', true);" in which case it will attempt to work by reference (assumes an exclusively non-IE environment!).
Brett Zamir
on 2009-11-18 06:13:36
That echo() was supposed to have a br line break in it but the form stripped the element out (seems the colorer is using strip_tags() instead of htmlentities())...
Brett Zamir
on 2009-11-18 06:11:46
@paulo kuong: Darn, you're right! You can see how the array forms by adding our var_dump (with echo() dependency) after line 82 :
var_dump(inputArr);echo('<br />');
IE does preserve the right order as it goes through the for loop, but it seems to remember its previous order (since I see no other good explanation why it puts it back in exactly that non-alphabetical/non-reverse-alphabetical order)--no matter whether I delete (as we do now), set to undefined or some value and then delete, etc.
Nevertheless, everyone from Chrome, Opera, Safari, to Firefox handle this consistently.
Has anyone heard of this issue in IE before and any ways to get around it?
paulo kuong
on 2009-11-17 20:05:04
Doesn't work in IE
Kevin van Zonneveld
on 2009-01-15 11:27:50
@ Brett Zamir: fixed
Brett Zamir
on 2009-01-15 00:55:29
Glad you liked it, Jason.
That reminds me, I should give some credit for this function (and for arsort() too) to http://javascriptsource.com (specifically http://javascript.internet.com/math-related/bubble-sort.html ). They stated "the script is yours" (and my version is reasonably altered anyways), but they deserve some credit.
Kevin, a small thing, but if you were attending to these kinds of things, I should have put a semicolon after "var bubbleSort .... {...}" (or used regular function notation).
Jason
on 2009-01-14 22:50:10
Great work! This should be very useful.


Simple ASCII messages for Wiring and Arduino, by Thomas O Fredericks
Copy the Messenger folder to your Arduino or Wiring libraries folder.
// INCLUDE MESSENGER LIBRARY
// Download : https://github.com/thomasfredericks/Messenger/archive/master.zip
#include <Messenger.h>
// Instantiate a Messenger instance
Messenger message = Messenger();
void setup() {
// Initiate Serial Communication
Serial.begin(57600);
// Attach a function that is called when a message is received
message.attach(messageReceived);
}
void loop() {
// Feed the serial data to Messenger
while ( Serial.available( ) )
message.process( Serial.read( ) );
}
// Function that is called when a message is received :
void messageReceived() {
if ( message.checkString("led") ) { // If the received message starts with led...
int value = message.readInt(); // ...read the next element as an int...
digitalWrite(13,value); // ...and set the state of pin 13 to the value.
}
}
// INCLUDE MESSENGER LIBRARY
// Download : https://github.com/thomasfredericks/Messenger/archive/master.zip
#include <Messenger.h>
Messenger message = Messenger();
message.attach(messageReceived);
// Put inside loop()!!!
// Feed the serial data to Messenger
while ( Serial.available( ) ) message.process( Serial.read( ) );
void messageReceived() {
if ( message.checkString("led") ) { // If the received message starts with led...
int value = message.readInt(); // ...read the next element as an int...
digitalWrite(13,value); // ...and set the state of pin 13 to the value.
}
}
| attach( callback ) | void | Sets the callback function that is called when a message is received |
| process( data ) | byte | Processes serial data |
| checkString( string ) | byte | Returns 1 if the string matches the current word received, 0 otherwise |
| readInt( ) | int | Returns a received word as an int |
| peek( ) | char* | Allows to peek at the next word in the buffer. Simplifies debuging by allowing to print the received message like so : Serial.println(messenger.peek()) |
| readLong( ) | long | Returns a received word as a long |
| readChar( ) | char | Returns a received word as a char |
| readDouble( ) | double | Returns a received word as a double |
| copyString(char *string, uint8_t size) | void | Copies the word as a string into a table identified by *string and of a certain maximum size |
Serial.print("A0");
Serial.print(" "); // Add a space separator
Serial.print( analogRead(0) ); // Send the pin value
Serial.print('\n') // End with a new line character


Suppose you have a Ruby on Rails application in /somewhere. Add a server block to your Nginx configuration file, set its root to /somewhere/public, and set ‘passenger_enabled on’, like this:
server { listen 80; server_name www.yourhost.com; root /somewhere/public; # <--- be sure to point to 'public'! passenger_enabled on; }
And that’s it! You may also want to check the Users Guide for security and optimization tips and other useful information:
<yellow><%= @users_guide %></yellow>
Enjoy Phusion Passenger, a product of Phusion (<%= @phusion_website %>) :-) <%= @passenger_website %>
Phusion Passenger is a trademark of Hongli Lai & Ninh Bui.


Well, I finally had a truly bad trip from shrooms, and it may mean the end of my use of hallucinogens.
About a week ago me and a buddy went to the Aquarium in Monterey to see the Great White (first great white shark to ever be held in captivity and not die after a few days) they have there, and we decided to shroom...so we went to a burrito place, made our own 'custom' burritos, and digged in before going.
Now let me tell you...the aquarium is SHROOM HEAVEN. Everything is glowing and is light by shades of blue or green..there are trippy lights and signs everywhere, and the exhibits are really dark, so these stand out alot. Not to mention all the crazy sea creatures, especially the Jelly Fish. What a trip!
We went into the room with the giant tank, and lights began to flicker out of the corner of my eye, and that's when I knew I had started to trip. The room had WAY too many people in it, so we wondered off to the Jelly exhibit and watched these things...it was friggin amazing...just watching them glow and move....wow...
Anyways, I gradually began to feel uncomfortable, kind of feverish and pent up, so I went up to the very top deck and looked out over the bay....the sky was overcast with rain clouds and a swift breeze, so it was truly beautiful...one of those 'awe trips' I talked about earlier....
Anyways, after screwing around at the aquarium, looking at stuff, running around and laughing, the place closed and we left for home...it had starteed raining so we ran to the car and headed out. As soon as I got into the car, I began to have a really bad trip. I felt shitty...feverish, sick, lost...and it just got worse as we went on. I was sitting in the back, while my buddy and my brother were in the front...so as they talked, I just stared off down the road in front of us, and my mind began to darken. and wander.
Suddenly, I found myself focused on a single idea: death. I remember thinking about our culture and life, and realizing that death is the one thing that is truly unexplainable, the one thing that artists and other people don't 'go over'. I realized that I could die at ANY MOMENT, and I remember the question 'what about death?' kept moving through my head, and I imagined what it would be like to die. BIG MISTAKE. The shrooms fed off of my thoughts, and seemed to react with them. My world started to darken as I imagined this death, and I became COMPLETELY afraid...more afraid than I have been in my entire life. I started shaking and tried to pull myself away from these thoughts, but it was too late...I was fully entrenched in a bad trip.
The next few hours can only be described as hell.  I have never felt this way in my entire life, and it was the worst feeling ever.  ALL happiness was taken from me...all of it.
Happiness in life is measured in the values which we hold dear, correct? This means family, friends, hobbies, the world around us, everything that is positive in our lives that drives us to keep on living. Well all these things, everything that gave me a reason to live, were RIPPED from me. They were taken away, and I could not find the reasons why I was living. I believe I felt the purest form of despair...I was feeling horrible physically, emotionally, and mentally, and I was depressed to an extreme I have never felt before...I was trapped in this hellish spiral, falling down down down to a bottomless abyss from which I couldn't escape.
Funny enough, all this took place back at my parents house, which is a very positive environment for me. I have a very close and loving family, and when we all get together for the holidays, it's always a pleasure. My brother was around and so were my parents.  Maybe it was partially because I had to hide the fact that I was tripping that my trip became so horrible...I don't really know...
 But I couldn't. I realized that now that I'm an adult, this was something I had to conquer myself, an experience which I had to survive and learn from on my own.
I couldn't talk to my brother about it...he was completely sober and playing video games..I tried calling friends, but I couldn't even say anything to them....I told my parents I felt crappy and went to my old room and laid down in the dark. I don't know how long I lay on my bed, but it was probably at the worst part of the trip. I would lay there, kicking and punching the bed and gripping the sheets with white knuckles as the emotional, mental, and physical pain swept over me. I cried for the first time in many, many years, and I didn't even know why I was crying. I had nothing. NOTHING. I had no identity, no family, no friends...there was no good in the world, no good in my life, only darkness and emptiness. I can't express to any of you in any sort of language the extent of this feeling, nor can I express how terrible it really was. I doubt many have felt this pure feeling of despair before, and I hope that none do in the future.
Eventually I made it through after a shower and some tea...and I felt.....very strange.  As I came down from the trip, all the values in my life gradually began to be restored, but these values were now much higher than they were before the trip. Maybe it was because I had a whole new appreciation for them. Anyways, I felt sooo relieved, and had a great talk with my mom about things I had been wanting to talk about, (family junk) and with my brother. It was like I was finally doing the things I always wanted to do, because I had a sort of near death experience. I felt a new found love for life and everything in it, as well a whole new appreciation for my own life.
I realized that life, as well as intelligence, is a gift, and that many have not had the chance to live out their lives as I am able to (tsunami, etc.) So a new feeling of 'live like there's no tomorrow' came to me..most likely linked to my scary 'death trip'.
It was definitely a learning experience, and I did find a new appreciation for life...but it was NOT worth it. It was the single worst feeling I have EVER felt in my entire life, one of the worst experiences. I don't know if I'll try shrooms again...maybe in the right time in the right place....don't know.....
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.


Get POWER global meteorology and surface solar energy climatology
data and return a tidy data frame tibble
. All options
offered by the official POWER API are supported.
get_power(community, pars, temporal_average, lonlat, dates = NULL)
| community | A character vector providing community name: “AG”, “SB” or “SSE”. See argument details for more. |
|---|---|
| pars | A character vector of solar, meteorological or climatology
parameters to download. See |
| temporal_average | Temporal average for data being queried, supported values are “DAILY”, “INTERANNUAL” and “CLIMATOLOGY”. See argument details for more. |
| lonlat | A numeric vector of geographic coordinates for a cell or region entered as x, y coordinates or “GLOBAL” for global coverage (only used for “CLIMATOLOGY”). See argument details for more. |
| dates | A character vector of start and end dates in that order, |
A data frame of POWER data including location, dates (not including “CLIMATOLOGY”) and requested parameters. A header of metadata is included.
The associated metadata are not saved if the data are exported to a file format other than a native R data format, e.g., .Rdata, .rda or .rds.
There are three valid values, one must be supplied. This will affect the units of the parameter and the temporal display of time series data.
Provides access to the Agroclimatology Archive, which contains industry-friendly parameters formatted for input to crop models.
Provides access to the Sustainable Buildings Archive, which contains industry-friendly parameters for the buildings community to include parameters in multi-year monthly averages.
Provides access to the Renewable Energy Archive, which contains parameters specifically tailored to assist in the design of solar and wind powered renewable energy systems.
temporal_average
There are three valid values.
The daily average of pars
by day, month and year.
The monthly average of pars
by year.
The monthly average of pars
at the surface of the
earth for a given month, averaged for that month over the 30-year period
(Jan. 1984 - Dec. 2013).
lonlat
To get a specific cell, 1/2 x 1/2 degree, supply a
length-two numeric vector giving the decimal degree longitude and latitude
in that order for data to download,
e.g., lonlat = c(-89.5, -179.5)
.
To get a region, supply a length-four numeric
vector as lower left (lon, lat) and upper right (lon, lat) coordinates,
e.g., lonlat = c(xmin, ymin, xmax, ymax)
in that order for a
given region, e.g., a bounding box for the southwestern corner of
Australia: lonlat = c(112.5, -55.5, 115.5, -50.5)
. *Maximum area
processed is 4.5 x 4.5 degrees (100 points).
To get global coverage for CLIMATOLOGY, supply
“GLOBAL” while also specifying “CLIMATOLOGY” for the
temporal_average
.
dates
If one date only is provided, it
will be treated as both the start date and the end date and only a single
day's values will be returned, e.g., dates = "1983-01-01"
.
When temporal_average
is set to “INTERANNUAL”, use only two
year values (YYYY), e.g. dates = c(1983, 2010)
. This
argument should not be used when temporal_average
is set to
“CLIMATOLOGY”.
https://power.larc.nasa.gov/documents/POWER_Data_v9_methodology.pdf https://power.larc.nasa.gov
# Fetch daily "AG" community temperature, relative # humidity and precipitation for January 1 1985 # for Kingsthorpe, Queensland, Australia ag_d <- get_power( community = "AG", lonlat = c(151.81, -27.48), pars = c("RH2M", "T2M", "PRECTOT"), dates = "1985-01-01", temporal_average = "DAILY" ) # Fetch single point climatology for air temperature ag_c_point <- get_power( community = "AG", pars = "T2M", c(151.81, -27.48), temporal_average = "CLIMATOLOGY" ) ag_c_point#> NASA/POWER SRB/FLASHFlux/MERRA2/ 0.5 x 0.5 Degree Climatologies #> 22-year Additional Solar Parameter Monthly & Annual Climatologies (July 1983 - June 2005), 30-year Meteorological and Solar Monthly & Annual Climatologies (January 1984 - December 2013) #> Location: Latitude -27.48 Longitude 151.81 #> Elevation from MERRA-2: Average for 1/2x1/2 degree lat/lon region = 434.55 meters Site = na #> Climate zone: na (reference Briggs et al: http://www.energycodes.gov) #> Value for missing model data cannot be computed or out of model availability range: -99 #> #> Parameters: #> T2M MERRA2 1/2x1/2 Temperature at 2 Meters (C) #> #> # A tibble: 1 x 16 #> LON LAT PARAMETER JAN FEB MAR APR MAY JUN JUL AUG SEP #> <dbl> <dbl> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 152. -27.5 T2M 24.3 23.3 21.8 18.9 15.2 12.1 11.4 12.8 16.4 #> # … with 4 more variables: OCT <dbl>, NOV <dbl>, DEC <dbl>, ANN <dbl># Fetch global AG climatology for air temperature ag_c_global <- get_power( community = "AG", pars = "T2M", lonlat = "GLOBAL", temporal_average = "CLIMATOLOGY" ) ag_c_global#> NASA/POWER SRB/FLASHFlux/MERRA2/GEOS 5.12.4 (FP-IT) 0.5 x 0.5 Degree Climatologies #> 22-year Additional Solar Parameter Monthly & Annual Climatologies (July 1983 - June 2005), 30-year Meteorological and Solar Monthly & Annual Climatologies (January 1984 - December 2013) #> Location: Global #> Value for missing model data cannot be computed or out of model availability range: -99 #> Parameter(s): #> T2M MERRA2 1/2x1/2 Temperature at 2 Meters (C) #> #> Parameters: #> NA; #> NA; #> T2M MERRA2 1/2x1/2 Temperature at 2 Meters (C) #> #> # A tibble: 259,200 x 16 #> LON LAT PARAMETER JAN FEB MAR APR MAY JUN JUL AUG SEP #> <dbl> <dbl> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 -180. -89.8 T2M -29.0 -40.7 -52.9 -57.8 -59.1 -59.6 -61.3 -61.8 -60.4 #> 2 -179. -89.8 T2M -29.0 -40.7 -52.9 -57.8 -59.1 -59.6 -61.3 -61.8 -60.4 #> 3 -179. -89.8 T2M -29.0 -40.7 -52.9 -57.8 -59.1 -59.6 -61.3 -61.8 -60.4 #> 4 -178. -89.8 T2M -29.0 -40.7 -52.9 -57.8 -59.1 -59.6 -61.3 -61.8 -60.4 #> 5 -178. -89.8 T2M -29.0 -40.7 -52.9 -57.8 -59.1 -59.6 -61.3 -61.8 -60.4 #> 6 -177. -89.8 T2M -28.9 -40.7 -52.9 -57.9 -59.1 -59.6 -61.3 -61.8 -60.4 #> 7 -177. -89.8 T2M -28.9 -40.7 -52.9 -57.9 -59.1 -59.6 -61.3 -61.8 -60.4 #> 8 -176. -89.8 T2M -28.9 -40.7 -53.0 -57.9 -59.1 -59.6 -61.3 -61.8 -60.4 #> 9 -176. -89.8 T2M -28.9 -40.7 -53.0 -57.9 -59.1 -59.6 -61.3 -61.8 -60.4 #> 10 -175. -89.8 T2M -28.9 -40.7 -53.0 -57.9 -59.1 -59.6 -61.3 -61.8 -60.4 #> # … with 259,190 more rows, and 4 more variables: OCT <dbl>, NOV <dbl>, #> # DEC <dbl>, ANN <dbl># Fetch interannual solar cooking parameters # for a given region sse_i <- get_power( community = "SSE", lonlat = c(112.5, -55.5, 115.5, -50.5), dates = c("1984", "1985"), temporal_average = "INTERANNUAL", pars = c("CLRSKY_SFC_SW_DWN", "ALLSKY_SFC_SW_DWN") ) sse_i#> NASA/POWER SRB/FLASHFlux/MERRA2/GEOS 5.12.4 (FP-IT) 0.5 x 0.5 Degree Interannual Averages/Sums #> Dates (month/day/year): 01/01/1984 through 12/31/1985 #> Location: Regional #> Elevation from MERRA-2: Average for 1/2x1/2 degree lat/lon region = na meters Site = na #> Climate zone: na (reference Briggs et al: http://www.energycodes.gov) #> Value for missing model data cannot be computed or out of model availability range: NA #> #> Parameters: #> ALLSKY_SFC_SW_DWN SRB/FLASHFlux 1/2x1/2 All Sky Insolation Incident on a Horizontal Surface (kW-hr/m^2/day) ; #> CLRSKY_SFC_SW_DWN SRB/FLASHFlux 1/2x1/2 Clear Sky Insolation Incident on a Horizontal Surface (kW-hr/m^2/day) #> #> # A tibble: 308 x 17 #> LON LAT PARAMETER YEAR JAN FEB MAR APR MAY JUN JUL AUG #> <dbl> <dbl> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 113. -55.2 CLRSKY_S… 1984 8.5 6.84 4.64 2.52 1.19 0.69 0.94 1.96 #> 2 113. -55.2 CLRSKY_S… 1985 8.5 6.91 4.66 2.47 1.19 0.69 0.93 1.9 #> 3 113. -55.2 ALLSKY_S… 1984 4.95 4.14 2.48 1.34 0.67 0.39 0.580 1.18 #> 4 113. -55.2 ALLSKY_S… 1985 4.21 3.55 2.68 1.47 0.72 0.37 0.53 1.13 #> 5 113. -55.2 CLRSKY_S… 1984 8.5 6.84 4.64 2.52 1.19 0.69 0.94 1.96 #> 6 113. -55.2 CLRSKY_S… 1985 8.5 6.91 4.66 2.47 1.19 0.69 0.93 1.9 #> 7 113. -55.2 ALLSKY_S… 1984 4.95 4.14 2.48 1.34 0.67 0.39 0.580 1.18 #> 8 113. -55.2 ALLSKY_S… 1985 4.21 3.55 2.68 1.47 0.72 0.37 0.53 1.13 #> 9 114. -55.2 CLRSKY_S… 1984 8.5 6.84 4.64 2.52 1.19 0.69 0.94 1.96 #> 10 114. -55.2 CLRSKY_S… 1985 8.5 6.91 4.66 2.47 1.19 0.69 0.93 1.9 #> # … with 298 more rows, and 5 more variables: SEP <dbl>, OCT <dbl>, NOV <dbl>, #> # DEC <dbl>, ANN <dbl>


§39A‑84 Special purpose revenue bonds exempt from taxation. Special purpose revenue bonds and the income therefrom issued pursuant to this part shall be exempt from all state and county taxation except inheritance, transfer, and estate taxes. [L 1981, c 120, pt of §2]


The best touchscreen gloves 2019
Need gloves that work with your iPhone or Android smartphone or tablet? These special touchscreen gloves will keep your digits warm and digital devices working
by Dominic PrestonCapacitive touchscreen gloves that let you use your smartphone while protecting your hands from the icy cold are certain to be big sellers in this cold weather. But which touchscreen gloves are best for you?
No-one likes cold hands, but no one likes not being able to use their touchscreen device either. And most touchscreens need your actual warm finger skin to operate properly. Wrap those digits in a lovely glove and the digital devices won’t register your touch.
 This means wet or lost gloves plus a good chance of frostbite.
Unless you wear fingerless gloves or cut out holes for your skin to show through, you need a special pair of touchscreen gloves that will work with capacitive touchscreens. Luckily there are a few around and we look at the best touchscreen gloves here - of course, these still won't let you use a fingerprint to unlock your device, so you'll have to get used to either face unlock or going back to a PIN.
Mujjo Touchscreen Gloves with 3M Thinsulate
- RRP: £44.95
Dutch design company Mujjo was one of the first makers of touchscreen gloves, and has a wide range from standard to double-layered and leather. They also look like something from a James Bond movie.
Many touchscreen gloves are restricted to a couple of fingers for their operation. The Mujjo gloves work on all parts of the hand: fingers, knuckles, palm or heel - so if you like punching your phone, you're covered.
The latest generation has had a major redesign, with a slimmer, stretchier construction that makes for a much more comfortable fit. Internal fleece is topped with 3M Thinsulate for a glove that's warm despite being lightweight, with a grippy silicone pattern to help save your phone from unfortunate falls.
These latest 2019 versions are actually triple-layered as they feature improved insulation with an extra layer of Polar fleece. A new thumb construction optimizes them for larger screens.
The only real downsides are the price - at £45 / $50 these are Mujjo's most expensive gloves, though still cheaper than plenty others out there. These look functional rather than fashionable even setting aside the serial killer vibes of wearing skintight black gloves.
In our tests, we could use a phone freely while our hands were encased in the gloves, which felt both comfortable and warm.
Mujjo Knitted Touchscreen Gloves
- RRP: £29.95
If you'd rather spend a little less, you might want to look at one of Mujjo's older designs that's still on sale, the double-layered knitted touchscreen gloves, which include a woollen lining.
These are thicker than the later version, but the charcoal grey finish and leather-lined clasp mean they look a bit more attractive, and don't give off quite as strong an impression that you're on your way home from strangling someone in a dark alley.
Just as with the other Mujjo gloves, these are conductive all over, so you can use any part of your hands on your phone's screen, and they also feature a grippy finish - here in the form of small dots all over the palm and fingers.
Moshi Digits Touchscreen Gloves
- RRP: £29.95
Another pair we've tested are the Digits gloves from Moshi, which come in a bit cheaper than Mujjo's at £29.95/$29.95.
You get a choice of colours, but they're locked into specific sizes for some reason: so the light grey gloves (pictured) are in S/M, while there's a darker grey pair only available for L/XL. I tested the latter and actually found them slightly small (and I don't think my hands are totally massive) so it might be worth considering sizing up.
They're dual-layered (with a seriously soft microfleece lining) though we found the layers pulled apart a little when taking the gloves off, so you might find the need to straighten them out again each time.
These have a conductive layer on all ten fingertips, so you can use any finger at all for your phone, and there's a grippy pattern across the palm. This does leave the inside of the gloves with an almost sparkly finish though, so bear that in mind depending on your taste.
North Face Revelstoke Etip Gloves
- RRP: £55
These gloves from North Face are a bit different, as they're designed specifically for winter sports like skiing or snowboarding - or just more serious winters than we tend to face here in the UK.
Waterproof, breathable, and insulated, these should keep you warm even in fairly intense cold, though won't compete with the absolute best skiing gloves.
Still they have the benefit of that Etip technology, which means you'll be able to check your phone without taking your gloves off on the slopes. Just note that it's only the tips of the thumb and forefinger that are covered, not the whole palm or any other fingers.
North Face Denali Etip Gloves
- RRP: £35
Also from cold-weather specialist North Face, the Men's Denali Etip Gloves are fleece based with nylon Taslan over the knuckles and fingers for added durability, and a silicone gripper palm to provide a superior grip.
North Face rates them as suitable for "Cold" but not "Very Cold" conditions. They come in Small, Medium and Large sizes.
They work well with a touchscreen, and we were able to type reasonably fast while outside in the cold.
Honyar 360° Whole Palm Touchscreen Winter Knit Gloves
- RRP: £9.99
At the less-expensive end of the touchscreen glove market are these perfectly serviceable knitted touchscreen gloves.
While they are not for extremely cold weather, they are great for standard autumn and winter temperatures. They are available in either Black & Khaki, Black & White, or Rose colours.
They feature conductive threads not just on the five fingertips but the whole palm and other parts of these gloves, and boast a soft lining inside to keep your hands warm while driving or walking about.
There's an anti-slip silicone grip design on the palm, which actually looks quite stylish, and should stop your precious phone from slipping from your hands.
The elastic cuff is thickened, so should prevent cold air getting in.
Women's Leather Gloves Winter Touchscreen
- RRP: £9.99
These Acdyion women's winter gloves are made from leather, with a warm cashmere lining inside.

An elastic cuff design and the slit on the side should make pulling them off and on easier.
They are available in four colours: Brown, Black, Red and Grey.


Whonix is compatible with many operating systems, including Windows, Mac OS X and Linux. You may choose the OS you want to install Whonix on from the list below.


|
Colore
<IP_ADDRESS>
C# library for Razer's Chroma SDK
|
A logger using System.Diagnostics
to log messages.
More...
Public Member Functions | |
| override void | Log (LogLevel level, string message) |
| Logs a message. More... | |
| override void | Log (LogLevel level, string message, Exception exception) |
| Logs a message with an exception. More... | |
| override void | LogFormat (LogLevel level, string format, params object[] args) |
| Logs a formatted message. More... | |
| Public Member Functions inherited from Corale.Colore.Logging.Logger | |
| virtual void | Debug (string message) |
| Logs a message at the LogLevel.Debug level. More... | |
| virtual void | Debug (string message, Exception exception) |
| Logs a message at the LogLevel.Debug level with an exception object. More... | |
| virtual void | DebugFormat (string format, params object[] args) |
| Logs a formatted message at the LogLevel.Debug level. More... | |
| virtual void | Info (string message) |
| Logs a message at the LogLevel.Info level. More... | |
| virtual void | Info (string message, Exception exception) |
| Logs a message at the LogLevel.Info level with an exception object. More... | |
| virtual void | InfoFormat (string format, params object[] args) |
| Logs a formatted message at the LogLevel.Info level. More... | |
| virtual void | Warn (string message) |
| Logs a message at the LogLevel.Warn level. More... | |
| virtual void | Warn (string message, Exception exception) |
| Logs a message at the LogLevel.Warn level with an exception object. More... | |
| virtual void | WarnFormat (string format, params object[] args) |
| Logs a formatted message at the LogLevel.Warn level. More... | |
| virtual void | Error (string message) |
| Logs a message at the LogLevel.Error level. More... | |
| virtual void | Error (string message, Exception exception) |
| Logs a message at the LogLevel.Error level with an exception object. More... | |
| virtual void | ErrorFormat (string format, params object[] args) |
| Logs a formatted message at the LogLevel.Error level. More... | |
| virtual void | Fatal (string message) |
| Logs a message at the LogLevel.Fatal level. More... | |
| virtual void | Fatal (string message, Exception exception) |
| Logs a message at the LogLevel.Fatal level with an exception object. More... | |
| virtual void | FatalFormat (string format, params object[] args) |
| Logs a formatted message at the LogLevel.Fatal level. More... | |
Package Functions | |
| TraceLogger (string name, LogLevel level=LogLevel.Info) | |
| Initializes a new instance of the TraceLogger class. More... | |
Private Member Functions | |
| void | Configure () |
| Configures this logger instance. More... | |
Static Private Member Functions | |
| static bool | IsConfigured (TraceSource source) |
| Returns whether the TraceSource object has a non-default configuration applied. More... | |
| static TraceSource | GetParent (string name, SourceLevels level) |
| Gets the parent TraceSource object of a named trace source. More... | |
Private Attributes | |
| readonly TraceSource | _source |
| The internal TraceSource object that this logger uses. More... | |
Static Private Attributes | |
| static readonly Dictionary< LogLevel, SourceLevels > | LevelMapping |
Maps internal logger levels to the ones used in System.Diagnostics . More... | |
| static readonly Dictionary< LogLevel, TraceEventType > | EventMapping |
Maps internal logger levels to event types for use with System.Diagnostics . More... | |
| static readonly Dictionary< string, TraceSource > | SourceCache = new Dictionary<string, TraceSource>() |
| Caches created TraceSource objects. More... | |
Additional Inherited Members | |
| Protected Member Functions inherited from Corale.Colore.Logging.Logger | |
| Logger (string name, LogLevel level) | |
| Initializes a new instance of the Logger class. More... | |
| Properties inherited from Corale.Colore.Logging.Logger | |
| string | Name [get] |
| Gets the name of the logger. More... | |
| LogLevel | Level [get] |
| Gets the configured level threshold. More... | |
| Properties inherited from Corale.Colore.Logging.ILog | |
| string | Name [get] |
| Gets the name of the logger. More... | |
| LogLevel | Level [get] |
| Gets the configured level threshold. More... | |
A logger using System.Diagnostics
to log messages.
Definition at line 33 of file TraceLogger.cs.
|
package |
Initializes a new instance of the TraceLogger class.
| name | The name of this logger. |
| level | The level to log at. |
Definition at line 75 of file TraceLogger.cs.
|
private |
Configures this logger instance.
Definition at line 162 of file TraceLogger.cs.
|
staticprivate |
Gets the parent TraceSource object of a named trace source.
| name | The name of the child trace source. |
| level | The trace level. |
Definition at line 143 of file TraceLogger.cs.
|
staticprivate |
Returns whether the TraceSource object has a non-default configuration applied.
| source | An instance of TraceSource to check. |
true
if the source has been configured explicitly, otherwise false
.Definition at line 127 of file TraceLogger.cs.
|
virtual |
Logs a message.
| level | The level of the message. |
| message | The message to log. |
Implements Corale.Colore.Logging.Logger.
Definition at line 94 of file TraceLogger.cs.
|
virtual |
Logs a message with an exception.
| level | The level of the message. |
| message | The message to log. |
| exception | The exception object to include. |
Implements Corale.Colore.Logging.Logger.
Definition at line 105 of file TraceLogger.cs.
|
virtual |
Logs a formatted message.
| level | The level of the message. |
| format | The format string. |
| args | Format parameters. |
Implements Corale.Colore.Logging.Logger.
Definition at line 116 of file TraceLogger.cs.
|
private |
The internal TraceSource object that this logger uses.
Definition at line 68 of file TraceLogger.cs.
|
staticprivate |
Maps internal logger levels to event types for use with System.Diagnostics
.
Definition at line 50 of file TraceLogger.cs.
|
staticprivate |
Maps internal logger levels to the ones used in System.Diagnostics
.
Definition at line 38 of file TraceLogger.cs.
|
staticprivate |
Caches created TraceSource objects.
Definition at line 63 of file TraceLogger.cs.


|
||||||||
| PREV NEXT | FRAMES NO FRAMES |
| Uses of StorageManager in marf.Classification |
| Classes in marf.Classification that implement StorageManager | |
class |
Classification
Class Classification |
| Uses of StorageManager in marf.Classification.Distance |
| Classes in marf.Classification.Distance that implement StorageManager | |
class |
ChebyshevDistance
Class ChebyshevDistance |
class |
Distance
Class Distance |
class |
EuclideanDistance
Class EuclideanDistance |
class |
MahalanobisDistance
Class MahalanobisDistance |
class |
MinkowskiDistance
Class MinkowskiDistance |
| Uses of StorageManager in marf.Classification.Markov |
| Classes in marf.Classification.Markov that implement StorageManager | |
class |
Markov
Class Markov |
| Uses of StorageManager in marf.Classification.NeuralNetwork |
| Classes in marf.Classification.NeuralNetwork that implement StorageManager | |
class |
NeuralNetwork
Class NeuralNetwork |
| Uses of StorageManager in marf.Classification.RandomClassification |
| Classes in marf.Classification.RandomClassification that implement StorageManager | |
class |
RandomClassification
Class RandomClassification |
| Uses of StorageManager in marf.Classification.Stochastic |
| Classes in marf.Classification.Stochastic that implement StorageManager | |
class |
Stochastic
Class Stochastic |
| Uses of StorageManager in marf.FeatureExtraction |
| Classes in marf.FeatureExtraction that implement StorageManager | |
class |
FeatureExtraction
Class FeatureExtraction |
| Uses of StorageManager in marf.FeatureExtraction.Cepstral |
| Classes in marf.FeatureExtraction.Cepstral that implement StorageManager | |
class |
Cepstral
Class Cepstral |
| Uses of StorageManager in marf.FeatureExtraction.F0 |
| Classes in marf.FeatureExtraction.F0 that implement StorageManager | |
class |
F0
Class F0 |
| Uses of StorageManager in marf.FeatureExtraction.FFT |
| Classes in marf.FeatureExtraction.FFT that implement StorageManager | |
class |
FFT
Class FFT |
| Uses of StorageManager in marf.FeatureExtraction.LPC |
| Classes in marf.FeatureExtraction.LPC that implement StorageManager | |
class |
LPC
Class LPC |
| Uses of StorageManager in marf.FeatureExtraction.RandomFeatureExtraction |
| Classes in marf.FeatureExtraction.RandomFeatureExtraction that implement StorageManager | |
class |
RandomFeatureExtraction
Class RandomFeatureExtraction. |
| Uses of StorageManager in marf.FeatureExtraction.Segmentation |
| Classes in marf.FeatureExtraction.Segmentation that implement StorageManager | |
class |
Segmentation
Class Segmentation |
| Uses of StorageManager in marf.gui |
| Classes in marf.gui that implement StorageManager | |
class |
Spectrogram
Class Spectrogram |
class |
WaveGrapher
Class WaveGrapher |
| Uses of StorageManager in marf.Preprocessing |
| Classes in marf.Preprocessing that implement StorageManager | |
class |
Preprocessing
Class Preprocessing |
| Uses of StorageManager in marf.Preprocessing.Dummy |
| Classes in marf.Preprocessing.Dummy that implement StorageManager | |
class |
Dummy
Class Dummy |
| Uses of StorageManager in marf.Preprocessing.Endpoint |
| Classes in marf.Preprocessing.Endpoint that implement StorageManager | |
class |
Endpoint
Class Endpoint |
| Uses of StorageManager in marf.Preprocessing.FFTFilter |
| Classes in marf.Preprocessing.FFTFilter that implement StorageManager | |
class |
BandpassFilter
Class BandpassFilter |
class |
FFTFilter
FFTFilter class |
class |
HighFrequencyBoost
HighFrequencyBoost Class |
class |
HighPassFilter
HighPassFilter Class |
class |
LowPassFilter
LowPassFilter Class |
| Uses of StorageManager in marf.Storage |
| Classes in marf.Storage that implement StorageManager | |
class |
TrainingSet
TrainingSet -- Encapsulates Speaker ID and speaker's clusters of "feature" sets |
|
||||||||
| PREV NEXT | FRAMES NO FRAMES |


We are getting Married on 25, June, 2015. You are specially invited to our grand occation. Please do visit and make us happy.
#24, 4th Cross, 9th Main, Barack Obama Layout, NYC - 28489, NY


Homework, or a homework assignment, is a set of tasks assigned to students by their teachers to be completed outside the class. Common homework assignments may include required reading, a writing or typing project, mathematical exercises to be completed, information to be reviewed before a test, or other skills to be practiced.
Lifestyle
Life tastes better with coffee
Homework, or a homework assignment, is a set of tasks assigned to students by their teachers to be completed outside the class. Common homework assignments may include required reading, a writing or typing project, mathematical exercises to be completed, information to be reviewed before a test, or other skills to be practiced.
Photodiary
American dream
Homework, or a homework assignment, is a set of tasks assigned to students by their teachers to be completed outside the class. Common homework assignments may include required reading, a writing or typing project, mathematical exercises to be completed, information to be reviewed before a test, or other skills to be practiced.
Photodiary
A day exploring the Alps
Homework, or a homework assignment, is a set of tasks assigned to students by their teachers to be completed outside the class. Common homework assignments may include required reading, a writing or typing project, mathematical exercises to be completed, information to be reviewed before a test, or other skills to be practiced.


The authors would like to thank J. Shakun for his data set of proxy-derived temperatures aligned to LR04, V. Masson–Delmotte for suggestions about past ice core research, and F. Parrenin for the Vostok temperature reconstruction data. M.P.E. was supported by a postdoctoral fellowship from the University of Texas Institute for Geophysics and a grant from the Paleo Perspective on Climate Change program of the National Science Foundation (Grant ATM0902735), as well as support from the University of Southern California and Northern Arizona University. This work was partially funded under the State of Arizona Technology and Research Initiative Fund (TRIF), administered by the Arizona Board of Regents. The authors would also like to thank the NOAA Geophysical Fluid Dynamics Laboratory (GFDL) at Princeton, the National Center for Atmospheric Research (NCAR) and the Computational & Information Systems Lab (CISL), and the Hadley Center for computational resources to complete these simulations.


This walks through install Pyblosxom as an WSGI application on an Apache web server with mod_wsgi installed.
If you find any issues, please let us know.
If you can help with the documentation efforts, please let us know.
Make sure mod_wsgi is installed correctly and working.
Create a blog—see the instructions for the blog directories, config.py setup and other bits of Setting up a blog in install_cgi.
Create a pyblosxom.wsgi script that looks something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # This is the pyblosxom.wsgi script that powers the _______
# blog.
import sys
def add_to_path(d):
if d not in sys.path:
sys.path.insert(0, d)
# call add_to_path with the directory that your config.py lives in.
add_to_path("/home/joe/blog")
# if you have Pyblosxom installed in a directory and NOT as a
# Python library, then call add_to_path with the directory that
# Pyblosxom lives in. For example, if I untar'd
# pyblosxom-1.5.tar.gz into /home/joe/, then add like this:
# add_to_path("/home/joe/pyblosxom-1.5/")
import Pyblosxom.pyblosxom
application = Pyblosxom.pyblosxom.PyblosxomWSGIApp()
|
In the Apache conf file, add:
WSGIScriptAlias /myblog /path/to/something.wsgi
<Directory /path/to>
Order deny,allow
Allow from all
</Directory>
Change /myblog to the url path you want your blog to live at.
Change /path/to/something.wsgi to be the absolute path to the .wsgi file set up in step 3.
Change /path/to to the directory of the .wsgi file.
Restart the Apache web server.
Note
Any time you make changes to Pyblosxom (update, add plugins, change configuration), you’ll have to restart Apache.


|
JTS Topology Suite version 1.13 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vividsolutions.jts.operation.valid.TopologyValidationError
public class TopologyValidationError
Contains information about the nature and location of a Geometry
validation error
| Field Summary | |
|---|---|
static int |
DISCONNECTED_INTERIOR
Indicates that the interior of a polygon is disjoint (often caused by set of contiguous holes splitting the polygon into two parts) |
static int |
DUPLICATE_RINGS
Indicates that a polygonal geometry contains two rings which are identical |
static java.lang.String[] |
errMsg
Messages corresponding to error codes |
static int |
ERROR
Deprecated. |
static int |
HOLE_OUTSIDE_SHELL
Indicates that a hole of a polygon lies partially or completely in the exterior of the shell |
static int |
INVALID_COORDINATE
Indicates that the X or Y ordinate of
a Coordinate is not a valid numeric value (e.g. |
static int |
NESTED_HOLES
Indicates that a hole lies in the interior of another hole in the same polygon |
static int |
NESTED_SHELLS
Indicates that a polygon component of a MultiPolygon lies inside another polygonal component |
static int |
REPEATED_POINT
Deprecated. |
static int |
RING_NOT_CLOSED
Indicates that a ring is not correctly closed (the first and the last coordinate are different) |
static int |
RING_SELF_INTERSECTION
Indicates that a ring self-intersects |
static int |
SELF_INTERSECTION
Indicates that two rings of a polygonal geometry intersect |
static int |
TOO_FEW_POINTS
Indicates that either a LineString contains a single point a LinearRing contains 2 or 3 points |
| Constructor Summary | |
|---|---|
TopologyValidationError(int errorType)
Creates a validation error of the given type with a null location |
|
TopologyValidationError(int errorType,
Coordinate pt)
Creates a validation error with the given type and location |
| Method Summary | |
|---|---|
Coordinate |
getCoordinate()
Returns the location of this error (on the Geometry containing the error). |
int |
getErrorType()
Gets the type of this error. |
java.lang.String |
getMessage()
Gets an error message describing this error. |
java.lang.String |
toString()
Gets a message describing the type and location of this error. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int ERROR
public static final int REPEATED_POINT
public static final int HOLE_OUTSIDE_SHELL
public static final int NESTED_HOLES
public static final int DISCONNECTED_INTERIOR
public static final int SELF_INTERSECTION
public static final int RING_SELF_INTERSECTION
public static final int NESTED_SHELLS
public static final int DUPLICATE_RINGS
public static final int TOO_FEW_POINTS
public static final int INVALID_COORDINATE
X
or Y
ordinate of
a Coordinate is not a valid numeric value (e.g. Double.NaN
)
public static final int RING_NOT_CLOSED
public static final java.lang.String[] errMsg
| Constructor Detail |
|---|
public TopologyValidationError(int errorType, Coordinate pt)
errorType
- the type of the errorpt
- the location of the errorpublic TopologyValidationError(int errorType)
errorType
- the type of the error| Method Detail |
|---|
public Coordinate getCoordinate()
Geometry
containing the error).
Coordinate
on the input geometrypublic int getErrorType()
public java.lang.String getMessage()
public java.lang.String toString()
toString
in class java.lang.Object
|
JTS Topology Suite version 1.13 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Thoughts & Opinions
Let's Git It Together
Git fancies GitHub
02/07/2015
Version control does just that, it gives you control of the different saved versions of your files. When you play a video game and reach a save point, it's a lifesaver since you know that even if you get killed right after, you won't have to start all the way from the beginning. This is what version control does too. Developers are able to start from any of their previously saved "checkpoints", or commits, which allows them to go back to a working version of a file.
How are these changes tracked by git you ask? When you want to save the changes you made to a file in your project, you will move through stages from working, to staged, to commit. The working stage is when you're still editing a file and have not "added" the file to git. A file moves from working to staged when you add it to git via "git add [filename]". Then, you can move the file to the commit stage with a message via "git commit -m [message]".
For ease of use, you'll need an account on a handy website called GitHub to store code. GitHub is not just a social medium for developers to interact and code with each other, but also a place to track your file versions and store code efficiently. If you are working on a project with a group, GitHub lets you easily have people join your repositories, or folders, so that everyone can work on the same files. Another benefit is that you can create something called a "pull request". This is where you would assign someone from your group to take a look at the code you think is ready before it is put into the working group project. This will prevent any inconsistencies as a second pair of eyes are able to take a look at the code.


shari kahn
web developer
This is a fully-responsive, multi-page website that includes text, images, and an i-frame map. It transitions smoothly to any size and looks great on all devices.
This is an interactive map I coded using JavaScript and jQuery. The HTML and CSS was provided by Skillcrush.
This HTML and CSS website uses a full-width image and varies text styles and colors to draw attention to its message. The project also required detailed instructions to define the layout elements and place the text properly.
This is a project using text and images to create a clean, elegant website from a Skillcrush design comp, using HTML 5, CSS, and Photoshop.
Lots of design elements in this project, with background, images, icons, lists, boxes, and columns. All lined up and good to go!
Hi! I’m Shari Kahn, and I'm taking my skills to the web. Editor, science and language teacher, fiber artist -- common to all of these is painstaking attention to detail and commitment to correct and efficient work. I did it all while raising a houseful of children, so you know organization and multitasking are second nature.
I am quick to learn new skills, precise and concise in my language, hard-working and dedicated to excellence. I'm an enthusiastic team player -- and can't wait to help you score your internet goals!
Beit Shemesh, Israel
Let's Zoom!


Preparation time
less than 30 mins
Cooking time
10 to 30 mins
Serves
Makes 2
These are too good to save for brunch! Serve them with a little salad for a simple and filling meal for two.
Preheat the oven to 170C/150C Fan/Gas 3½.
Heat the milk in a frying pan until simmering. Add the smoked haddock and poach for 5–6 minutes or until just cooked through. Lift the haddock out of the milk using a slotted spoon and leave to cool slightly. Remove the skin and cut the haddock into rough pieces.
Divide the haddock and spinach between two ramekin pots. Pour over the cream and carefully crack an egg into each pot. Sprinkle the Cheddar on top and season with salt and pepper.
Place the ramekins on a baking tray and bake for 15 minutes, or until cooked but the yolks are still a little runny.
Put the salad leaves on a plate, dress with a drizzle of oil and a squeeze of lemon juice and serve with the smoked haddock pots.


Select this option to run tests in parallel across labelled nodes.
Nodes need to have a Windows OS with useMango installed.
If this option is not selected or the Label Expression is empty, tests will be executed on the Jenkins master node only.
This assumes the master has a Windows OS with useMango installed.
Tip: For running useMango tests, we recommend adding the label 'usemango' to all your useMango Windows slave nodes.


Dr. Norman Borlaug
Borlaug was often called "the father of the Green Revolution" and is credited with saving over a billion people worldwide from starvation. According to Jan Douglas, executive assistant to the president of the World Food Prize Foundation, the source of this number is Gregg Easterbrook's 1997 article "Forgotten Benefactor of Humanity." The article states that the "form of agriculture that Borlaug preaches may have prevented a billion deaths." He was awarded the Nobel Peace Prize in 1970 in recognition of his contributions to world peace through increasing food supply.
Source: his Wikipedia page.


Introducing Transient Replication
Posted on December 03, 2018 by The Apache Cassandra Community
« Back to the Apache Cassandra Blog
Transient Replication is a new experimental feature soon to be available in 4.0. When enabled, it allows for the creation of keyspaces where replication factor can be specified as a number of copies (full replicas) and temporary copies (transient replicas). Transient replicas retain the data they replicate only long enough for it to be propagated to full replicas, via incremental repair, at which point the data is deleted. Writing to transient replicas can be avoided almost entirely if monotonic reads are not required because it is possible to achieve a quorum of acknowledged writes without them.
This results in a savings in disk space, CPU, and IO. By deleting data as soon as it is no longer needed, transient replicas require only a fraction of the disk space of a full replica. By not having to store the data indefinitely, the CPU and IO required for compaction is reduced, and read queries are faster as they have less data to process.
So what are the benefits of not actually keeping a full copy of the data? Well, for some installations and use cases, transient replicas can be almost free if monotonic reads are disabled. In future releases where monotonic reads are supported with Transient Replication, enabling monotonic reads would reduce the savings in CPU and IO, but even then they should still be significant.
Transient Replication is designed to be transparent to applications:
- Consistency levels continue to produce the same results for queries.
- The number of replicas that can be lost before data loss occurs is unchanged.
- The number of replicas that can be unavailable before some queries start to timeout or return unavailable is unchanged (with the exception of ONE).
With Transient Replication, you can go from 3 replicas to 5 replicas, two of which are transient, without adding any hardware.
If you are running an active-passive 2 DC setup with 3 replicas in each DC, you can make one replica in each DC transient and still have four full copies of the data in total.
Feature support
Transient Replication is not intended to fully replace Cassandra’s existing approach to replication. There are features that currently don’t work with transiently replicated keyspaces and features that are unlikely ever to work with them.
You can have keyspaces with and without Transient Replication enabled in the same cluster, so it is possible to use Transient Replication for just the use cases that are a good fit for the currently available functionality.
Currently unsupported but coming:
- Monotonic reads
- Batch log
- LWT
- Counters
Will never be supported:
- Secondary indexes
- Materialized views
How Transient Replication works
Overview
Transient replication extends Cassandra’s existing consistent hashing algorithm to designate some replicas of a point or range on the consistent hash ring as transient and some as full. The following image depicts a consistent hash ring with three replicas A, B, and C. The replicas are located at tokens 5, 10, 15 respectively. A key k hashes to token 3 on the ring.
Replicas are selected by walking the ring clockwise starting at the point on the ring the key hashes to. At RF=3, the replicas of key k **are **A, B, C. With Transient Replication, the last N replicas (where N is the configured number of transient replicas) found while walking the ring are designated as transient.
There are no nodes designated as transient replicas or full replicas. All nodes will fully replicate some ranges on the ring and transiently replicate others.
The following image depicts a consistent hash ring at RF=3/1 (three replicas, one of which is transient). The replicas of k are still A, B, and C, but C is now transiently replicating k.
Normally all replicas of a range receive all writes for that range, as depicted in the following image.
Transient replicas do not receive writes in the normal write path.
If sufficient full replicas are unavailable, transient replicas will receive writes.
This optimization, which is possible with Transient Replication, is called Cheap Quorums. This minimizes the amount of work that transient replicas have to do at write time, and reduces the amount of background compaction they will have to do.
Cheap Quorums and monotonic reads: Cheap Quorums may end up being incompatible with an initial implementation of monotonic reads, and operators will be able to make a conscious trade off between performance and monotonic reads.
Rapid write protection
In keyspaces utilizing Transient Replication, writes are sent to every full replica and enough transient replicas to meet the requested consistency level (to make up for unavailable full replicas). In addition, enough transient replicas are selected to reach a quorum in every datacenter, though unless the consistency level requires it, the write will be acknowledged without ensuring all have been delivered.
Because not all replicas are sent the write, it’s possible that insufficient replicas will respond, causing timeouts. To prevent this, we implement rapid write protection, similar to rapid read protection, that sends writes to additional replicas if sufficient acknowledgements to meet the consistency level are not received promptly.
The following animation shows rapid write protection in action.
Rapid write protection is configured similarly to rapid read protection using the table option additional_write_policy
. The policy determines how long to wait for acknowledgements before sending additional mutations. The default is to wait for P99 of the observed latency.
Incremental repair
Incremental repair is used to clean up transient data at transient replicas and propagate it to full replicas.
When incremental repair occurs transient replicas stream out transient data, but don’t receive any. Anti-compaction is used to separate transient and fully replicated data so that only fully replicated data is retained once incremental repair completes.
The result of running an incremental repair is that all full replicas for a range are synchronized and can be used interchangeably to retrieve the repaired data set for a query.
Read path
Reads must always include at least one full replica and can include as many replicas (transient or full) as necessary to achieve the desired consistency level. At least one full replica is required in order to provide the data not available at transient replicas, but it doesn’t matter which full replica is picked because incremental repair synchronizes the repaired data set across full replicas.
Reads at transient replicas are faster than reads at full replicas because reads at transient replicas are unlikely to return any results if monotonic reads are disabled, and they haven’t been receiving writes.
Creating keyspaces with Transient Replication
Transient Replication is supported by SimpleStrategy and NetworkTopologyStrategy. When specifying the replication factor, you can specify the number of transient replicas in addition to the total number of replicas (including transient replicas). The syntax for a replication factor of 3 replicas total with one of them being transient would be “3/1”.
ALTER KEYSPACE foo WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'DC1' : '3/1'};
ALTER KEYSPACE foo WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor' : '3/1'};
Monotonic reads are not supported with Transient Replication in 4.0, so any existing tables in the keyspace must have monotonic reads disabled by setting read_repair = 'NONE'
Once the keyspace has been altered, you will need to run incremental repair and then nodetool cleanup to ensure transient data is cleaned up.
Operational matters
Transient replication requires rolling incremental repair to be run regularly in order to move data from transient replicas to full replicas. By default transient replicas will receive 1% of writes for transiently replicated ranges due to rapid write protection. If a node is down for an extended period of time, its transient replicas will receive additional write load and that data should be cleaned up using incremental repair. Running incremental repair regularly will ensure that the size of each repair is small.
It’s also a good idea to run a small number of vnodes with transient replication so that when a node goes down the load is spread out over several other nodes that transiently replicate that range. Larges numbers of vnodes are known to be problematic, so it’s best to start with a cluster that is already close to or at its maximum size so that a small number of vnodes will be sufficient. If you intend to grow the cluster in the future, you will need to be cognizant of how this will interact with the number of vnodes you select.
While the odds of any data loss should multiple nodes be permanently lost remain the same with transient replication, the magnitude of potential data loss does not. With 3/1 transient replication the permanent loss of two nodes could result in the loss of the entirety of the repaired data set. If you are running a multi-DC setup with a high level of replication such as 2 DCs, with 3/1 replicas in each, then you will have 4 full copies total and the added risk of transient replication is minimal.
Experimental features
Experimental features are a relatively new idea for Apache Cassandra. Although we recently voted to make materialized views an experimental feature retroactively, Transient Replication is the first experimental feature to be introduced as such.
The goal of introducing experimental features is to allow for incremental development across multiple releases. In the case of Transient Replication, we can avoid a giant code drop that heavily modifies the code base, and the associated risks with incorporating a new feature that way.
What it means for a feature to be experimental doesn’t have a set definition, but for Transient Replication it’s intended to set expectations. As of 4.0, Transient Replication’s intended audience is expert operators of Cassandra with the ability to write the book on how to safely deploy Transient Replication, debug any issues that result, and if necessary contribute code back to address problems as they are discovered.
It’s expected that the feature set for Transient Replication will not change in minor updates to 4.0, but eventually it should be ready for use by a wider audience.
Next steps for Transient Replication
If increasing availability or saving on capacity sounds good to you, then you can help make transient replication production-ready by testing it out or even deploying it. Experience and feedback from the community is one the of the things that will drive transient replication bug fixing and development.


Embed executable Python code in a markdown pageThe markdown format is supported by the Brython module browser.markdown.In this example we show how a markdown page can include Python code that can be executed by the visitor. This can be used in online tutorials. The code is editable, so users can modify the initial code and test modifications. |


Encapsulates material info for Table.
More...
#include <Table.h>
Encapsulates material info for Table.
Definition at line 24 of file Table.h.
◆ TableData() [1/3]
Default constructor.
Definition at line 36 of file Table.h.
◆ TableData() [2/3]
Copy constructor.
Definition at line 39 of file Table.h.
◆ TableData() [3/3]
| TableData::TableData |
( |
const int |
zin, |
|
|
const double |
ain, |
|
|
const std::string |
fin |
|
) |
| |
|
inline |
Parametrized constructor.
- Parameters
-
Definition at line 47 of file Table.h.
Atomic weight.
Definition at line 30 of file Table.h.
File handle.
Definition at line 33 of file Table.h.
Nuclear charge.
Definition at line 27 of file Table.h.
The documentation for this struct was generated from the following file:


websites
e-commerce
brands
We're an awesome company and we do awesome stuff. You can tell that by our awesome landing page. Notice how often I use the word awesome? That's how awesome we are.  There's probably something we can do for you. We create websites, tools, other software, basically everything. We design brands and create everything necessary for you to run and promote your business.
Have a look at our portfolio below, and don't hesitate to contact us! We're always open to hear about your project and to see if we can help you.
Check out our latest work below. Unlike most information on this landing page, these products are real and you can find them by clicking 'More products' in the navigation bar. They're free and open source, just like this page template. Isn't that awesome?
We've got an amazing team. Skilled, social and they're at your service. They've been working with us for years and know the ins 'n outs of the business. We're always keeping out team up to date with cutting edge technology.
I love creating awesome stuff. People always think my name is fake, but I'm actually called John Doe.
Design is my passion. What's yours? Oh, by the way, John is not my brother, stop asking!


united-rentals
Businessmodel of United Rentals
Customer Segments
United Rentals has a segmented market business model, with customer groups that have slightly different needs:
- Commercial Construction Companies – Companies that use equipment for constructing and renovating commercial buildings, warehouses, industrial and manufacturing plants, office parks, airports, residential developments, and other facilities.
- Industrial Companies – Manufacturers, chemical companies, paper mills, railroads, ship builders and utilities that use equipment for plant maintenance, upgrades, expansion, and construction.
- Residential Customers – Homeowners and other individuals that use equipment for projects that range from simple repairs to major renovations. ### Value Proposition
United Rentals offers four primary value propositions: accessibility, convenience, cost reduction, and brand/status.
The company creates accessibility by providing a wide variety of options. It offers over 3,300 classes of rental equipment, which includes general industrial and construction equipment, trench safety equipment, aerial work platforms, power and HVAC equipment, pumps, and general tools and light equipment. The products can be rented on a monthly, weekly, daily, or hourly basis. The company also provides a broad set of related services, ranging from online management tools to custom onsite specialty solutions.
The company offers convenience by making life simpler for its customers. Its clients can order equipment 24 hours a day, seven days a week through its website. They can also use its UR Control application to manage the rental process and view real-time reports on business activity. Lastly, they can use Total Control, a proprietary software application that allows them to manage and monitor all of their equipment needs. It can be integrated into their enterprise resource planning systems.
The company reduces costs by saving customers up to 35% on annual rental costs on average, thanks to its advanced fleet management system.
The company has established a strong brand due to its success. It bills itself as the largest equipment rental company in the world, with a store network nearly three times the size of any other provider. It has a network of 890 rental locations in 49 states and 10 Canadian provinces. It is a memberof the the *Fortune *500, Russell 3000 Index, the Barron’s 400 Index, and the Standard & Poor’s 500 Index. It holds a 13% share of the equipment rental market in terms of revenues, the largest share of any firm in that segment. Lastly, it has won many honors, including the following:
- Recognition as one of the Top 100 Leaders in Corporate Supplier Diversity by Women’s Enterprise
- Access Industry Employer of the Year and Access Safety Innovation Awards from Access, Lift, & Handlers
- Recognition as one of the Top 30 Champions of Diversity by Diversity Plus
- Recognition as a Top 100 Military-Friendly Employer by I. Jobs Magazine ### Channels
United Rentals’ main channel is its direct sales team. The company promotes its offering through its website, social media pages, advertising (TV/Internet/radio/trade publications), direct mail marketing, sponsorships, and participation in trade shows, conferences, and promotional events.
Customer Relationships
United Rentals’ relationship is primarily of a self-service nature. Customers utilize its products and services while having limited interaction with employees. That said, there is a personal assistance component in the form of phone and e-mail support.
Key Activities
United Rentals’ business model entails purchasing and renting equipment to its customers, as well as providing associated services.
Key Partners
United Rentals’ key partners are the suppliers that provide the equipment and supplies that it rents to its customers. It aims to have the minimum number of suppliers per equipment category that can satisfy its anticipated business requirements and volume.
Key Resources
United Rentals’ main resources are its physical resources. These include its rental fleet of 7,900 vehicles and 500,000 individual units of rental equipment. They also include its 897 rental locations worldwide, 775 of which are in the U.S. and 122 of which are in Canada.
Cost Structure
United Rentals has a cost-driven structure, aiming to minimize expenses through significant automation and low-price value propositions. Its biggest cost driver is cost of equipment, a fixed cost. Other major drivers are in the areas of sales/marketing and administration, both fixed costs.
Revenue Streams
United Rentals has two revenue streams: revenues it generates from rentals and sales of new equipment to customers.