:: DeveloperApi ::
Flags for controlling the storage of an RDD. Each StorageLevel records whether to use memory,
or ExternalBlockStore, whether to drop the RDD to disk if it falls out of memory or
ExternalBlockStore, whether to keep the data in memory in a serialized format, and whether
to replicate the RDD partitions on multiple nodes.
The org.apache.spark.storage.StorageLevel singleton object contains some static constants
for commonly useful storage levels. To create your own storage level object, use the
factory method of the singleton object (StorageLevel(...)).
:: DeveloperApi :: Flags for controlling the storage of an RDD. Each StorageLevel records whether to use memory, or ExternalBlockStore, whether to drop the RDD to disk if it falls out of memory or ExternalBlockStore, whether to keep the data in memory in a serialized format, and whether to replicate the RDD partitions on multiple nodes.
The org.apache.spark.storage.StorageLevel singleton object contains some static constants for commonly useful storage levels. To create your own storage level object, use the factory method of the singleton object (
StorageLevel(...)
).


June 24th 2016 by David Ye #Log
1."==" , "=" & ">="
== 意为判断前后是否相等，如下例所示：
>>> 10 == 8
False
= 意为赋值，如：
>>> a = 10
>>> print(a)
10
>= 大于等于号，如：
age = 20
>>> Old_enough = age >= 17
>>> Old_enough
True
2.Logical Operators (武老大高一的时候讲过，不会的要被查水表了)
(1) And: 只有在input都为"True"的条件下output才为"True"
(2) Or: 只要input中有一个为"True"那么output就为"True"
(3)Not: "False"变"True","True"变"False"
3.Truth Tables
a
|
b
|
a or b
|
F
|
F
|
F
|
F
|
T
|
T
|
T
|
F
|
T
|
T
|
T
|
T
|
a
|
b
|
a and b
|
False
|
False
|
False
|
False
|
True
|
False
|
True
|
False
|
False
|
True
|
True
|
True
|
4. Break
The
break statement is used to immediately leave the body of its loop. The next statement to be executed is the first one after the body:
for i in [12, 16, 17, 24, 29]:
if i % 2 == 1:
break
print(i)
print(done)
5.Continue
This is a control flow statement that causes the program to immediately skip the processing of the rest of the body of the loop,
for the current iteration. But the loop still carries on running for its remaining iterations:
for i in [12, 16, 17, 24, 29, 30]:
if i % 2 == 1:
continue
print(i)
print("done")
6.Return
跳出函数，把后面作为返回值，只能用于函数中。
7.Comments and Notations are very important! (To remind yourself)
8.Composition
即函数调用函数，在之前用五个五角星组一个大五角星一题中大家已经练习过了。
9.Recursion
即函数调用自己，递归，如：
def Factorial(n):
if n == 0 or n == 1:
return 1
else:
return(n * Factorial(n - 1))
print(Factorial(6))
Finally, the homework is to write a program to represent the steps of the Hanoi Tower.
-different sides of disks on the first rod
-there are three rods in total
-only one disk can be moved at a time
-each move consists of taking the upper disk from one of thstacks and placing it on top of another stack
-no disk may be placed on top of a smaller disk
Hanoi(a, c, n)
Hanoi(a, c, 1)
Hanoi(a, c, n-1)
Leave the calculations to your computer
show each of the steps!


wed album txt
nav upload txt
wed album link txt
Previous
Next
intro text
share photos with guests
thank sharing txt
explain drive text


Bartosz Gajda
Front End. Back End. Mobile
Code Everything. Everywhere. Everytime.
About Me
My name is Bartosz Gajda. I'm highly talented and motivated Web and Mobile Developer with 2,5 years’ experience of developing software using wide variety of technologies and frameworks.
Born perfectionist and true team player. Fascinated in modern web and mobile development. Experienced in front end as well as back end software development. Big fan of Star Wars, football and Legos :)
Work
Skills & Abilities
- JS (ES6)
- PHP
- TypeScript
- Angular 5
- Ionic 3
- Git
- Node.JS
- CSS
- SQL
- Express
- Java 8
- Responsive Web Design
- Mongoose
- RESTful API
- Laravel
- Lumen
- CI
Projects
List of my completed or ongoing project. Do not hesitate to view source code on my GitHub profile.


Read from Url
Read from Url 2
Read from stream
Page : {{currentPage}}/{{totalPages}}
{{status.percent}}%


- {$business_info.user.popularity}
人气 - {$business_info.user.fans}
粉丝 - {$business_info.user.release}
发布
{$business_info.name}
商
{if condition="$business_info.company_type"}
{volist name="$business_info.company_type" id="ctype"}
{$ctype}
{/volist}
{/if}
{if condition="$business_info.machining"}
{volist name="$business_info.machining" id="mtype" key="mk"}
{$mtype} {if condition="$mk lt $business_info.machining_count"}|{/if}
{/volist}
{/if}


To use dygraphs, include the dygraph.js
JavaScript file
and dygraph.css
CSS file. Then instantiate a Dygraph
object.
Here's a basic example to get things started:
  <link rel="stylesheet" type="text/css" src="dygraph.css" />

In order to keep this example self-contained, the second parameter is raw CSV data. You can use your favourite “defer until DOM is ready” method (e.g. Prototype or jQuery); dygraphs includes a small self-contained one that can be used if nothing else is available. The dygraphs library parses this data (including column headers), resizes its container to a reasonable default, calculates appropriate axis ranges and tick marks and draws the graph. Make sure the container does not have any padding.
In most applications, it makes more sense to include a CSV file instead.
If the second parameter to the constructor doesn't contain a newline,
it will be interpreted as the path to a CSV file.
The Dygraph will perform an XMLHttpRequest to retrieve this file
and display the data when it becomes available.
Make sure your CSV file is readable and serving from a place that
understands XMLHttpRequests! In particular, you cannot
specify a CSV file using "file:///"
. Here's an example:
(data from Weather Underground)
  <link rel="stylesheet" type="text/css" src="dygraph.css" />

The file used is temperatures.csv
.
There are a few things to note here:
temperatures.csv
, which is Date,High,Low
. Make sure they are unique!This problem can be fixed by specifying the appropriate options in the "additional options" parameter to the Dygraph constructor. To set the number of days for a moving average, use the rollPeriod
option. Here’s how it’s done:
  <link rel="stylesheet" type="text/css" src="dygraph.css" />

A rolling average can be set using the text box in the lower left-hand corner of the graph (the showRoller attribute is what makes this appear). Also note that we've explicitly set the size of the chart div.
Another significant feature of the dygraphs library is the ability to display high/low bands around data series. One standard deviation must be specified for each data point. A ±n sigma band will be drawn around the data series at that point. If a moving average is being displayed, dygraphs will compute the standard deviation of the average at each point. I.E. σ = sqrt( (σ12 + σ22 + ... + σn2) / n )
Here's a demonstration. There are two data series. One is
N(100,10)
with a standard deviation of 10 specified at
each point. The other is N(80,20)
with a standard
deviation of 20 specified at each point. The CSV file was generated
using Octave and can be viewed at twonormals.csv.
  <link rel="stylesheet" type="text/css" src="dygraph.css" />

Things to note here:
The Google Visualization API provides a standard interface for describing data. Once you've specified your data using this API, you can plug in any GViz-compatible visualization. dygraphs is such a visualization. In particular, it can be used as a drop-in replacement for the AnnotatedTimeline visualization used on Google Finance and other sites. To see how this works, check out the gviz annotation demo⚠.
Here is another demonstration of how to use dygraphs a GViz visualization⚠.
Situations often arise where you want to plot fractions, e.g. the fraction of respondents in a poll who said they'd vote for candidate X or the number of hits divided by at bats (baseball's batting average). Fractions require special treatment for two main reasons:
a1/b1
and a2/b2
is (a1+a2)/(b1+b2)
, not (a1/b1 + a2/b2)/2
.Fortunately, dygraphs handles both of these for you! Here's a chart and the command that generated it:
new Dygraph( document.getElementById("baseballdiv"), "suzuki-mariners.txt", { fractions: true, errorBars: true, showRoller: true, rollPeriod: 15 } );
The fractions
option indicates that the values in each column should be parsed as fractions (e.g. "1/2" instead of "0.5"). The errorBars
option indicates that we'd like to see a confidence interval around each data point. By default, when fractions
is set, you get a Wilson confidence interval. If you look carefully at the chart, you can see that the high/low bands are asymmetric.
A couple things to notice about this chart:
This chart shows monthly closes of the Dow Jones Industrial Average, both in nominal and real (i.e. adjusted for inflation) dollars. The shaded areas show its monthly high and low. CPI values with a base from 1982-84 are used to adjust for inflation.
Display:
Here are a few problems that I've frequently run into while using the dygraphs library.
YYYY-MM-DD, series1, series2,
… — the older YYYYMMDD as first column is not recognised as date any more but as number. And if you set the errorBars
property, make sure you alternate data series and standard deviations.
tag. This applies to the CSS text-align
property as well. If you want to center a Dygraph, put it inside a table with align = center
set.dateWindow
property to a date. It expects milliseconds since epoch, which can be obtained from a JavaScript Date object's valueOf method.If you need to support Internet Explorer, check out our notes on IE.
To get some inspiration, look at how the charts in our gallery are built.
The original author Dan Vanderkam gave a 42-minute talk about dygraphs in 2017 which might be helpful background for anyone interested in using or contributing to the project.


CYCLO (XICH LO) A film review by Steve Rhodes Copyright 1996 Steve Rhodes
RATING (0 TO ****): *
CYCLO (XICH LO) is the second feature length film by director Tran Anh Hung. His first was the highly acclaimed and much gentler THE SCENT OF GREEN PAPAYA. In certainly a change of pace, CYCLO is a depressing, violent, claustrophobic, and confusing tale. I tried hard to like it, but had to give up in futility. I will give it this, it is a gritty film.
CYCLO is set and was filmed in contemporary Ho Chi Minh City, Vietnam. It tells the story of a man, played by Le Van Loc, who works as a cyclo - a bicycle with a small seat in front for carrying one or more passengers plus assorted luggage, food, animals, you name it. In the movie he is known simply as The Cyclo. As the director and co-writer Hung says in the press kit, "for me the term refers equally to the driver and his vehicle."
The Cyclo leads a tragic life. His mother died in childbirth and his father was a cyclo who was killed at work in a traffic accident. Early in the story a gang steals The Cyclo's cyclo, and he soon decides if you can't beat 'em, join 'em. He has a sister, known only as The Sister (Tran Nu Yen-Khe), who is in love with her pimp, The Poet (Tony Leung Chiu Wai).
If the film's purpose is to shock us into how bad it is now in Vietnam, then at least on that score it succeeds. The violence shown ranges from sadistic to worse. People have funnels forced down their throats, and they are almost drowned in water until they come close to gagging themselves to death by throwing up.  In another scene a person is horribly and realistically burned with a Molotov cocktail. This is making me nauseous so I am going to stop giving examples. You get the picture by now. As an aside, there are some extremely violence films that I have loved, but here it is so gratuitous and excessive that it turned me off.
Even absent the gore, the story is a depressing one. The Sister is not just a prostitute, she is one that has to engage in shall we say some unusual activities. The cinematography (Benoit Delhomme and Laurence Tremolet) is full of tight close-ups in highly confined quarters. It makes you want to go outside and get some fresh air it is so claustrophobic.
The script contains little dialog and like the recent Iranian film, THE WHITE BALLOON, the lack of dialog is filled with the overpowering sound of traffic noise. What lines there are serve more to confuse than enlighten. Finally, the characters were so unsympathetically drawn that you do care about what happens to any of them which makes the massive violence seem all the more excessive.
I must admit, I do like the dramatic music by Ton-That Tiet. I will give the director credit for being willing to experiment. He takes a lot of risks and fails miserably.
CYCLO runs too long at 2:00. It needs much more aggressive editing than Nicole Dedieu and Claude Ronzeau give it. The film is in Vietnamese with English subtitles. CYCLO is not rated, but would be at least an R. I would only let the most mature teenagers see it. I hope Tran Anh Hung returns to films like THE SCENT OF GREEN PAPAYA in the future and leaves the ultra violence movies to directors like Quentin Tarantino who have a better sense of how to handle it. I hated CYCLO, but give it * for trying.
**** = One of the top few films of this or any year. A must see film. *** = Excellent show. Look for it. ** = Average movie. Kind of enjoyable. * = Poor show.  Totally unbearable.
REVIEW WRITTEN ON: June 3, 1996
Opinions expressed are mine and not meant to reflect my employer's.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


/**
*start: 2005—09-01
*/
Boy name = Mr LIU
Girl name = Mrs XU
// They are acquainted with each other.
At that time, they are only ordinary classmates;
// They are also separated by a lot of desks.
The boy is shy;
// As time goes on.
The girl is cute and excellent;
// One day, maybe is spring term in junior one.
The boy discovers the gilr lives in his heart unknowingly;
// But, she maybe don't konwn that.
// So there they spend every sunrise and sunset.
They finish their junior school.
// In the senior school, they are classmates again.
The boy is very happy;
Maybe the girl is also very happy;
// In the last year of senior school, the girl fades out from the boy's heart gradually.
When the boy thinks back on it now, it's a huge mistake.
// Three years' senior school goes away again hurriedly.
At the same time, the girl falls in love river with a handsome boy;
But the boy blesses them and wants the gilr could well have been happy forever sincerely;
// After several years' Spring Festival, they meet again at a party.
She is cute and gentle as always. And the boy's heart was touched again. Because the thing he has known by heart is not only her name, but also her sweet looking.
// Last year, she tells him that she is single.
He tells himself, "you don't miss her again in any case";
After he knows that, he tries his best to live in the girl's heart.
// July 24th is her birthday.
He buys tickets to her city early and accompanies her celebrating birthday. Although that has lots of regret, it's very sweet;
// At the last, but not the end...
Today is Chinese Valentine's Day, and this sweet page only for you, my love Jing.
And I want to say:
Imagining that one day I am holding your hand to propose toast to the guests who attend our wedding.
/**
*end: that all to be continue...
*/
*start: 2005—09-01
*/
Boy name = Mr LIU
Girl name = Mrs XU
// They are acquainted with each other.
At that time, they are only ordinary classmates;
// They are also separated by a lot of desks.
The boy is shy;
// As time goes on.
The girl is cute and excellent;
// One day, maybe is spring term in junior one.
The boy discovers the gilr lives in his heart unknowingly;
// But, she maybe don't konwn that.
// So there they spend every sunrise and sunset.
They finish their junior school.
// In the senior school, they are classmates again.
The boy is very happy;
Maybe the girl is also very happy;
// In the last year of senior school, the girl fades out from the boy's heart gradually.
When the boy thinks back on it now, it's a huge mistake.
// Three years' senior school goes away again hurriedly.
At the same time, the girl falls in love river with a handsome boy;
But the boy blesses them and wants the gilr could well have been happy forever sincerely;
// After several years' Spring Festival, they meet again at a party.
She is cute and gentle as always. And the boy's heart was touched again. Because the thing he has known by heart is not only her name, but also her sweet looking.
// Last year, she tells him that she is single.
He tells himself, "you don't miss her again in any case";
After he knows that, he tries his best to live in the girl's heart.
// July 24th is her birthday.
He buys tickets to her city early and accompanies her celebrating birthday. Although that has lots of regret, it's very sweet;
// At the last, but not the end...
Today is Chinese Valentine's Day, and this sweet page only for you, my love Jing.
And I want to say:
Imagining that one day I am holding your hand to propose toast to the guests who attend our wedding.
/**
*end: that all to be continue...
*/
Dear静妹子，这是我们相识的时光。
恋上你的温婉与可爱
- 你浩哥


# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
ui.py:
Provides the main user functions for reading and writing tables.
:Copyright: Smithsonian Astrophysical Observatory (2010)
:Author: Tom Aldcroft<EMAIL_ADDRESS>"""
## Copyright (c) 2010, Smithsonian Astrophysical Observatory
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are met:
## * Redistributions of source code must retain the above copyright
## notice, this list of conditions and the following disclaimer.
## * Redistributions in binary form must reproduce the above copyright
## notice, this list of conditions and the following disclaimer in the
## documentation and/or other materials provided with the distribution.
## * Neither the name of the Smithsonian Astrophysical Observatory nor the
## names of its contributors may be used to endorse or promote products
## derived from this software without specific prior written permission.
 IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
## DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
## (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
## SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import re
import os
import sys
from . import core
from . import basic
from . import cds
from . import daophot
from . import sextractor
from . import ipac
from .core import next, izip, any
from . import latex
from ...table import Table
# Default setting for guess parameter in read()
_GUESS = True
[docs]def set_guess(guess):
"""Set the default value of the ``guess`` parameter for read()
:param guess: New default ``guess`` value (True|False)
"""
global _GUESS
_GUESS = guess
[docs]def get_reader(Reader=None, Inputter=None, Outputter=None, **kwargs):
"""Initialize a table reader allowing for common customizations. Most of the
default behavior for various parameters is determined by the Reader class.
:param Reader: Reader class (default= :class:`Basic`)
:param Inputter: Inputter class
:param Outputter: Outputter class
:param delimiter: column delimiter string
:param comment: regular expression defining a comment line in table
:param quotechar: one-character string to quote fields containing special characters
:param header_start: line index for the header line not counting comment lines
:param data_start: line index for the start of data not counting comment lines
:param data_end: line index for the end of data (can be negative to count from end)
:param converters: dict of converters
:param data_Splitter: Splitter class to split data columns
:param header_Splitter: Splitter class to split header columns
:param names: list of names corresponding to each data column
:param include_names: list of names to include in output (default=None selects all names)
:param exclude_names: list of names to exlude from output (applied after ``include_names``)
:param fill_values: specification of fill values for bad or missing table values
:param fill_include_names: list of names to include in fill_values (default=None selects all names)
:param fill_exclude_names: list of names to exlude from fill_values (applied after ``fill_include_names``)
"""
# This function is a light wrapper around core._get_reader to provide a public interface
# with a default Reader.
if Reader is None:
Reader = basic.Basic
reader = core._get_reader(Reader, Inputter=Inputter, Outputter=Outputter, **kwargs)
return reader
[docs]def read(table, guess=None, **kwargs):
"""Read the input ``table`` and return the table. Most of
the default behavior for various parameters is determined by the Reader
class.
:param table: input table (file name, list of strings, or single newline-separated string)
:param guess: try to guess the table format (default=True)
:param Reader: Reader class (default=``ascii.Basic``)
:param Inputter: Inputter class
:param Outputter: Outputter class
:param delimiter: column delimiter string
:param comment: regular expression defining a comment line in table
:param quotechar: one-character string to quote fields containing special characters
:param header_start: line index for the header line not counting comment lines
:param data_start: line index for the start of data not counting comment lines
:param data_end: line index for the end of data (can be negative to count from end)
:param converters: dict of converters
:param data_Splitter: Splitter class to split data columns
:param header_Splitter: Splitter class to split header columns
:param names: list of names corresponding to each data column
:param include_names: list of names to include in output (default=None selects all names)
:param exclude_names: list of names to exlude from output (applied after ``include_names``)
:param fill_values: specification of fill values for bad or missing table values
:param fill_include_names: list of names to include in fill_values (default=None selects all names)
:param fill_exclude_names: list of names to exlude from fill_values (applied after ``fill_include_names``)
"""
# Provide a simple way to choose between the two common outputters. If an
# Outputter is supplied in kwargs that will take precedence.
new_kwargs = {}
new_kwargs['Outputter'] = core.TableOutputter
new_kwargs.update(kwargs)
if guess is None:
guess = _GUESS
if guess:
dat = _guess(table, new_kwargs)
else:
reader = get_reader(**new_kwargs)
dat = reader.read(table)
return dat
def _is_number(x):
try:
x = float(x)
return True
except ValueError:
pass
return False
def _guess(table, read_kwargs):
"""Try to read the table using various sets of keyword args. First try the
original args supplied in the read() call. Then try the standard guess
keyword args. For each key/val pair specified explicitly in the read()
call make sure that if there is a corresponding definition in the guess
then it must have the same val. If not then skip this guess."""
# Keep a trace of all failed guesses kwarg
failed_kwargs = []
# First try guessing
for guess_kwargs in [read_kwargs.copy()] + _get_guess_kwargs_list():
guess_kwargs_ok = True # guess_kwargs are consistent with user_kwargs?
for key, val in read_kwargs.items():
# Do guess_kwargs.update(read_kwargs) except that if guess_args has
# a conflicting key/val pair then skip this guess entirely.
if key not in guess_kwargs:
guess_kwargs[key] = val
elif val != guess_kwargs[key]:
guess_kwargs_ok = False
break
if not guess_kwargs_ok:
# User-supplied kwarg is inconsistent with the guess-supplied kwarg, e.g.
# user supplies delimiter="|" but the guess wants to try delimiter=" ",
# so skip the guess entirely.
continue
try:
reader = get_reader(**guess_kwargs)
dat = reader.read(table)
# When guessing impose additional requirements on column names and number of cols
bads = [" ", ",", "|", "\t", "'", '"']
if (len(reader.cols) <= 1 or
any(_is_number(col.name) or
len(col.name) == 0 or
col.name[0] in bads or
col.name[-1] in bads for col in reader.cols)):
raise ValueError
return dat
except (core.InconsistentTableError, ValueError, TypeError):
failed_kwargs.append(guess_kwargs)
pass
else:
# failed all guesses, try the original read_kwargs without column requirements
try:
reader = get_reader(**read_kwargs)
return reader.read(table)
except (core.InconsistentTableError, ValueError):
failed_kwargs.append(read_kwargs)
lines = ['\nERROR: Unable to guess table for with the guesses listed below:']
for kwargs in failed_kwargs:
sorted_keys = sorted([x for x in sorted(kwargs) if x not in ('Reader', 'Outputter')])
reader_repr = repr(kwargs.get('Reader', basic.Basic))
keys_vals = ['Reader:' + re.search(r"\.(\w+)'>", reader_repr).group(1)]
kwargs_sorted = ((key, kwargs[key]) for key in sorted_keys)
keys_vals.extend(['%s: %s' % (key, repr(val)) for key, val in kwargs_sorted])
lines.append(' '.join(keys_vals))
lines.append('ERROR: Unable to guess table for with the guesses listed above.')
lines.append('Check the table and try with guess=False and appropriate arguments to read()')
raise core.InconsistentTableError('\n'.join(lines))
def _get_guess_kwargs_list():
guess_kwargs_list = [dict(Reader=basic.Rdb),
dict(Reader=basic.Tab),
dict(Reader=cds.Cds),
dict(Reader=daophot.Daophot),
dict(Reader=sextractor.SExtractor),
dict(Reader=ipac.Ipac),
dict(Reader=latex.Latex),
dict(Reader=latex.AASTex)
]
for Reader in (basic.CommentedHeader, basic.Basic, basic.NoHeader):
for delimiter in ("|", ",", " ", "\s"):
for quotechar in ('"', "'"):
guess_kwargs_list.append(dict(
Reader=Reader, delimiter=delimiter, quotechar=quotechar))
return guess_kwargs_list
extra_writer_pars = ('delimiter', 'comment', 'quotechar', 'formats',
'names', 'include_names', 'exclude_names', 'strip_whitespace')
[docs]def get_writer(Writer=None, **kwargs):
"""Initialize a table writer allowing for common customizations. Most of the
default behavior for various parameters is determined by the Writer class.
:param Writer: Writer class (default=``ascii.Basic``)
:param delimiter: column delimiter string
:param write_comment: string defining a comment line in table
:param quotechar: one-character string to quote fields containing special characters
:param formats: dict of format specifiers or formatting functions
:param strip_whitespace: strip surrounding whitespace from column values (default=True)
:param names: list of names corresponding to each data column
:param include_names: list of names to include in output (default=None selects all names)
:param exclude_names: list of names to exlude from output (applied after ``include_names``)
"""
if Writer is None:
Writer = basic.Basic
if 'strip_whitespace' not in kwargs:
kwargs['strip_whitespace'] = True
writer = core._get_writer(Writer, **kwargs)
return writer
[docs]def write(table, output=sys.stdout, Writer=None, **kwargs):
"""Write the input ``table`` to ``filename``. Most of the default behavior
for various parameters is determined by the Writer class.
:param table: input table (Reader object, NumPy struct array, list of lists, etc)
:param output: output [filename, file-like object] (default = sys.stdout)
:param Writer: Writer class (default=``ascii.Basic``)
:param delimiter: column delimiter string
:param write_comment: string defining a comment line in table
:param quotechar: one-character string to quote fields containing special characters
:param formats: dict of format specifiers or formatting functions
:param strip_whitespace: strip surrounding whitespace from column values (default=True)
:param names: list of names corresponding to each data column
:param include_names: list of names to include in output (default=None selects all names)
:param exclude_names: list of names to exlude from output (applied after ``include_names``)
"""
table = Table(table, names=kwargs.get('names'))
names = set(table.colnames)
if 'include_names' in kwargs:
names.intersection_update(kwargs['include_names'])
if 'exclude_names' in kwargs:
names.difference_update(kwargs['exclude_names'])
if names != set(table.colnames):
remove_names = set(table.colnames) - set(names)
table.remove_columns(remove_names)
table.cols = table.columns.values()
writer = get_writer(Writer=Writer, **kwargs)
lines = writer.write(table)
# Write the lines to output
outstr = os.linesep.join(lines)
if not hasattr(output, 'write'):
output = open(output, 'w')
output.write(outstr)
output.write(os.linesep)
output.close()
else:
output.write(outstr)
output.write(os.linesep)


Steve Clarke: The best is still to come from John McGinn
Steve Clarke reckons the best is yet to come from Villa midfielder John McGinn after watching him extend his incredible international scoring streak for Scotland.
by David BannerMcGinn struck twice either side of a Steven Naismith header to ensure Scotland brought the curtain down on their Euro 2020 qualifying campaign with a 3-1 win over Kazakhstan.
The 25-year-old now has seven goals in his last six appearances for the Scots – but boss Clarke believes he can yet mature into an even better player.
Ex-Albion boss Clarke said: “John is on a fantastic run of form. He has been great for Aston Villa for the last couple of seasons and he is starting to bring it onto the international stage.
“It’s very important to remember he is still in the early stages of his international career.
“The more games you play at this level, the better you become, the more experience you get and the better the team will become.
“When you’ve got any player in goalscoring form that’s good for any team.
“John is the man scoring the goals now and hopefully we’ll get one or two more that can to that as well.
“We’ve found a good position for John.
“He’s playing it very well, him and Steven Naismith are developing a decent understanding and as well as the goals they give us a good early press and the desire to meet the opposition high up the pitch which helps us as well.”


Contributed by Tom Christiansen
Here's a sed script I use to extract a termcap entry. It works for any termcap-like file, such as disktab. For example:
$gent vt100
extracts the vt100 entry from termcap, while:
$gent eagle /etc/disktab
gets the eagle entry from disktab. Now I know it could have been done in C or Perl, but I did it a long time ago. It's also interesting because of the way it passes options into the sed script. I know, I know: it should have been written in sh not csh, too.
#!/bin/csh -f set argc = $#argv set noglob set dollar = '$' set squeeze = 0 set noback="" nospace="" rescan: if ( $argc > 0 && $argc < 3 ) then if ( "$1" =~ -* ) then if ( "-squeeze" =~ $1* ) then set noback='s/\\//g' nospace='s/^[ ]*//' set squeeze = 1 shift @ argc -- goto rescan else echo "Bad switch: $1" goto usage endif endif set entry = "$1" if ( $argc == 1 ) then set file = /etc/termcap else set file = "$2" endif else usage: echo "usage: `basename $0` [-squeeze] entry [termcapfile]" exit 1 endif sed -n -e \ "/^${entry}[|:]/ {\ :x\ /\\${dollar}/ {\ ${noback}\ ${nospace}\ p\ n\ bx\ }\ ${nospace}\ p\ n\ /^ / {\ bx\ }\ }\ /^[^ ]*|${entry}[|:]/ {\ :y\ /\\${dollar}/ {\ ${noback}\ ${nospace}\ p\ n\ by\ }\ ${nospace}\ p\ n\ /^ / {\ by\ }\ }" < $file
Once you get used to reading awk scripts, they seem so much easier to understand than all but the simplest sed script. It can be a painstaking task to figure out what a small sed script like the one shown here is doing.
This script does show how to pass shell variables into a sed script. Variables are used to pass optional sed commands into the script, such as the substitution commands that replace backslashes and spaces.
This script could be simplified in several ways. First of all, the two regular expressions don't seem necessary to match the entry. The first matches the name of the entry at the beginning of a line; the second matches it elsewhere on the line. The loops labeled x and y are identical and even if the two regular expressions were necessary, we could have them branch to the same loop.


Press
←
to turn left
Press
→
to turn right
Press
↓
to turn down
Press
↑
to turn up
Press
Space
to turn on
Nitro


Here's what I do...
I enjoy using ABA to help individuals with developmental disabilities reach their full potential.
I can be reached through phone or email. LinkedIn


--- title: Intro to Bayesian Decision Theory author: de Cat date: '2020-11-15' slug: intro-to-bayesian-decision-theory categories: - statistics tags: - Bayesian bibliography: refs.bib draft: true ---
As the pilot of my new blog site, I would like to touch on Bayesian decision theory, which can be found in many statistical inference textbooks, such as Shao (2003).
Under the framework of decision theory, we define \(X \in \mathcal{X}\) as observed random variables (or data), \(\theta \in \Theta\) as state of nature (or parameter of the data generator), and \(a \in \mathcal{A}\) as action to be taken.
A decision rule \(T: \mathcal{X} \mapsto \mathcal{A}\) is a function that takes action \(a = T(X)\) upon observing \(X\). To evaluate an action, we define loss function \(L: (\Theta \times \mathcal{A}) \mapsto \mathbb{R}\). Naturally, a risk function is used to evaluate decision rules: \[R(\theta, T) = \operatorname{E}\left[L\left(\theta, T(X)\right)\, \Big\vert\, \theta\right]\]
Shao, Jun. 2003. Mathematical Statistics. 2nd ed. Springer Texts in Statistics. New York: Springer.


Use the logo whenever possible to represent Storj.
Use in areas where the logo would look too small.
Blue is the main color. If an accent color is needed, use gold.
Blue
#107FC9
Dark Blue
#003366
Gold
#FFDD00
White
#FFFFFF
Don’t hesitate to join our Slack,
check our open-source code at GitHub,
take a peek at our 60 second video,
send us an email, read the Storj blog
and follow or connect with us.


Note, this will reset your selected theme, remember me preference, zoom preference etc.
This information is useful for reporting issues with app


Me and a friend (I'll call him Flute from here) were hanging around in our little town in Sweden and doing nothing. The sun was shining and the summer were getting closer, and the urge of just sitting in a park and drink beer under the sun were getting stronger and stronger. It had been a long cold winter and I couldn't wait for the warm inviting summer.
After we had been to 'systembolaget' (the place were they sell alcohol in sweden) we met some older friends. I didn't know them well back then and still I was a little sceptical of being around them at that time of the day. They were those kind of people that doesn't have the best reputation often called alcoholics.
Well, after all we went home to one of them and drank a few beers. Both me and Flute knowed that one of them were a strong abuser of Iktorivil, Diazepam and Flunitrazepam. So we asked if he had some that he could sell. After awhile we get about ten pills. I started with one to see what would happen. I didn't know much about benzodiazepines at that time, still I had read some about them, and I really thought they would be something for me.
At first I felt a bit disorientated, some kind of anguish were crawling under my skin almost as I feel when I have smoked alot of pot. But I guess this was just because of the fact that I was sitting with two alcoholics in the middle of the week and eating pills. I guess I couldn't take that.
(T+30 min)
About half an hour later when I was in the bathroom I found myself very relaxed. I took one more pill and chewed it carefully. The taste was incredible discusting. But after a few glups of beer it was gone.
(T+90 min)
At this time I felt very comfortable, the only side-effect so far was the strong lazyness in my limbs and muscles. But at this time I wanted to go out from his apartment, and so we did.
 Just to walk felt like a life-task if you know what I mean. I felt like a marionette on my own without the ropes. I fell everywere. Still this felt quite funny. There was nothing in the world that could have scared me at that moment. I was the strongest man alive. I didn't really cared about anything. Nothing felt important, still everything felt funny in some kind of way. The total freedom from anguish and fear was the highlight of the whole experience. And I'm a very neurotic, paranoid person normaly.
(T+190-220 min ??)
Me and Flute were taking of from our older friends and headed for a party with our regular friends. At this time we had bought a bottle of Vodka that we had finished.  Well, at this moment my relation with time ended and there are alot of gaps in my memory, but I'll do the best I can to get a picture of what happened next.
Well, we came to the party, now I know that it was a bad idea to go there. Well, that's not the case anyway. When I got in people were looking at me and laughing. Some in a 'What the hell is he doing' way and some in a 'Oh my God, he's totaly wasted' way.
And they were so right. But at that time I couldn't understand it, I couldn't understand anything eccept that I wanted more beer and that I wanted to sit down and smoke a cigarette. I don't know but I think I swallowed one more pill at this time.
I sat down in a couch and relaxed. I guess I relaxed a little to much. I tried to place the beer on the table but missed it with about one meter. Everything were sooo sloow in my head. I could hear people talking about me and with me, but I couldn't care about them. I just wanted to smoke my cigarette. When I stub out the cigarette I missed the ashtray and did it on a walkman instead. People were screaming to me that I was doing something wrong. And yes, they were right. So instead I did it right on the table.
After that I started to dream with my eyes open, not those kind of dreams that are full of emotions and happenings. Just thoughtless, empty dreams. I couldn't tell reality from dream, and to be honest I didn't cared. My conclusion is that Iktorivil is a very strong and truly sedating benzo.
After this experience I have tried some other Benzodiazepies like Diazepam, Flunitrazepam and Xanax. But my favorite is still Iktorivil. It's really the kind of stuff that helps me get away from the anguish. Still I think it's a cheap shortcut that can mess up things for you if you do it to often. And now I don't use it at all. Not more than an ordinary psychonaut would do LSD.
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.


What is version control?
Source: atlassian
Benefits of version control
Version control systems are a category of software tools that help a software team manage changes to source code over time. Version control software keeps track of every modification to the code in a special kind of database. If a mistake is made, developers can turn back the clock and compare earlier versions of the code to help fix the mistake while minimizing disruption to all team members.
For almost all software projects, the source code is like the crown jewels - a precious asset whose value must be protected. For most software teams, the source code is a repository of the invaluable knowledge and understanding about the problem domain that the developers have collected and refined through careful effort. Version control protects source code from both catastrophe and the casual degradation of human error and unintended consequences.
Software developers working in teams are continually writing new source code and changing existing source code. The code for a project, app or software component is typically organized in a folder structure or “file tree”. One developer on the team may be working on a new feature while another developer fixes an unrelated bug by changing code, each developer may make their changes in several parts of the file tree.
Version control helps teams solve these kinds of problems, tracking every individual change by each contributor and helping prevent concurrent work from conflicting. Changes made in one part of the software can be incompatible with those made by another developer working at the same time. This problem should be discovered and solved in an orderly manner without blocking the work of the rest of the team. Further, in all software development, any change can introduce new bugs on its own and new software can’t be trusted until it’s tested. So testing and development proceed together until a new version is ready.
Good version control software supports a developer’s preferred workflow without imposing one particular way of working. Ideally it also works on any platform, rather than dictate what operating system or tool chain developers must use. Great version control systems facilitate a smooth and continuous flow of changes to the code rather than the frustrating and clumsy mechanism of file locking - giving the green light to one developer at the expense of blocking the progress of others.
Software teams that do not use any form of version control often run into problems like not knowing which changes that have been made are available to users or the creation of incompatible changes between two unrelated pieces of work that must then be painstakingly untangled and reworked. If you’re a developer who has never used version control you may have added versions to your files, perhaps with suffixes like “final” or “latest” and then had to later deal with a new final version. Perhaps you’ve commented out code blocks because you want to disable certain functionality without deleting the code, fearing that there may be a use for it later. Version control is a way out of these problems.
Version control software is an essential part of the every-day of the modern software team’s professional practices. Individual software developers who are accustomed to working with a capable version control system in their teams typically recognize the incredible value version control also gives them even on small solo projects. Once accustomed to the powerful benefits of version control systems, many developers wouldn’t consider working without it even for non-software projects.
Benefits of version control systems
Developing software without using version control is risky, like not having backups. Version control can also enable developers to move faster and it allows software teams to preserve efficiency and agility as the team scales to include more developers.
Version Control Systems (VCS) have seen great improvements over the past few decades and some are better than others. VCS are sometimes known as SCM (Source Code Management) tools or RCS (Revision Control System). One of the most popular VCS tools in use today is called Git. Git is a Distributed VCS, a category known as DVCS, more on that later. Like many of the most popular VCS systems available today, Git is free and open source. Regardless of what they are called, or which system is used, the primary benefits you should expect from version control are as follows.
-
A complete long-term change history of every file. This means every change made by many individuals over the years. Changes include the creation and deletion of files as well as edits to their contents. Different VCS tools differ on how well they handle renaming and moving of files. This history should also include the author, date and written notes on the purpose of each change. Having the complete history enables going back to previous versions to help in root cause analysis for bugs and it is crucial when needing to fix problems in older versions of software. If the software is being actively worked on, almost everything can be considered an “older version” of the software.
-
Branching and merging. Having team members work concurrently is a no-brainer, but even individuals working on their own can benefit from the ability to work on independent streams of changes. Creating a “branch” in VCS tools keeps multiple streams of work independent from each other while also providing the facility to merge that work back together, enabling developers to verify that the changes on each branch do not conflict. Many software teams adopt a practice of branching for each feature or perhaps branching for each release, or both. There are many different workflows that teams can choose from when they decide how to make use of branching and merging facilities in VCS.
-
Traceability. Being able to trace each change made to the software and connect it to project management and bug tracking software such as Jira, and being able to annotate each change with a message describing the purpose and intent of the change can help not only with root cause analysis and other forensics. Having the annotated history of the code at your fingertips when you are reading the code, trying to understand what it is doing and why it is so designed can enable developers to make correct and harmonious changes that are in accord with the intended long-term design of the system. This can be especially important for working effectively with legacy code and is crucial in enabling developers to estimate future work with any accuracy.
While it is possible to develop software without using any version control, doing so subjects the project to a huge risk that no professional team would be advised to accept. So the question is not whether to use version control but which version control system to use.
There are many choices, but here we are going to focus on just one, Git.


|
libcex
1.0.0
Modern C++11 embedded webserver library
|
Core class of the embedded webserver. Manages a single HTTP/HTTPS listener and performs routing as defined by the installed middlewares. More...
#include <core.hpp>
Classes | |
| struct | Config |
| Structure transporting all configuration options of the embedded server. Note that certain middlewares have additional config structs (e. g. cex::filesystem ) More... | |
| struct | Context |
| Internal helper struct for handling libevhtp callback functions. More... | |
Public Member Functions | |
| Server () | |
| Constructs a new server with the default config. | |
| Server (Config &config) | |
| Constructs a new server with the given config. More... | |
| int | listen (bool block=true) |
| Starts the server with listener on address and port specified in the server Config struct. More... | |
| int | listen (std::string address, int port, bool block=true) |
| Starts the server with listener on the given address and port. More... | |
| int | stop () |
| Stops the listener. If it was started within a background thread, the background thread is terminated. | |
| void | reset () |
| Removes all attached middlewares. | |
| void | use (MiddlewareFunction func) |
| Attaches a middleware function with no conditions. More... | |
| void | use (const char *path, MiddlewareFunction func, int flags=Middleware::fMatchContain) |
| Attaches a middleware function with no HTTP method specification and with the given path. More... | |
| void | get (MiddlewareFunction func) |
| Attaches a middleware function for HTTP GET requests. More... | |
| void | get (const char *path, MiddlewareFunction func, int flags=Middleware::fMatchContain) |
| Attaches a middleware function for the HTTP GET method and the given path. More... | |
| void | put (MiddlewareFunction func) |
| Attaches a middleware function for HTTP PUT requests. More... | |
| void | put (const char *path, MiddlewareFunction func, int flags=Middleware::fMatchContain) |
| Attaches a middleware function for the HTTP PUT method and the given path. More... | |
| void | post (MiddlewareFunction func) |
| Attaches a middleware function for HTTP POST requests. More... | |
| void | post (const char *path, MiddlewareFunction func, int flags=Middleware::fMatchContain) |
| Attaches a middleware function for the HTTP POST method and the given path. More... | |
| void | head (MiddlewareFunction func) |
| Attaches a middleware function for HTTP HEAD requests. More... | |
| void | head (const char *path, MiddlewareFunction func, int flags=Middleware::fMatchContain) |
| Attaches a middleware function for the HTTP HEAD method and the given path. More... | |
| void | del (MiddlewareFunction func) |
| Attaches a middleware function for HTTP DEL requests. More... | |
| void | del (const char *path, MiddlewareFunction func, int flags=Middleware::fMatchContain) |
| Attaches a middleware function for the HTTP DEL method and the given path. More... | |
| void | connect (MiddlewareFunction func) |
| Attaches a middleware function for HTTP CONNECT requests. More... | |
| void | connect (const char *path, MiddlewareFunction func, int flags=Middleware::fMatchContain) |
| Attaches a middleware function for the HTTP CONNECT method and the given path. More... | |
| void | options (MiddlewareFunction func) |
| Attaches a middleware function for HTTP OPTIONS requests. More... | |
| void | options (const char *path, MiddlewareFunction func, int flags=Middleware::fMatchContain) |
| Attaches a middleware function for the HTTP OPTIONS method and the given path. More... | |
| void | trace (MiddlewareFunction func) |
| Attaches a middleware function for HTTP TRACE requests. More... | |
| void | trace (const char *path, MiddlewareFunction func, int flags=Middleware::fMatchContain) |
| Attaches a middleware function for the HTTP TRACE method and the given path. More... | |
| void | patch (MiddlewareFunction func) |
| Attaches a middleware function for HTTP PATCH requests. More... | |
| void | patch (const char *path, MiddlewareFunction func, int flags=Middleware::fMatchContain) |
| Attaches a middleware function for the HTTP PATCH method and the given path. More... | |
| void | mkcol (MiddlewareFunction func) |
| Attaches a middleware function for WEBDAV MKCOL requests. More... | |
| void | mkcol (const char *path, MiddlewareFunction func, int flags=Middleware::fMatchContain) |
| Attaches a middleware function for the WEBDAV MKCOL method and the given path. More... | |
| void | copy (MiddlewareFunction func) |
| Attaches a middleware function for WEBDAV COPY requests. More... | |
| void | copy (const char *path, MiddlewareFunction func, int flags=Middleware::fMatchContain) |
| Attaches a middleware function for the WEBDAV COPY method and the given path. More... | |
| void | move (MiddlewareFunction func) |
| Attaches a middleware function for WEBDAV MOVE requests. More... | |
| void | move (const char *path, MiddlewareFunction func, int flags=Middleware::fMatchContain) |
| Attaches a middleware function for the WEBDAV MOVE method and the given path. More... | |
| void | propfind (MiddlewareFunction func) |
| Attaches a middleware function for HTTP WEBDAV PROPFIND requests. More... | |
| void | propfind (const char *path, MiddlewareFunction func, int flags=Middleware::fMatchContain) |
| Attaches a middleware function for the WEBDAV PROPFIND method and the given path. More... | |
| void | proppatch (MiddlewareFunction func) |
| Attaches a middleware function for WEBDAV PROPPATCH requests. More... | |
| void | proppatch (const char *path, MiddlewareFunction func, int flags=Middleware::fMatchContain) |
| Attaches a middleware function for the WEBDAV PROPPATCH method and the given path. More... | |
| void | lock (MiddlewareFunction func) |
| Attaches a middleware function for WEBDAV LOCK requests. More... | |
| void | lock (const char *path, MiddlewareFunction func, int flags=Middleware::fMatchContain) |
| Attaches a middleware function for the WEBDAV LOCK method and the given path. More... | |
| void | unlock (MiddlewareFunction func) |
| Attaches a middleware function for WEBDAV UNLOCK requests. More... | |
| void | unlock (const char *path, MiddlewareFunction func, int flags=Middleware::fMatchContain) |
| Attaches a middleware function for the WEBDAV UNLOCK method and the given path. More... | |
| void | uploads (UploadFunction func) |
| Attaches a special middleware function which receives request body data uploads in chunks. More... | |
| void | uploads (const char *path, UploadFunction func, Method method=methodPOST, int flags=Middleware::fMatchContain) |
| Attaches an upload middleware function for the given HTTP method and URL path. More... | |
Static Public Member Functions | |
| static MimeTypes * | getMimeTypes () |
| static void | registerMimeType (const char *ext, const char *mime, bool binary) |
| static void | libraryInit () |
Core class of the embedded webserver. Manages a single HTTP/HTTPS listener and performs routing as defined by the installed middlewares.
| cex::Server::Server | ( | Config & | config | ) |
Constructs a new server with the given config.
| config | The Config object which defines the server options/configuration |
| void cex::Server::connect | ( | MiddlewareFunction | func | ) |
Attaches a middleware function for HTTP CONNECT requests.
The function will be called for every request.
| func | The middleware function which shall be called |
| void cex::Server::connect | ( | const char * | path, |
| MiddlewareFunction | func, | ||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches a middleware function for the HTTP CONNECT method and the given path.
The function will be called when the URL of incoming requests match the path, regardless of HTTP method.
| path | The URL path which shall be compared against the request URL |
| func | The middleware function which shall be called |
| flags | Flags controlling the URL matching behaviour (see Middleware) |
| void cex::Server::copy | ( | MiddlewareFunction | func | ) |
Attaches a middleware function for WEBDAV COPY requests.
The function will be called for every request.
| func | The middleware function which shall be called |
| void cex::Server::copy | ( | const char * | path, |
| MiddlewareFunction | func, | ||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches a middleware function for the WEBDAV COPY method and the given path.
The function will be called when the URL of incoming requests match the path, regardless of HTTP method.
| path | The URL path which shall be compared against the request URL |
| func | The middleware function which shall be called |
| flags | Flags controlling the URL matching behaviour (see Middleware) |
| void cex::Server::del | ( | MiddlewareFunction | func | ) |
Attaches a middleware function for HTTP DEL requests.
The function will be called for every request.
| func | The middleware function which shall be called |
| void cex::Server::del | ( | const char * | path, |
| MiddlewareFunction | func, | ||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches a middleware function for the HTTP DEL method and the given path.
The function will be called when the URL of incoming requests match the path, regardless of HTTP method.
| path | The URL path which shall be compared against the request URL |
| func | The middleware function which shall be called |
| flags | Flags controlling the URL matching behaviour (see Middleware) |
| void cex::Server::get | ( | MiddlewareFunction | func | ) |
Attaches a middleware function for HTTP GET requests.
The function will be called for every request.
| func | The middleware function which shall be called |
| void cex::Server::get | ( | const char * | path, |
| MiddlewareFunction | func, | ||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches a middleware function for the HTTP GET method and the given path.
The function will be called when the URL of incoming requests match the path, regardless of HTTP method.
| path | The URL path which shall be compared against the request URL |
| func | The middleware function which shall be called |
| flags | Flags controlling the URL matching behaviour (see Middleware) |
| void cex::Server::head | ( | MiddlewareFunction | func | ) |
Attaches a middleware function for HTTP HEAD requests.
The function will be called for every request.
| func | The middleware function which shall be called |
| void cex::Server::head | ( | const char * | path, |
| MiddlewareFunction | func, | ||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches a middleware function for the HTTP HEAD method and the given path.
The function will be called when the URL of incoming requests match the path, regardless of HTTP method.
| path | The URL path which shall be compared against the request URL |
| func | The middleware function which shall be called |
| flags | Flags controlling the URL matching behaviour (see Middleware) |
| int cex::Server::listen | ( | bool | block = true | ) |
Starts the server with listener on address and port specified in the server Config struct.
| block | If set to true , runs the listener/eventloop in the calling thread, thus blocking the caller. If set to false , spawns a new thread which runs the listener/eventloop, and returns immediately. |
| int cex::Server::listen | ( | std::string | address, |
| int | port, | ||
| bool | block = true |
||
| ) |
Starts the server with listener on the given address and port.
| address | The address to start the listener on (e.g. localhost or <IP_ADDRESS> ) |
| port | The port to start the listener on |
| block | If set to true , runs the listener/eventloop in the calling thread, thus blocking the caller. If set to false , spawns a new thread which runs the listener/eventloop, and returns immediately. |
| void cex::Server::lock | ( | MiddlewareFunction | func | ) |
Attaches a middleware function for WEBDAV LOCK requests.
The function will be called for every request.
| func | The middleware function which shall be called |
| void cex::Server::lock | ( | const char * | path, |
| MiddlewareFunction | func, | ||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches a middleware function for the WEBDAV LOCK method and the given path.
The function will be called when the URL of incoming requests match the path, regardless of HTTP method.
| path | The URL path which shall be compared against the request URL |
| func | The middleware function which shall be called |
| flags | Flags controlling the URL matching behaviour (see Middleware) |
| void cex::Server::mkcol | ( | MiddlewareFunction | func | ) |
Attaches a middleware function for WEBDAV MKCOL requests.
The function will be called for every request.
| func | The middleware function which shall be called |
| void cex::Server::mkcol | ( | const char * | path, |
| MiddlewareFunction | func, | ||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches a middleware function for the WEBDAV MKCOL method and the given path.
The function will be called when the URL of incoming requests match the path, regardless of HTTP method.
| path | The URL path which shall be compared against the request URL |
| func | The middleware function which shall be called |
| flags | Flags controlling the URL matching behaviour (see Middleware) |
| void cex::Server::move | ( | MiddlewareFunction | func | ) |
Attaches a middleware function for WEBDAV MOVE requests.
The function will be called for every request.
| func | The middleware function which shall be called |
| void cex::Server::move | ( | const char * | path, |
| MiddlewareFunction | func, | ||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches a middleware function for the WEBDAV MOVE method and the given path.
The function will be called when the URL of incoming requests match the path, regardless of HTTP method.
| path | The URL path which shall be compared against the request URL |
| func | The middleware function which shall be called |
| flags | Flags controlling the URL matching behaviour (see Middleware) |
| void cex::Server::options | ( | MiddlewareFunction | func | ) |
Attaches a middleware function for HTTP OPTIONS requests.
The function will be called for every request.
| func | The middleware function which shall be called |
| void cex::Server::options | ( | const char * | path, |
| MiddlewareFunction | func, | ||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches a middleware function for the HTTP OPTIONS method and the given path.
The function will be called when the URL of incoming requests match the path, regardless of HTTP method.
| path | The URL path which shall be compared against the request URL |
| func | The middleware function which shall be called |
| flags | Flags controlling the URL matching behaviour (see Middleware) |
| void cex::Server::patch | ( | MiddlewareFunction | func | ) |
Attaches a middleware function for HTTP PATCH requests.
The function will be called for every request.
| func | The middleware function which shall be called |
| void cex::Server::patch | ( | const char * | path, |
| MiddlewareFunction | func, | ||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches a middleware function for the HTTP PATCH method and the given path.
The function will be called when the URL of incoming requests match the path, regardless of HTTP method.
| path | The URL path which shall be compared against the request URL |
| func | The middleware function which shall be called |
| flags | Flags controlling the URL matching behaviour (see Middleware) |
| void cex::Server::post | ( | MiddlewareFunction | func | ) |
Attaches a middleware function for HTTP POST requests.
The function will be called for every request.
| func | The middleware function which shall be called |
| void cex::Server::post | ( | const char * | path, |
| MiddlewareFunction | func, | ||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches a middleware function for the HTTP POST method and the given path.
The function will be called when the URL of incoming requests match the path, regardless of HTTP method.
| path | The URL path which shall be compared against the request URL |
| func | The middleware function which shall be called |
| flags | Flags controlling the URL matching behaviour (see Middleware) |
| void cex::Server::propfind | ( | MiddlewareFunction | func | ) |
Attaches a middleware function for HTTP WEBDAV PROPFIND requests.
The function will be called for every request.
| func | The middleware function which shall be called |
| void cex::Server::propfind | ( | const char * | path, |
| MiddlewareFunction | func, | ||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches a middleware function for the WEBDAV PROPFIND method and the given path.
The function will be called when the URL of incoming requests match the path, regardless of HTTP method.
| path | The URL path which shall be compared against the request URL |
| func | The middleware function which shall be called |
| flags | Flags controlling the URL matching behaviour (see Middleware) |
| void cex::Server::proppatch | ( | MiddlewareFunction | func | ) |
Attaches a middleware function for WEBDAV PROPPATCH requests.
The function will be called for every request.
| func | The middleware function which shall be called |
| void cex::Server::proppatch | ( | const char * | path, |
| MiddlewareFunction | func, | ||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches a middleware function for the WEBDAV PROPPATCH method and the given path.
The function will be called when the URL of incoming requests match the path, regardless of HTTP method.
| path | The URL path which shall be compared against the request URL |
| func | The middleware function which shall be called |
| flags | Flags controlling the URL matching behaviour (see Middleware) |
| void cex::Server::put | ( | MiddlewareFunction | func | ) |
Attaches a middleware function for HTTP PUT requests.
The function will be called for every request.
| func | The middleware function which shall be called |
| void cex::Server::put | ( | const char * | path, |
| MiddlewareFunction | func, | ||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches a middleware function for the HTTP PUT method and the given path.
The function will be called when the URL of incoming requests match the path, regardless of HTTP method.
| path | The URL path which shall be compared against the request URL |
| func | The middleware function which shall be called |
| flags | Flags controlling the URL matching behaviour (see Middleware) |
| void cex::Server::trace | ( | MiddlewareFunction | func | ) |
Attaches a middleware function for HTTP TRACE requests.
The function will be called for every request.
| func | The middleware function which shall be called |
| void cex::Server::trace | ( | const char * | path, |
| MiddlewareFunction | func, | ||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches a middleware function for the HTTP TRACE method and the given path.
The function will be called when the URL of incoming requests match the path, regardless of HTTP method.
| path | The URL path which shall be compared against the request URL |
| func | The middleware function which shall be called |
| flags | Flags controlling the URL matching behaviour (see Middleware) |
| void cex::Server::unlock | ( | MiddlewareFunction | func | ) |
Attaches a middleware function for WEBDAV UNLOCK requests.
The function will be called for every request.
| func | The middleware function which shall be called |
| void cex::Server::unlock | ( | const char * | path, |
| MiddlewareFunction | func, | ||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches a middleware function for the WEBDAV UNLOCK method and the given path.
The function will be called when the URL of incoming requests match the path, regardless of HTTP method.
| path | The URL path which shall be compared against the request URL |
| func | The middleware function which shall be called |
| flags | Flags controlling the URL matching behaviour (see Middleware) |
| void cex::Server::uploads | ( | UploadFunction | func | ) |
Attaches a special middleware function which receives request body data uploads in chunks.
The provided UploadFunction will be called repeatedly until the whole request body data is received. Processing will not continue to any subsequent middlewares until the upload is completed.
| func | The UploadFunction which shall be called upon receiving request body data |
| void cex::Server::uploads | ( | const char * | path, |
| UploadFunction | func, | ||
| Method | method = methodPOST , |
||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches an upload middleware function for the given HTTP method and URL path.
The provided UploadFunction will be called repeatedly for matching requests until the whole request body data is received. Processing will not continue to any subsequent middlewares until the upload is completed.
| path | The URL path which shall be compared against the request URL |
| func | The UploadFunction which shall be called upon receiving request body data |
| flags | Flags controlling the URL matching behaviour (see Middleware) |
| void cex::Server::use | ( | MiddlewareFunction | func | ) |
Attaches a middleware function with no conditions.
The function will be called for every request.
| func | The middleware function which shall be called |
| void cex::Server::use | ( | const char * | path, |
| MiddlewareFunction | func, | ||
| int | flags = Middleware::fMatchContain |
||
| ) |
Attaches a middleware function with no HTTP method specification and with the given path.
The function will be called when the URL of incoming requests match the path, regardless of HTTP method.
| path | The URL path which shall be compared against the request URL |
| func | The middleware function which shall be called |
| flags | Flags controlling the URL matching behaviour (see Middleware) |


--- layout: main title: Translation | What is Transhumanism? description: The Transhumanist FAQ has a number of official translations, this page tracks them and has instructions on how to translate. ---
These translations need to be updated:
{{ need_update }} {% else %}All translations are up to date.
{% endif %}We want this website to be available in as many languages as possible. For this to happen, we need your help. Helping out with translation of the content (or just parts of it) is nothing more remarkable than reading it in English and writing it in your language.
The code and content is organized in a repository on GitHub. If that confuses you, do not worry, we will be able to walk you through the translation work even if you know nothing about building websites. If you know your way around code, you should be able to just start reading the instructions below.
On the other hand, if you do not want to be near the ins and outs of the website, just send an email or post a message in our discussion group. Let us know what language you want to translate to and we will help you out. It may turn out others have already posted their interest in the same language, then you can work in a team and get it done much faster.
On the top of this page there will be a list of translations that need updating, and a link to a diff showing what has changed since that language was last updated. With this information, you can make the necessary changes in the translation:
As soon as your updated translation makes it to the live site, the “update needed” notice on the top of this page will go away.


Fyrestone is a content mod for the popular game Minecraft. It's written using the community-run Forge Modding API, entirely in Java.
It doesn't always follow best Java practices, due to the requirements of the Modding API, but I'm quite proud of how extensible its systems are.
Pxls is an online collaborative art project, inspired by Reddit's 2017 April Fools event; /r/place.
It was written in collaboration with a friend, and is currently being maintained by various members of the community.
The backend is almost entirely Java, based on the Undertow Java Webserver, with some small parts of the code in Kotlin. The frontend is vanilla JavaScript.
Canvity is a WIP TypeScript framework based on the OBS (Object-Behaviour-Scene) architecture of Unity.
It can be used both for games and general apps, and is designed to act as a useful layer of abstraction between the programmer and the HTML5 canvas.


It took me a while but I made it! I've finally arrived at my true calling in life.
I had a girlfriend that once said she new exactly what she wanted to do when she was 15 years old. She's been pretty successful in her field for some time now and plans to retire before she's 50. Of course I wanted to do lots of things when I was young too, just like every other kid.
You'll notice my path to becoming a web developer doesn't include computers until later on. But the curiosity and drive to learn and build new things has always been there. I'm sure if I had the recources I would have learned to code earlier. But I wouldn't go back and change that now. I've had too many different kinds of experiences and opportunities that have made me the well rounded person I've become.
I spent the first 5 or so years of my life on an island. We had no heating, air, or even running water.  It wasn't till 3rd grade that I had my first experience with a computer. It was in the corner of our class and if we finished our work early we could play "Oregon Trail". Man I loved that game! But I loved finding out how things worked and making new things even more. In elementary school, I would spend my allowance on old electronics at yard sales just to take them apart to see how they worked.
I finally took an electronics class when I was about 11. We made circuit boards and all kinds of little gadgets. At the end, we built electric motors from scrap pieces of metal and wire. I won the award for having the most efficient motor. Around the same time I took a small engines class with all adults. I learned how to completely rebuild a lawnmower engine. I used this knowledge to fix old mowers and get money by clearing brush around the neighborhood. Naturally, when I started to drive, I was able to work on my own vehicle. I loved solving problems myself. I didn't mind if it meant getting my hands dirty while doing it. The greatest feeling was turning the key and having everything work...and realizing I saved a lot of money too!
Around the end of high school and the begining of college I had to start using computers to complete school assignments. It wasn't until my junior year of college that I finally bought my first computer. At this point in my life, I had already decided to follow a career in management. I mostly used my computer to store pictures, music, and edit videos of friends. It wasn't long before my computer would need repair. I destroyed the screen after driving away with it on top of my roof. I had fixed so many other small electronics and appliances that I didn't have to think twice about just buying a new screen and doing it myself. Eventually I would take it apart again to replace the fan, then the hard drive, and so on.
But anyone who's used a computer can tell you that you're much more likely to run into software related problems. By my senior year in college, friends were already calling me up to do the easiest things, like replacing doorknobs and doing oil changes. Suddenly people were now asking for help with their computers. I didn't really have any experience but I never turned down a challenge. I enjoy being the "go-to guy". Hitting restart after working on a computer and having everything work gave me that same feeling as turning the key to my car.I realized this was something I really enjoyed but also that I knew very little. While my ability to easily navigate a program or operating system was impressive to some, I knew the real fun was being able to create them.
I graduated college and pursued my career in management until the economy began to decline. I turned that into an opportunity to live and work overseas.
My desire to find out more about the software side of computers began to grow. I looked into creating an iPhone app but it required owning a Mac. So I put that on hold since I didn't have the money. Later, I looked into moving back home to go to school and get a CS degree at Cal Poly. I was denied because I already have a bachelors degree. I would have to spend at least a year doing prerequiste courses to even think about entering a masters program. I decided going back to school was still what I would need to do. But before I could even come up with a plan, I discovered Dev Bootcamp (DBC). Without doing any research I applied, I already knew this is what I wanted to do. At that point I had never even really seen a line of code. And even though I had recently bought a new PC, I went and got myself a Mac. I had commited to going in 100% and not looking back.
I graduated DBC in June 2015. It was a lot of work and probably the hardest thing I've done in my life. But I'm proud to have reached a level where I have enough knowledge to start working in my new career!


Reuters reported that the mainstream adoption of all types of digital assets would depend mainly on their ability to gain global regulation. As central governing bodies don’t control most digital assets, it is necessary to have a way of tracking transactions as they are conducted to curb any trafficking and terrorist financing efforts.


A fixed-height inline gallery
Config
Looping
Fixed height
Mixed slide widths
Outset pagination dots
Random, remote images from picsum (some images may fail to load)


Georgios Konstantopoulos
Blockchain Scalability and Security Researcher specialized in the Ethereum platform
Master of Engineering in Electrical & Computer Engineering
Aristotle University of Thessaloniki


mapname
changelist
datestamp
OS
CPU
GPU
Res Qual
View Dist Qual
AA Qual
Shadow Qual
PP Qual
Tex Qual
FX Qual
avg FPS
% over 30 FPS
% over 60 FPS
avg GPU time
Game Thread Bound By Percent
Render Thread Bound By Percent
GPU Bound By Percent
Game Thread Bound By Time
Render Thread Bound By Time
GPU Bound By Time
0 - 5
5 - 10
10 - 15
15 - 20
20 - 25
25 - 30
30 - 40
40 - 50
50 - 60
60 - 70
70 - 80
80 - 90
90 - 100
100 - 110
110 - 120
120 - INF
time
frame count
time disregarded
Total Hitches
Game Thread Bound Hitch Frames
Render Thread Bound Hitch Frames
GPU Bound Hitch Frames
5.0 - INF
2.5 - 5.0
2.0 - 2.5
1.5 - 2.0
1.0 - 1.5
0.75 - 1.0
0.5 - 0.75
0.3 - 0.5
0.2 - 0.3
0.15 - 0.2
0.1 - 0.15
0.06 - 0.1


Welcome to the home of ScribeJava, the simple OAuth client Java lib!
Why use ScribeJava?
Dead Simple
Who said OAuth/OAuth2 was difficult? Configuring ScribeJava is so easy your grandma can do it! check it out:
OAuthService service = new ServiceBuilder(YOUR_API_KEY)
.apiSecret(YOUR_API_SECRET)
.build(LinkedInApi20.instance());
That single line (added newlines for readability) is the only thing you need to configure ScribeJava with LinkedIn's OAuth API for example.
Working runnable examples are here
Threadsafe
Hit ScribeJava as hard and with many threads as you like.
Java 7 compatible
That's it. You can use it in old environments and in android apps.
Async and other HTTP clients
ScribeJava support out-of-box several HTTP clients:
- ning async http client 1.9.x (maven module scribejava-httpclient-ning)
- Async Http Client asynchttpclient 2.x (maven module scribejava-httpclient-ahc)
- OkHttp (maven module scribejava-httpclient-okhttp)
- Apache HttpComponents HttpClient (maven module scribejava-httpclient-apache)
just add corresponding maven modules to your pom
Supports all major 1.0a and 2.0 OAuth APIs out-of-the-box
- AWeber (http://www.aweber.com/)
- Box (https://www.box.com/)
- Dataporten (https://docs.dataporten.no/)
- Digg (http://digg.com/)
- Доктор на работе (https://www.doktornarabote.ru/)
- Etsy (https://www.etsy.com/)
- Facebook (https://www.facebook.com/)
- Flickr (https://www.flickr.com/)
- Foursquare (https://foursquare.com/)
- Frappe (https://github.com/frappe/frappe)
- Freelancer (https://www.freelancer.com/)
- Genius (http://genius.com/)
- GitHub (https://github.com/)
- Google (https://www.google.com/)
- HeadHunter ХэдХантер (https://hh.ru/)
- Imgur (http://imgur.com/)
- Kaixin 开心网 (http://www.kaixin001.com/)
- LinkedIn (https://www.linkedin.com/)
- Microsoft Azure Active Directory (Azure AD) (http://azure.microsoft.com/)
- Microsoft Live (https://login.live.com/)
- Mail.Ru (https://mail.ru/)
- Meetup (http://www.meetup.com/)
- NAVER (http://www.naver.com/)
- NetEase (http://www.163.com/)
- Odnoklassniki Одноклассники (http://ok.ru/)
- Pinterest (https://www.pinterest.com/)
- 500px (https://500px.com/)
- Renren (http://renren.com/)
- Salesforce (https://www.salesforce.com/)
- Sina (http://www.sina.com.cn/ http://weibo.com/login.php)
- Skyrock (http://skyrock.com/)
- sohu 搜狐 (http://www.sohu.com/)
- StackExchange (http://stackexchange.com/)
- The Things Network (v1-staging and v2-preview) (https://www.thethingsnetwork.org/)
- Trello (https://trello.com/)
- Tumblr (https://www.tumblr.com/)
- TUT.BY (http://www.tut.by/)
- Twitter (https://twitter.com/)
- uCoz (https://www.ucoz.com/)
- Viadeo (http://viadeo.com/)
- VK ВКонтакте (http://vk.com/)
- XING (https://www.xing.com/)
- Yahoo (https://www.yahoo.com/)
- Misfit (http://misfit.com/)
- check the examples folder
Small and modular
ScribeJava's code is small (about 1k LOC) and simple to understand. No smart-ass or "clever" hacks here. You can use only 'core' or 'with apis' maven modules
Android-Ready
Works out of the box with android(TM) applications.
Stable & bulletproof
Good test coverage to keep you safe from harm.
When something bad actually happens, ScribeJava's meaningful error messages will tell you exactly what went wrong, when and where.
Pull it from Maven Central!
You can pull ScribeJava from the central maven repository, just add these to your pom.xml file:
<dependency>
<groupId>com.github.scribejava</groupId>
<artifactId>scribejava-apis</artifactId>
<version>5.2.0-java7again</version>
</dependency>
And in case you need just core classes (that's it, without any external API (FB, VK, GitHub, Google etc) specific code), you could pull just 'core' artifact.
<dependency>
<groupId>com.github.scribejava</groupId>
<artifactId>scribejava-core</artifactId>
<version>5.2.0-java7again</version>
</dependency>
Getting started in less than 2 minutes
Check the Getting Started page and start rocking! Please Read the FAQ before creating an issue :)
Also, remember to read the fantastic tutorial that @akoskm wrote to easily integrate a server side app with an API (twitter in this case).
Questions?
Feel free to drop us an email or create issue right here on github.com
Forks
If you have a useful fork that should be listed there please contact us


data formats
You will find here the available modules for reading and converting between data formats like: json
, html
, etc…
handlebars
Mustache/Handlebars templates for Jooby. Exposes a Handlebars and renderer.
dependency
<dependency>
<groupId>org.jooby</groupId>
<artifactId>jooby-hbs</artifactId>
<version>{{version}}</version>
</dependency>
usage
It is pretty straightforward:
{
use(new Hbs());
get("/", req -> Results.html("index").put("model", new MyModel());
}
public/index.html:
{{ "{{ model " }}}}
Templates are loaded from root of classpath: /
and must end with: .html
file extension.
req locals
A template engine has access to request locals
(a.k.a attributes). Here is an example:
{
use(new Hbs());
get("*", req -> {
req.set("req", req);
req.set("session", req.session());
});
}
By default, there is no access to req
or session
from your template. This example shows how to do it.
helpers
Simple/basic helpers are add it at startup time:
{
use(new Hbs().doWith((hbs, config) -> {
hbs.registerHelper("myhelper", (ctx, options) -> {
return ...;
});
hbs.registerHelpers(Helpers.class);
});
}
Now, if the helper depends on a service and require injection:
{
use(new Hbs().with(Helpers.class));
}
The Helpers
will be injected by Guice and Handlebars will scan and discover any helper method.
template loader
Templates are loaded from the root of classpath and must end with .html
. You can
change the default template location and extensions too:
{
use(new Hbs("/", ".hbs"));
}
cache
Cache is OFF when env=dev
(useful for template reloading), otherwise is ON.
Cache is backed by Guava and the default cache will expire after 100
entries.
If 100
entries is not enough or you need a more advanced cache setting, just set the
hbs.cache
option:
hbs.cache = "expireAfterWrite=1h"
See CacheBuilderSpec for more detailed expressions.
That’s all folks! Enjoy it!!!
{{appendix}}
freemarker
Freemarker templates for Jooby. Exposes a Configuration and renderer.
dependency
<dependency>
<groupId>org.jooby</groupId>
<artifactId>jooby-ftl</artifactId>
<version>{{version}}</version>
</dependency>
usage
It is pretty straightforward:
{
use(new Ftl());
get("/", req -> Results.html("index").put("model", new MyModel());
}
public/index.html:
${model}
Templates are loaded from root of classpath: /
and must end with: .html
file extension.
req locals
A template engine has access to request locals
(a.k.a attributes). Here is an example:
{
use(new Ftl());
get("*", req -> {
req.set("req", req);
req.set("session", req.session());
});
}
By default, there is no access to req
or session
from your template. This example shows how to do it.
configuration
There are two ways of changing a Freemarker configuration:
application.conf
Just add a freemarker.*
option to your application.conf
file:
freemarker.default_encoding = UTF-8
programmatically
{
use(new Ftl().doWith((freemarker, config) -> {
freemarker.setDefaultEncoding("UTF-8");
});
}
Keep in mind this is just an example and you don’t need to set the default encoding. Default
encoding is set to: application.charset
which is UTF-8
by default.
template loader
Templates are loaded from the root of classpath and must end with .html
. You can
change the default template location and extensions too:
{
use(new Ftl("/", ".ftl"));
}
cache
Cache is OFF when env=dev
(useful for template reloading), otherwise is ON.
Cache is backed by Guava and default cache will expire after 100
entries.
If 100
entries is not enough or you need a more advanced cache setting, just set the
freemarker.cache
option:
freemarker.cache = "expireAfterWrite=1h"
See CacheBuilderSpec for more detailed expressions.
That’s all folks! Enjoy it!!!
{{appendix}}
jackson
JSON support from the excellent Jackson library.
This module provides a JSON body parser and formatter
but also an ObjectMapper.
dependency
<dependency>
<groupId>org.jooby</groupId>
<artifactId>jooby-jackson</artifactId>
<version>{{version}}</version>
</dependency>
usage
import org.jooby.json.Jackson;
{
use(new Jackson());
// sending
get("/my-api", req -> new MyObject());
// receiving a json body
post("/my-api", req -> {
MyObject obj = req.body(MyObject.class);
return obj;
});
}
advanced configuration
If you need a special setting or configuration for your ObjectMapper:
{
use(new Jackson().doWith(mapper -> {
// setup your custom object mapper
});
}
or provide an ObjectMapper instance:
{
ObjectMapper mapper = ....;
use(new Jackson(mapper));
}
It is possible to wire Jackson modules too:
{
use(new Jackson());
use((mode, config, binder) -> {
Multibinder.newSetBinder(binder, Module.class).addBinding().to(MyJacksonModuleWiredByGuice.class);
});
}
This is useful when your MyJacksonModuleWiredByGuice module require some dependencies.
That’s all folks! Enjoy it!!!
{{appendix}}
gson
JSON support via Gson library.
exposes
dependency
<dependency>
<groupId>org.jooby</groupId>
<artifactId>jooby-gson</artifactId>
<version>{{version}}</version>
</dependency>
usage
import org.jooby.json.Gzon;
{
use(new Gzon());
// sending
get("/my-api", req -> new MyObject());
// receiving a json body
post("/my-api", req -> {
MyObject obj = req.body(MyObject.class);
return obj;
});
// direct access to Gson
get("/access", req -> {
Gson gson = req.require(Gson.class);
// ...
});
}
configuration
If you need a special setting or configuration for your Gson:
{
use(new Gzon().doWith(builder -> {
builder.setPrettyPrint();
// ...
});
}


Add user & send email addr verification notification
Verify user's email addr, either by URL or SMS token
This link could be sent to user's email. Click it to verify the email: and/or this SMS code could be sent to user's phone. Click below to verify the email:
Send another email addr verification notification
The server console shows the notification sent.
Sign in and then create a message
The client checks that the user has been verified.


We need your help. We will show you 3 products at a time. Please select the one you would most likely buy.


A rule can have actions that change the request, headers, body or those of the response. All its actions are performed in the order as listed in the rule. A rule has a name and can be disabled. Rules are defined in XML. Rules are managed (crud) using the REST interface of the traffic service.
<rule id="my-rule"> enabled="true"> tracing="false"> <conditions> ... </conditions> <actions> ... </actions> </rule>
A rule can be disabled which means it will not be used by critter on an incoming request. Activity of a rule can be traced. If tracing is on then information about its use is logged.


In the step you can configure the databases of your XRP Ledger node and also configure periodic automatic (or manual) deletion of data.