What's New in LSDK 17.12
Highlights
・ Support for 2.5G PFE MAC [LS1012A]
・ MC upgrade to 10.4.0
・ Support for DPDK 17.05.02 as base and OVS 2.8
・ Support for sleep (LPM20) [LS1088A, LS2088A]
・ Integration of Open Portable Trusted Execution Environment (OP-TEE) [LS1046A]
・ Includes several software fixes. Refer to Fixed, Open, and Closed Issues which has a list of all fixed issues
・ Includes additional workarounds for Chip Errata: A-008708, A-008428, A-008822, A-009007, A-009668, A-009611, A-009810, A-010151, A-010554, A-010650
Linux Kernel Core, Virtualization
・ ?LTS kernel 4.4.98 update
・ ?LTS kernel 4.9.62 update
Linux Kernel Drivers
・ DPAA2 CAAM: Hashing
・ DPAA2 Ethernet: Priority Flow Control
・ OP-TEE driver [LS1046A]
・ PFE: 2.5G MAC [LS1012A]
U-Boot Boot Loader
・ HW load/store prefetch being disabled
・ PFE: 2.5G MAC [LS1012A]
Unified Extensible Firmware Interface (UEFI)
・ MC High Mem Support
Data Plane Development Kit (DPDK)
・ DPDK 17.05.02 as base
・ DPDK on docker [DPAA2 processors]
・ UEFI support on LS2088A
Virtualization - OVS-DPDK
・ OVS 2.8
Other Tools and Utilities
・ MC upgrade to 10.4.0
・ OP-TEE client [LS1046A]
・ PPA: sleep (LPM20) [LS1088A, LS2088A], OP-TEE OS binary [LS1046A]
・ Restool Bourne shell (sh) compatible


Latitude:
Longitude:
Address:
Covid19 Infected Patients: N/A
Symptomatic Patients: N/A
The number of symptomatic patients around you depends on the number of people who are filling the health entry form.


Here you will see all I learned about software engineering and even more
I've spent more than fifteen hours learning all these features.
feature 1
This is the description for the first feature. There are also three other features!
feature 2
This is the description for the second feature. There are also three other features!
feature 3
This is the description for the third feature. There are also three other features!
feature 4
This is the description for the fourth feature. There are also three other features!
Contact Me
Contacting someone is important in case you wanted to hire his or her abilities, and that is why here I provide a way to contact me.
Feedback
Feedback is always important in case you have an inquiry or something you think that we can improve.


Welcome to the official website of the project. Here you can download installation file. Most activity is on the project page on GitHub: issues, source code and pull-requests.
Download and run installation file to have add-in installed for your Excel.
If you face with certificate problem, you will need to import the provided certificate on your computer:
open setup.exe's properties, go to Digital signatures tab and import the certificate with Wizard:
Convert numbers stored as text to numeric format.
Replace Russian characters in the match table.
The entire Russian alphabet is completely changed to English. For example, the letter "Ж" will be replaced with "Zh", and the letter "Щ" with "Shch". Based on ICAO Doc 9303.
Only uppercase letters of the alphabets will be replaced, such as: Аа, Вв, Ее, Кк, Мм, Нн, Оо, Рр, Сс, Тт, Уу, Хх.
Rewrites numeric values with the text in languages
- Russian
- English
- French
Case switching for text values in selected cells according to the scheme:Abcde -> abcde ->
ABCDE
Clear the text content of the selected cells from unnecessary spaces. Removes repeated spaces and line breaks, as well as beginning and ending spaces in cells that have a text format.
Allows you to unprotect all the pages of an open book as the entire book, remove password, and also unlock VBA project (if any) to which the password is set. This feature does not apply to encrypted books.
Sets the color of cells that contain duplicate values in the selected range. Different colors correspond to different groups of duplicates.
Unmerge cells and fill each cell of merge area with initial value.
Search for all cells in the selected cells that contain calculation errors:
Excel formula errors types:
#N/A
#NAME?
#DIV/0!
#REF!
#VALUE!
#NUM!
#NULL!
Contents of selected cells will be copied to clipboard in markdown format.
Check the cell values in the selected range for a specific format.
Supported format:
- Number
- Date
- TIN of an individual* (12 digits, with two verification digits)
- TIN of the legal entity* (10 digits, with one verification digit)
- Text for XML (no < and > characters or other invalid characters for XML content)
* - The correct TIN does not guarantee the existence of an organization or individual who would own this
INN
Select file with an XSD schema and create a sample XML based on that schema.
For example, for the diagram below
<?xml version="1.0" encoding="UTF-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="shiporder"> <xs:complexType> <xs:sequence> <xs:element name="orderperson" type="xs:string"/> <xs:element name="shipto"> <xs:complexType> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="address" type="xs:string"/> <xs:element name="city" type="xs:string"/> <xs:element name="country" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="item" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="title" type="xs:string"/> <xs:element name="note" type="xs:string" minOccurs="0"/> <xs:element name="quantity" type="xs:positiveInteger"/> <xs:element name="price" type="xs:decimal"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="orderid" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:schema>
The following xml-file will be generated:
sample.xml
<shiporder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" orderid="orderid1"> <orderperson>orderperson1</orderperson> <shipto> <name>name1</name> <address>address1</address> <city>city1</city> <country>country1</country> </shipto> <item> <title>title1</title> <note>note1</note> <quantity>1</quantity> <price>1</price> </item> <item> <title>title2</title> <note>note2</note> <quantity>79228162514264337593543950335</quantity> <price>-79228162514264337593543950335</price> </item> <item> <title>title3</title> <note>note3</note> <quantity>2</quantity> <price>79228162514264337593543950335</price> </item> <item> <title>title4</title> <note>note4</note> <quantity>79228162514264337593543950334</quantity> <price>0.9</price> </item> <item> <title>title5</title> <note>note5</note> <quantity>3</quantity> <price>1.1</price> </item> </shiporder>
Check XML file with XSD schema. Select xml and xsd files, and report with all validation errors and warnings will be created in new workbook.
Sample error report
| Severity | Element | Message |
|---|---|---|
| Error | city | The element 'shipto' has invalid child element 'city'. List of possible elements expected: 'address'. |
| Error | quantity | The 'quantity' element is invalid - The value '-5' is invalid according to its datatype 'http://www.w3.org/2001/XMLSchema:positiveInteger' - Value '-5' was either too large or too small for PositiveInteger. |
| Error | price | The 'price' element is invalid - The value 'asdasd' is invalid according to its datatype 'http://www.w3.org/2001/XMLSchema:decimal' - The string 'не число' is not a valid Decimal value. |
Undo the last action performed with this add-in. Canceling is possible for some functions in the 'Converting values' and 'Formatting values' sections, and only if the range of cells was not edited after the action was performed.


TIFFDITHER
Section: User Commands (1)Updated: September 20, 2005
Index Return to Main Contents
NAME
tiffdither - convert a greyscale image to bilevel using ditheringSYNOPSIS
tiffdither [ options ] input.tif output.tifDESCRIPTION
tiffdither converts a single channel 8-bit greyscale image to a bilevel image using Floyd-Steinberg error propagation with thresholding.OPTIONS
- -c
- Specify the compression to use for data written to the output file: none for no compression, packbits for PackBits compression, lzw for Lempel-Ziv & Welch compression, zip for Deflate compression, g3 for CCITT Group 3 (T.4) compression, and g4 for CCITT Group 4 (T.6) compression. By default tiffdither will compress data according to the value of the Compression tag found in the source file.
- The CCITT Group 3 and Group 4 compression algorithms can only be used with bilevel data.
- Group 3 compression can be specified together with several T.4-specific options: 1d for 1-dimensional encoding, 2d for 2-dimensional encoding, and fill to force each encoded scanline to be zero-filled so that the terminating EOL code lies on a byte boundary. Group 3-specific options are specified by appending a ``:''-separated list to the ``g3'' option; e.g. -c g3:2d:fill to get 2D-encoded data with byte-aligned EOL codes.
- LZW compression can be specified together with a predictor value. A predictor value of 2 causes each scanline of the output image to undergo horizontal differencing before it is encoded; a value of 1 forces each scanline to be encoded without differencing. LZW-specific options are specified by appending a ``:''-separated list to the ``lzw'' option; e.g. -c lzw:2 for LZW compression with horizontal differencing.
- -f
- Specify the bit fill order to use in writing output data. By default, tiffdither will create a new file with the same fill order as the original. Specifying -f lsb2msb will force data to be written with the FillOrder tag set to LSB2MSB , while -f msb2lsb will force data to be written with the FillOrder tag set to MSB2LSB .
- -t
- Set the threshold value for dithering. By default the threshold value is 128.
NOTES
The dither algorithm is taken from the tiffmedian(1) program (written by Paul Heckbert).SEE ALSO
pal2rgb(1), fax2tiff(1), tiffinfo(1), tiffcp(1), tiff2bw(1), libtiff(3TIFF)Libtiff library home page: http://www.remotesensing.org/libtiff/
Index
This document was created by man2html, using the manual pages.
Time: 05:29:11 GMT, December 24, 2015


{% extends 'syspanel_base.html' %} {# list of user's instances #} {# standard nav, sidebar, list of instances in main #} {% block sidebar %} {% with current_sidebar="images" %} {{block.super}} {% endwith %} {% endblock %} {% block main %}
— Create, Edit, Upload, and Delete Images.


Taia Williams-Rivera
Portfolio
Welcome !
Hi, my name is Taia and I am currently
a sophmore at Delaware State University
majoring in Computer Science.
Facts about Me:
- I'm 18 years old
- Born and raised in Bronx, New York
- My favorite sport to play and watch is basketball
- And I'm obsessed with pizza !!
Pictures of Me !
Projects
- 2000's cartoon themed vending machine game
- Designing a Pi-car to navigate a maze and manuever through obstacles on its own
- Creating an alarm/security system that alarms the owner (Currently)
Random
Click here to see places I
want to travel to:


|
Qfib
|
Functions | |
| long | GetFileSize (const std::string &filename) |
| GetFileSize Function to obtain file size. More... | |
| template<typename T > | |
| void | compress (const string &inputFileName, const string &outputFileName, const bool outOfCore, const bool timings, const bool displayError, const bool displayDetailedError, const bool verbose, const bool verif, const string &fa, const bool zip) |
| compress Compress a set of fibers More... | |
| template<typename T > | |
| void | decompress (const string &inputFileName, const string &outputFileName, const bool outOfCore, const bool timings) |
| decompress Function to decompress a set of fibers More... | |
| bool | hasEnding (const string &path, const string &extension) |
| hasEnding Function to verify that a given file path ends with a given extension More... | |
| void | printUsage (const string &prog) |
| printUsage Print the simplified usage of the program More... | |
| void | printHelp (const string &prog) |
| printHelp Print the help of the program More... | |
| int | main (int argc, char *argv[]) |
| main Main function, reading the arguments to perform the computation asked More... | |
| void compress | ( | const string & | inputFileName, |
| const string & | outputFileName, | ||
| const bool | outOfCore, | ||
| const bool | timings, | ||
| const bool | displayError, | ||
| const bool | displayDetailedError, | ||
| const bool | verbose, | ||
| const bool | verif, | ||
| const string & | fa, | ||
| const bool | zip | ||
| ) |
compress Compress a set of fibers
| inputFileName | Path of the input file (tck) |
| outputFileName | Path of the output file (qfib) |
| outOfCore | Boolean : true when outOfCore, false otherwise |
| timings | When true, display the compression timings |
| displayError | When true, compute the compression error and diplay it - only in in-core mode |
| displayDetailedError | When true, compute the compression detailed error per fiber length and display it - only in in-core mode |
| verbose | When true, display the maximum angle of the set |
| verif | When true, verify that segments length are all the same length with a 10% margin - only in in-core mode Deactivate for full performance |
| fa | Path of an fa file to use for comparison - only in in-core mode If fa=="", no fa comparison is performed |
| zip | To automatically zip the output after compression for additional compression ratio |
| void decompress | ( | const string & | inputFileName, |
| const string & | outputFileName, | ||
| const bool | outOfCore, | ||
| const bool | timings | ||
| ) |
decompress Function to decompress a set of fibers
| inputFileName | Path of the input file (qfib) |
| outputFileName | Path of the output file (tck) |
| outOfCore | Boolean : true when outOfCore, false otherwise |
| timings | When true, display the compression timings |
| long GetFileSize | ( | const std::string & | filename | ) |
GetFileSize Function to obtain file size.
| filename | File to consider |
| bool hasEnding | ( | const string & | path, |
| const string & | extension | ||
| ) |
hasEnding Function to verify that a given file path ends with a given extension
| path | Path of the file to evaluate |
| extension | Extension that the file needs to have for the function to return true |
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
main Main function, reading the arguments to perform the computation asked
| argc | Number of arguments |
| argv | Char* containing the input as text |
| void printHelp | ( | const string & | prog | ) |
printHelp Print the help of the program
| prog | Name of the program |
| void printUsage | ( | const string & | prog | ) |
printUsage Print the simplified usage of the program
| prog | Name of the program |


Disney Trivia Game
Time Remaining:
60
Check Answers
Correct Answers:
0
Incorrect Answers:
0
Unanswered:
0


The Graph Data Structure (Advent of Code, Day 9)
December 31, 2015
One of the things I enjoyed most about Advent of Code was how the nature of the problems led one to utilize language features and data structures that are only infrequently used in everyday web development tasks. I had spent a decent portion of the previous month bootstrapping my knowledge of data structures and algorithms, so it was rewarding to be able to look at a problem and say, “Hey, this seems like the perfect place to use a graph.”
Graphs (the data structure, not the things that Excel struggles to generate correctly) will be the topic of this post, the second in a series of posts that use Advent of Code as an entrée to explore technical topics.
What Are Graphs?
Like most modern programming languages, Ruby gives its users lots of built-in data structures, such as arrays, hashes, sets, and queues. So, why bother building a Graph
class? That is to say, what makes graphs unique as a data structure?
In contrast to other data structures, where the main goal is convenient storage, searching, and sorting, and the connections between the elements are incidental (a byproduct of their sorted order or order of insertion), in graphs, the connections themselves encode the relevant information. This will become clearer with an example. To the right is a (comically) simple map of Poland with four cities represented on it. These cities could be stored in an array, ["Warsaw", "Lublin", "Poznań", "Gdańsk"]
, but then we miss out on what’s important here—the distances and routes between the cities. The graph data structure optimizes the storage of such “connection-heavy” data.
For my mini-graph, the connections represent distance in kilometers by car between the cities. However, it is important to note that the connections can represent pretty much anything. For a travel or mapping site, these connections might also represent travel time, price, a quality of travel metric, or other things besides just distance. For a social networking site, the points might symbolize users, whereas a connection between two points encodes a friendship.
Graph Terminology
There are a plethora of terms that are commonly used for the points and lines on a graph. I personally prefer the terms vertices and edges, so I will use these terms below.
Graphs can be weighted or unweighted. In a weighted graph, edges have a particular value associated with them. In an unweighted graph, an edge between any two points is merely present or absent.
Graphs can also be directed or undirected. In a directed graph, the edge A→B might not necessarily be the same as the edge B→A (for road maps, think of cases like one-way roads or construction detours; for social networks like Twitter, think of unreciprocated followings). That is to say, if an edge A→B exists and has a weight of 5, the edge B→A could have a different weight or might not even exist at all. Obviously, in an undirected graph, A→B will always be the same as B→A.
Now that our terminology has been defined, let’s explore how one might write a Graph
class in Ruby, while keeping in mind that what follows below is just one programmer’s first attempt at doing so.
Building a Graph Class
One of the most interesting decisions that needs to made when constructing a Graph
class is choosing how to keep track of the data in the edges. To my knowledge, there are three different “canonical” ways to do this, each with its own pluses and minuses:
- matrix – a matrix M of size n x n can be built with the data at M[x,y] representing either the presence or absence of a connection for unweighted graphs or the weight of such a connection forweighted graphs (if you’re old enough to remember these things called road altases, they usually contained matrices of distances between major cities)
- array + linked lists – the array A holds all the vertices in order, while the value at A[x] holds a linked list that contains all the edges that originate at vertex x; best used for sparsely connected graphs
- pointer-based – each vertex has one or two associated arrays, one that holds pointers to all of the vertex’s neighbors (or nil if no connection is present) and, if necessary, another array containing all the weights
In my Graph
class, I opted to use a pointer-based model. I chose to optimize my implementation for graphs with “named” (string-based) vertices and edges that hold a numerical value. Here’s what my Vertex
class and the beginnings of my Graph
class looks like:
class Vertex
attr_accessor :name, :neighbors, :weights
def initialize(name)
@name = name
@neighbors = []
@weights = []
end
end
class Graph
attr_accessor :vertices
def initialize
@vertices = []
end
def add_vertex(name)
@vertices << Vertex.new(name)
end
def find_vertex_by_name(name)
vertices.each do |v|
return v if v.name == name
end
nil
end
def count
vertices.length
end
end
A graph is initialized with an empty array of vertices. Each vertex is instantiated with a name, an empty neighbors array, and an empty weights array. Because of my choice to optimize for working easily with named vertices, I have a method #find_vertex_by_name
that can track down a vertex by, well, its name, which is used internally to allow for the convenient invocation of complex graph algorithms using the vertex names as parameters. The #count
method is heavily used internally as well, as knowing the total number of vertices is essential for many of the graph algorithms.
The ease of using vertex names for arguments for all the methods of the Graph
does come with a cost—it is somewhat clunky and costly to convert the name to the proper index position in the graph’s @vertices
instance variable. For example, here’s my #add_edge
method, which defaults for use with unweighted and undirected graphs (it will create a matching pair of unweighted edges for A→B and B→A), but can made to create edges for weighted and/or directed graphs by including additional arguments:
class Graph
# ...see above...
def add_edge(start_name, end_name, weight = nil, undirected = true)
from = vertices.index { |v| v.name == start_name }
to = vertices.index { |v| v.name == end_name }
vertices[from].neighbors[to] = true
vertices[from].weights[to] = weight if weight
if undirected
vertices[to].neighbors[from] = true
vertices[to].weights[from] = weight if weight
end
end
end
The first thing the method does is track down the index positions in the graph’s @vertices
array corresponding to the names entered as first and second arguments. Then the neighbors array of the starting (“originating”) vertex is updated at the position of the ending vertex to true
.
How Ruby is programmed to handle arrays helps here. Say we’ve just added a ninth vertex ("Nine") and tenth vertex ("Ten") to a graph g
. Should we want to add an undirected, unweighted edge between the two, it’s as simple as calling: g.add_edge("Nine", "Ten")
. The @neighbors
array of the ninth vertex will be updated to [nil, nil, nil, nil, nil, nil, nil, nil, nil, true]
. When true
is assigned to @neighbors[9]
(corresponding to the tenth vertex of the graph as Ruby arrays are zero-based), the other array positions are automatically filled with nil
. This indicates that the "Nine" vertex has an edge that runs to the tenth vertex, but no other edges.
By default, the #add_edge
method will also create an edge that runs in the reverse direction. This can be suppressed by including false
as a fourth argument to turn the undirected
flag off. Including a weight for the edge(s) created is as simple as including it as a third argument.
What Can We Do With Graphs? – An Overview
This post would grow to even more monstrous proportions if I were to describe in detail all the cool stuff it’s possible to do with graphs and analyze the methods I wrote to accomplish these things. Instead I’ll provide a barebones overview of the possibilities of graphs, and refer my reader to my GitHub account for all the implementation details:
- Traversal/Search – Graphs can be traversed (or searched) in either a breadth-first fashion (by using a queue) or a depth-first fashion (by using a stack)
- Shortest Path – The classic algorithm for finding the shortest path between two vertices was formulated by legendary computer scientist Edsger Dijkstra; theoretically, this can be used for weighted graphs (e.g. to find the shortest distance) and for unweighted graphs too (e.g. to find the minimum number of degrees to Kevin Bacon)
- All Shortest Paths – If we’re interested in finding all the shortest distances between all the vertices on the graph, Floyd’s algorithm does so quicker (in O(n^3) time) than repeatingly calling Dijkstra’s algorithm
- Minimal Spanning Tree – To find the “minimal spanning tree” of an undirected graph, that is, a collection of connected edges with the minimum possible total weight, Prim’s algorithm is one such option
- Traveling Salesman Problem – Lastly, the famously difficult and theoretically important optimization problem, the Traveling Salesman Problem, which tries to find the shortest route whereby a salesman can visit each “city” (vertex) exactly once and then return to his hometown, is best represented by using a graph
Advent of Code, Day 9 – The Problem
On the ninth day of Advent of Code, the elves give Santa a list of new locations to visit that includes distances between every pair of locations, and the task of the programmer is to find the shortest route that would visit each and every location exactly once. That’s Part One. For Part Two of the problem, Santa, probably a bit drunk on eggnog, decides he’s going to show off and take the longest possible route between all the locations (while visiting each of them exactly once). The lack of concern he shows for his reindeer’s health is frightening, but I guess we can excuse it because Santa grew up in a different era.
Advent of Code, Day 9 – A Solution
Shortly after checking the input I received, I realized that (a) my implementation of the Graph
class, with its emphasis on names and distances, would be an ideal fit, and (b) the problem is basically a variation of the Traveling Salesman Problem (TSP), only the salesman need not return to his home base.
In the original Graph
class I wrote, there was a rather naïve, brute-force approach to the TSP that only worked effectively up until about 10 vertices (as the number of cities (n) grows, the possible routes grow at the same speed as n!). In order to adapt it for this problem, I would need to modify the code to account for a situation where returning to the origin is unnecessary. I accomplished this by including an optional return_to_origin
parameter, which defaults to true
as in the standard TSP.
I’ll now walk through my modified implementation of the Traveling Salesman Problem:
class Graph
# ...see above...
def brute_force_tsp(return_to_origin = true)
min_distance = 1.0/0.0
best_path = nil
paths = (0...count).to_a.permutation.to_a
This is the setup. Set the minimum path distance to Infinity
, the best path to nil
, and generate each and every possible permutation of the range 0 to the total number of vertices minus one. The numbers in these permutations will refer to the indices of the graph’s @vertices
array and represent the city-to-city path that the salesman (or Santa) will take.
paths.each do |path|
cumulative_distance = 0
path[0..path.length - 2].each_with_index do |start_index, i|
end_index = path[i + 1]
if vertices[start_index].weights[end_index]
cumulative_distance += vertices[start_index].weights[end_index]
else
cumulative_distance += 1.0/0.0
end
end
For each path, the cumulative distance is calculated. For a given path, say [3, 5, 2, 7, 6, 0, 1, 4]
, the permutation array is iterated through step-by-step until the last position is reached. In the first step in the above array, the salesman travels from the fourth city to the sixth city (Ruby arrays are zero based, of course). The appropriate Vertex
is referenced from the graph’s @vertices
instance variable and if that Vertex
’s @weights
array holds a numerical value at position [5]
, then the value is added to the cumulative distance. If no edge exists between the cities, then that array position will hold nil
, and thus the cumulative distance is set to Infinity
as no valid path exists.
if return_to_origin
if vertices[path[-1]].weights[path[0]]
cumulative_distance += vertices[path[-1]].weights[path[0]]
else
cumulative_distance += 1.0/0.0
end
end
In a normal TSP algorithm, this wouldn’t be an if
block—the cost to return “home” from the last city is always calculated and added to the total. However, in the Advent of Code problem, we want to be able to pass a false
flag into the algorithm and bypass this step.
if cumulative_distance < min_distance
min_distance = cumulative_distance
best_path = path
end
end
The end of the each
loop. If the evaluated path’s cumulative distance is the shortest, then replace the value of the minimum distance and array representation of the best path.
if return_to_origin
puts "The shortest distance for a complete loop is #{min_distance}"
else
puts "The shortest route to visit each vertex exactly once is #{min_distance}"
end
puts humanize_tsp_route(best_path, return_to_origin)
[min_distance, best_path]
end
Not strictly necessary, but the #brute_force_tsp
method finishes by calling a private method #humanize_tsp_route
that renders the city-to-city path easily readable for humans, who are generally more adept at working with words than long lists of numbers.
Returning to the Advent of Code problem, with this setup now in place, all that’s left to do is to create a graph containing the vertices and edges specified in the input data and then call #brute_force_tsp
with the return_to_origin
flag set to false
. Using Ruby’s Regexp, it would possible to pull out as capture groups all the data we’re interested in; however, a sloppier but no less effective way to do this is to use #split
on each line of the input (comments are interspersed):
def build_graph_io
g = Graph.new
places = []
IO.foreach("../input/input9-distances.txt") do |line|
data = line.split
# if locations don't yet exist in graph, add it to graph and tracker array
unless places.index(data[0])
places << data[0]
g.add_vertex(data[0])
end
unless places.index(data[2])
places << data[2]
g.add_vertex(data[2])
end
# now add edge to graph
g.add_edge(data[0], data[2], data[4].to_i)
end
g
end
Note that the #add_edge
method defaults to undirected, so with each call to this method, not one, but two edges are added to graph, both of the same weight. Now that the graph can be built, the denouement is a simple two-liner, which could easily be uglified into a one-liner:
places = build_graph_io
places.brute_force_tsp(false)
# Output:
# The shortest route to visit each vertex exactly once is 117
# Faerun -> AlphaCentauri -> Tambi -> Snowdin -> Norrath -> Tristram -> Arbre -> Straylight
Part Two and Final Observations
As this post is already waaaaaaay too long as it stands, I shall have mercy on you and refrain from torturing you with a blow-by-blow explanation of the Part Two solution, which can be found here. Basically, it’s just another tweak of the basic TSP algorithm, only this one tracks maximum distance (as written it will only work for fully connected graphs, i.e. graphs in which a path exists between each and every city, which is fine because our input conforms to this criterion).
Of course, it is fully possible to solve this problem without bothering to construct a graph. (The Day 9 solution thread on the AoC subreddit has a ridiculously concise – and ridiculously hard to read – Ruby solution spanning only 7 lines.) But by recognizing common computational problems and then identifying which data structure lends itself best to solving them, it’s possible to take advantage of well-known, reusable algorithms and adapt them toward specific goals whether that’s modeling relations on an expansive social networking site or achieving more mundane goals like arranging relatives around a table in an ideal fashion (as in Day 13 of Advent of Code) or helping Santa visit eight mythical lands as quickly and painlessly as possible.


{{define "ROOT"}}
{{/* $ means, inside of the "Head" template, "{{.}}" is bound to the argument passed into Execute. */}} {{template "Head" $}} {{template "Bootstrap.css"}} {{/* The $ means pass into the Body template as dot '.', the argument that was passed into the Execute method. */}} {{template "Body" $}} ================================================================================ {{"put" | printf "%s%s" "out" | printf "%q"}} {{end}}


vFly is a file a sharing system that makes sharing different types of files fast, easy, and secure. Simply connect using the unique ID and get to sharin' :)


I am a recent graduate of Nashville Software School! I decided to take the plunge from doing men's hair full time and have not looked back since. I wanted to find something with a great work-life balance that I could see myself doing for years. Basically, I found myself ready for a career instead of a job I knew I wouldn't want to do 5 years from now. I enjoy the problem solving and creativity it involves, not to mention the constant learning! I'm glad I have chosen a field that leaves little room for boredom.
Worked with a diverse client base, ensuring they were treated with respect. Had to be professional and dressed for the job. Had to apply A lot of customer service and pleasant-ness. job required and good deal of creativity, professionalism, and a very "here to please" attitude.
Apart from being a web developer, I play the Euphonium with the Williamson County Community Band. I've been with them for two years now and absolutely love it. I've made great friendships and get to play with 50+ AWESOME musicians!
I also enjoy a good bit of nerding out with things like playing DND, having board game nights etc.. Also LOVE collecting old VHS tapes! And yes, i do actually have two functioning VCR's!
One thing I love from my hair background is coloring hair! I do it to myself mostly but I do love doing it and experimenting with different color combinations!
Another way to get to know someone is meeting their loved ones, so here's someone I love more than anything, Ghost!


Git Version Control System
Git is awesome.
Features of div:
Distributed Version Control
High Performance
Secure
Flexible
Open Source


existing solution review
There currently aren’t any wildly available solutions to the problem at hand. One example is the ‘Go Pro Surgery Package’ [1], which offer cameras which can be worn by surgeons which are able to capture high quality footage from the surgeon’s point of view, at varied levels of magnification. Whilst the footage is of high quality, from a reliable brand, that’s all they provide. The surgeons themselves would then have to worry about storing and uploading video, potentially having to pay for even more services, with an already tight budget.
‘Inition’ are a company who have also attempted to provide another solution, using 3D displays and motion capture technology to try and improve the quality of surgery as well as the quality of training. However, whilst the results were promising, this only provided live 3D footage to those at the screening watching with 3D glasses [2]. One interesting aspect of the research was the tracking of surgeons’ hands for future analysis, for future training purposes.
Related technologies
One example of a related technology is the surgical video database provided by MedlinePlus [3]. The webpage provides links to a number of surgical videos. The format is clear and concise; however, links are all the page provides. There are no sort functions, video previews or the ability to search and filter videos. This makes it quite difficult to easily find desired videos.
"Kinect Fusion" Algorithums[4]
KinectFusion: Real-Time Dense Surface Mapping and Tracking
this alrotighum enables user to have a track ofbalabala need ........
Final decisions
After reviewing existing and related technologies, we tried to take what was best from each and implement similar techniques and functionalities into our own solution. For example, taking note of the clear format of the MedlinePlus page, or the techniques used by Inition to help improve the quality of training.
References
[1] https://swissurgicalvideo.com/product-line/gopro-surgery-packages/
[2] https://www.inition.co.uk/case_study/live-3d-surgery-stereoscopic-surgery-training-trial/
[3] https://medlineplus.gov/surgeryvideos.html
[4] https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/ismar2011.pdf


summarization.Rmd
library(gensimr)
set.seed(42) # rerproducability
# sample data
data(corpus, package = "gensimr")
# preprocess corpus
docs <- preprocess(corpus)
Extract keywords.
str <- "Challenges in natural language processing frequently
speech recognition, natural language understanding, natural language
generation (frequently from formal, machine-readable logical forms),
connecting language and machine perception, dialog systems, or some
combination thereof."
(keywords(str))
#> [[1]]
#> [1] "language" "machine" "frequently"
Text summarisation.
str <- "Rice Pudding - Poem by Alan Alexander Milne
What is the matter with Mary Jane?

What is the matter with Mary Jane?
I've promised her dolls and a daisy-chain,
And a book about animals - all in vain -
What is the matter with Mary Jane?
What is the matter with Mary Jane?
She's perfectly well, and she hasn't a pain;
But, look at her, now she's beginning again! -
What is the matter with Mary Jane?
What is the matter with Mary Jane?
I've promised her sweets and a ride in the train,
And I've begged her to stop for a bit and explain -
What is the matter with Mary Jane?
What is the matter with Mary Jane?
She's perfectly well and she hasn't a pain,
And it's lovely rice pudding for dinner again!
What is the matter with Mary Jane?"
summarize(str) %>%
unlist() %>%
cat()
#> And she won't eat her dinner - rice pudding again -
#> I've promised her dolls and a daisy-chain,
#> I've promised her sweets and a ride in the train,
#> And it's lovely rice pudding for dinner again!


LensPlex
Learn
Gallery
Workshops
Tutorials
About Us
Login
Sign Up
Download
Anyone can be a great Photographer!


Tap to refresh flash card
You can do it!
'Practice makes perfect.'
Tap below to show answer
Answer appears here


"There are so many negative aspects to this world of ours. This is something really positive. It gives you hope. The day I break a record I’m just happy the whole day."
More information about Ashrita Fumar you can find on his fantastic personal blog here.


It's about time that I have a website, so here it is! I'm going to start super simple with some basic html/css, but will eventually step things up with and use React and SCSS. Looking forward to seeing the progress of this site over the next 100 days as I partake in the#100daysofcode challenge. If you want to follow my progress, be sure to follow me on Twitter!


MC-DNA is a tool to rapidly create static and dynamic B-DNA conformations of a sequence of interest. With the use of a Monte Carlo algorithm this tool runs up to 50x faster than conventional Molecular Dynamics providing similar accuracy. MC-DNA provides a three-dimensional all-atom representation of the DNA structure with the underlying sequence of interest.
Two options are available within MC-DNA:
To provide a more in-depth analysis both outputs from 'Create Structure' and 'Create Trajectory' can also serve as an input for the tool NAflex.


jQuery Methods
turtle
gato
chico
the image content will be changed using the attr method
Skittle
Oreo
Churros


Interesting application form
What is your name?
What is your favorite color?
Red
Green
Blue
Other
Would you like become a developer?
Yes
Ano
Igen
是
Why would you like to become a developer?
Submit


--- layout: archive title: Zulip Chat Archive permalink: /stream/113489-new-members/topic/slow.20reduction.html ---
I have a #reduce
that's leading to "(deterministic) timeout" and I'm wondering what I can do to find out what's taking so long. Can I #reduce
step-by-step?
Unfortunately no. #reduce
is not really intended for serious use
It turns out that unfolding a proof down to axioms is actually kind of expensive :)
Hmm, well it's also breaking my examples/tests, since it can't even prove things by rfl
at very small input sizes, and I can't figure out why, because the code seems fairly straightforward.
this is also not unusual
I think theorem nat.prime 5 := dec_trivial
times out
it depends on what numerical functions you are calling
I guess it would be nice to have bytecode-based tests for quick dumb sanity checks
You should use #eval
for that
I do, I just wish I could write something that asserts on the result rather than simply printing it
you can use run_cmd
:
run_cmd guard (2 + 2 = 4) run_cmd guard (2 + 2 = 5) -- failed
Perfect, thanks!
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


MTL Related effects in train task
- Examined behavior unrelated and behavior related effects on left
vs. right MTL
- Approximately 65% of left MTL electrodes were anterior
- All right MTL electrodes were anterior (verified by manual
examination)
- Low Theta: 1-4 Hz, High Theta: 4-8 Hz, Alpha: 8-12 Hz
Behavior unrelated effects
- When examining peaks for behavior unrelated effects, there are 34
left posterior peaks, 37 left anterior peaks, and 66 right anterior
peaks.
- Left MTL tends to lean towards alpha peaks, especially in posterior
- Right MTL tends to lean towards high theta peaks
Example: Right High Theta Peak
Movement related effects
- Analyzed movement power > stationary power
- 34 left posterior peaks, of which 15 are significant. 42 left
anterior peaks, of which 30 are significant
- 77 right anterior peaks, of which 47 are significant
- Left posterior: exclusively significant at alpha. Left anterior:
broadband significance
- Right anterior: Broadband, but concentrated at high theta
Example: Right High Theta Peak
Memory related effects
- Analyzed good memory power > bad memory power
- 32 left posterior peaks, of which 8 are significant. 39 left
anterior peaks, of which 8 are significant
- 75 right anterior peaks, of which 51 are significant
- Left essentially not a factor in memory.
- Right: broadband, but concentrated at high theta
Example: Right High Theta Peak
Speed related effects
- Analyzed fast power > slow power
- 37 left posterior peaks, of which 17 are significant. 38 left
anterior peaks, of which 15 are significant
- 75 right peaks, of which 40 are significant
- Left is primarily significant at alpha in both areas
- Right is again broadband, but concentrated around high theta
Example: Left Alpha Peak 2
Example: Right High Theta Peak
Conclusions
- Overall, left has high activity in alpha, especially in posterior
MTL
- Right usually sees broadband activation with concentration around
high theta. Low theta and alpha activation is usually approximately
equal
- Movement and speed seem to be driven by both hemispheres, but at
their respective frequencies
- Memory is primarily driven by right MTL
- Handedness of subjects was not taken into account. This perhaps
might alter results.


Extends from Modelica.Icons.Package (Icon for standard packages), EEB.Icons.TestModel.
Extends from EEB.Icons.TestModel.


--- title: "Slack" layout: splash classes: - landing - dark-theme ---
Map Camp should be a safe environment for all and we will do everything we can to make sure that it is. By joining the Slack community you agree to follow our Code of Conduct.
Invite link expired? Reach out to Simon.


I know it does not look like what I want it to be, but it is a yellow blossom tree. In Vietnamese culture, yellow blossom tree is displayed in every house during Tet - Vietnamese New Year event. It represents luck, love, and wealth. The bigger the tree, the richer the owner. The branches of a yellow blossom do not usually follow any pattern, so it is hard to properly transfer it to Minecraft. Below the tree is a parchis board. It is a common game that Vietnamese people play during Tet festival. I also build a stadium around it to replicate an affluent atmosphere. During this specific event, families would gather around the yellow blossom trees, play some cardboard games, and share memories of the previous year.
Yellow Blossom Tree
Parchis board
Back to landing page


You have 60 seconds to complete the quiz. For every right answer, 10 seconds will be added to your time! But beware, for every WRONG answer, 15 seconds will be subtracted from your time!


Genesis 17:24
And Abraham was ninety years old and nine, when he was circumcised in the flesh of his foreskin.


Discover Music
Welcome [[${#httpServletRequest.remoteUser}]]
Found [[${totFound}]] Albums with Query: [[${query}]]
#
Title
Artist
Date Released
Tracks
Genre
Price
Actions
Edit
Delete
No records were found with: [[${query}]]


Home
Please sign in
Username
Password
Login
Not signed up? register
here
Please input correct details


Psalms 45:5
Thine arrows are sharp in the heart of the king's enemies; whereby the people fall under thee.


{{user.name}}
{{user.email}}
Home
PLAYLISTS
Now Playing
What to Watch
History
Watch Later
MISC
Settings
JukeTube
This area is left blank intentionally at the moment :(
Got Google?
Please login to use this feature.
Error
An unexpected error has occured, Please refresh the page to continue.


Generator based control flow goodness for nodejs and the browser, using promises, letting you write non-blocking code in a nice-ish way.
<EMAIL_ADDRESS>has been released, which now relies on promises.
It is a stepping stone towards ES7 async/await.
The primary API change is how co()
is invoked.
Before, co
returned a "thunk", which you then called with a callback and optional arguments.
Now, co()
returns a promise.
co(function* () {
var result = yield Promise.resolve(true);
return result;
}).then(function (value) {
console.log(value);
}, function (err) {
console.error(err.stack);
});
If you want to convert a co
-generator-function into a regular function that returns a promise,
you now use co.wrap(fn*)
.
var fn = co.wrap(function* (val) {
return yield Promise.resolve(val);
});
fn(true).then(function (val) {
});
co@4+
requires a Promise
implementation.
For versions of node < 0.11
and for many older browsers,
you should/must include your own Promise
polyfill.
When using node 0.11.x or greater, you must use the --harmony-generators
flag or just --harmony
to get access to generators.
When using node 0.10.x and lower or browsers without generator support, you must use gnode and/or regenerator.
io.js is supported out of the box, you can use co
without flags or polyfills.
$ npm install co
Any library that returns promises work well with co
.
View the wiki for more libraries.
var co = require('co');
co(function *(){
// yield any promise
var result = yield Promise.resolve(true);
}).catch(onerror);
co(function *(){
// resolve multiple promises in parallel
var a = Promise.resolve(1);
var b = Promise.resolve(2);
var c = Promise.resolve(3);
var res = yield [a, b, c];
console.log(res);
// => [1, 2, 3]
}).catch(onerror);
// errors can be try/catched
co(function *(){
try {
yield Promise.reject(new Error('boom'));
} catch (err) {
console.error(err.message); // "boom"
}
}).catch(onerror);
function onerror(err) {
// log any uncaught errors
// co will not throw any errors you do not handle!!!
// HANDLE ALL YOUR ERRORS!!!
console.error(err.stack);
}
The yieldable
objects currently supported are:
Nested yieldable
objects are supported, meaning you can nest
promises within objects within arrays, and so on!
Thunks are functions that only have a single argument, a callback.
Thunk support only remains for backwards compatibility and may
be removed in future versions of co
.
yield
ing an array will resolve all the yieldables
in parallel.
co(function* () {
var res = yield [
Promise.resolve(1),
Promise.resolve(2),
Promise.resolve(3),
];
console.log(res); // => [1, 2, 3]
}).catch(onerror);
Just like arrays, objects resolve all yieldable
s in parallel.
co(function* () {
var res = yield {
1: Promise.resolve(1),
2: Promise.resolve(2),
};
console.log(res); // => { 1: 1, 2: 2 }
}).catch(onerror);
Any generator or generator function you can pass into co
can be yielded as well. This should generally be avoided
as we should be moving towards spec-compliant Promise
s instead.
Returns a promise that resolves a generator, generator function, or any function that returns a generator.
co(function* () {
return yield Promise.resolve(true);
}).then(function (val) {
console.log(val);
}, function (err) {
console.error(err.stack);
});
Convert a generator into a regular function that returns a Promise
.
var fn = co.wrap(function* (val) {
return yield Promise.resolve(val);
});
fn(true).then(function (val) {
});
MIT


Vice President of China Innovative Talent Education Research Association Professional Committee of Chinese Society of Education High School Education vice chairman Dr. Shenzhen Science High School, served as founding president,, sociology of education - Shenzhen high school principal, in charge of the preparations for the construction of China's first Science
Learn moreShenzhen High School was founded in 1947. June 1983 was designated as the sole province of Shenzhen City, the focus of high school, in 1986 was named the Guangdong Province progress fast, the effect good school, in November 1993 by the Guangdong Province, the first a school. 2004, was designated as the state's new school
Learn moreAddress: Shenzhen deep in the people of North 18th Street
Zip Code: 518025
Tel: 0755-82222572
Email<EMAIL_ADDRESS>Learn moreCopyright © Shenzhong.net Rights Reserved | Design by szweb.cn Contact Us


A number of basic ANSI C data structures have been defined to correspond to the FITS HDUs mentioned above. The most fundamental structure consists of a two-dimensional array of an arbitrary size and various types (short, float, etc.), together with an array of header lines to represent collections of keywords associated with the data. This basic structure is then specialized to represent specific types of header plus two-dimensional array, viz., Science, Error, Data Quality, Samples, and Integration Times HDUs.
In addition, the basic structures above are grouped into single and multiple groups of HDUs. A single STIS group consists of a global header together with a Science, Error, and Data Quality HDU. A single NICMOS group consists of a global header together with a Science, Error, Data Quality, Samples and Integration Times HDU. A multiple STIS group consists of a global header together with N groups of Science, Error, and Data Quality HDUs. Likewise, a multiple NICMOS group consists of a global header together with N groups of Science, Error, Data Quality, Samples and Integration Times HDUs.


Check the Release Page to see if there is an update available.
You can also automatically get notified about a release, see Release Notifications.
Alternatively the following file types are supported:
Do not reload this page or switch to another page while the update is in progress!


Cancel
We are sorry you chose to cancel your purchase. Would you like to return to GeaMaseMedia.com ?
Back to GeaMaseMedia.com


Search:
Go
Names
Puma concolor
Puma yagouaroundi
Smilisca puma
All Names
Types
Ranges
Points
All Types
Sources
GBIF
MOL
All Sources
Results
Puma concolor
(author)
more info
Puma concolor
(author)
more info
Puma yagouaroundi
(author)
more info
Puma yagouaroundi
(author)
more info
Smilisca puma
(author)
more info
Map Selected Layers


Me
|
Report
|
About
|
Schools
Table of Schools
Click to see Schools
SkolenhetsName
Skolenhetskod
KommunKod
PeOrgNr


ISBN Search
ISBN-13:<PHONE_NUMBER>652
ISBN-10:<PHONE_NUMBER>
Author: Artur Ejsmont
Edition: 1
Binding: Paperback
Publisher: McGraw-Hill Education
Published: June 2015
List Price: $50.00
$27.65
+3.50 shipping
Ships 2-3 days
Notes
$28.49
+4.96 shipping
Ready to ship
$30.22
+3.99 shipping
$30.52
$30.62
+3.95 shipping
$32.67
Ships 3+ Days
$36.75
Free shipping
$41.65
+3.97 shipping
$42.50
$14.58
$15.08
$16.04
$16.40
$35.95
$38.20
$56.49
+5.99 shipping


Bankrupt PG&E to take $4.9 billion more charge on wildfire victim claims
(Reuters) - PG&E Corp said www.sec.gov/ix?doc=/Archives/edgar/data/75488/000095015719001393/form8-k.htm on Monday it would take a pretax charge of $4.9 billion in the current quarter related to the settlement of claims from victims of some of most devastating wildfires in California's modern history.
The bankrupt power producer said on Friday it had reached a $13.5 billion settlement with victims of 2017 and 2018 wildfires.
The company had already taken a $2.5 billion charge in the last quarter for estimated third-party claims related to 2017 wildfires and 2018 Camp fire.
The agreement with the victims announced on Friday was one of the last hurdles for the company to emerge from bankruptcy. It filed for Chapter 11 protection in January, citing potential liabilities in excess of $30 billion from wildfires in 2017 and 2018 linked to its equipment.
PG&E had previously settled for $1 billion with cities, counties and other public entities as well as for $11 billion with insurance carriers related to the wildfires.


Click here to enter the compatition
Click here to read it before entering the contest
Learn easy Tips & Tricks created by professional Photographers specifically made for beginners


| Figure 1 |
Dark respiration, Pn and Pg of biocrusts determined under di ... |
| Figure 2 |
Light compensation points of biocrusts under two water condi ... |
| Figure 3 |
The ratios of dark respiration to gross photosynthesis (R/Pg ... |
| Figure 4 |
Dark respiration, Pn and Pg of biocrusts determined under di ... |
| Figure 5 |
Effects of NRW amount, light intensity (LI) and temperature ... |


Ruby's Enumerable#group_by Method
The Ruby group_by method is a useful method for separating data into groups based on the results of passing that data into a block of code. It is applied to an enumerable. The result is a hash where the keys are the evaluated result from the block and the values are arrays of elements in the collection that correspond to the key. Its general form is:
Enumerable.group_by { |object| block of code} -> returns a hashHere are some examples of how #group_by is used. There are many more ways to apply the group_by method than listed below. Try experimenting yourself!
- Example 1 - an array of numbers is separated into
two groups: even (.even? == true) and odd
(.even == false)
[3, 6, 7, 21, 34, 8, 0, 5].group_by {|x| x.even?}
    #=> {false=>[3, 7, 21, 5], true=>[6, 34, 8, 0]} - Example 2 - each number in a range of numbers
is separated according to the remaineder when
divided by 4
(1..10).group_by { |i| i%4 }
    #=> {0=>[4, 8], 1=>[1, 5, 9], 2=>[2, 6, 10], 3=>[3, 7]} - Example 3 - the strings in the array are ordered
by first letter
fruits = ["apples", "grapes", "apricots", "mangoes", "bananas"] group_by_first_letter = fruits.group_by { |x| x[0] }
    #=> {"a"=>["apples", "apricots"], "g"=>["grapes"], "m"=>["mangoes"], "b"=>["bananas"]}


| Package | Description |
|---|---|
| org.apache.fop.pdf |
Classes for handling the low-level creation of PDF documents.
|
| org.apache.fop.render.pdf |
PDF Renderer
|
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractPDFFontStream
Base class for PDF font streams.
|
class |
AbstractPDFStream
This is an abstract base class for PDF streams.
|
class |
ObjectStream
An object stream, as described in section 3.4.6 of the PDF 1.5 Reference.
|
class |
PDFAction
class representing an action object.
|
class |
PDFAnnotList
class representing an object which is a list of annotations.
|
class |
PDFArray
Class representing an array object.
|
class |
PDFCFFStream
Special PDFStream for embeddable CFF fonts.
|
class |
PDFCFFStreamType0C
PDFStream for embeddable OpenType CFF fonts.
|
class |
PDFCharProcs
class representing a /CharProcs dictionary for Type3 fonts.
|
class |
PDFCIDFont
Class representing a "character identifier" font (p 210 and onwards).
|
class |
PDFCIDFontDescriptor
Class representing a font descriptor for CID fonts.
|
class |
PDFCIDSystemInfo
class representing system information for "character identifier" fonts.
|
class |
PDFCIELabColorSpace
This class represents a "CIE L*a*b*" color space.
|
class |
PDFCMap
Class representing the CMap encodings.
|
class |
PDFColor
PDF Color object.
|
class |
PDFDestination
class representing a named destination
|
class |
PDFDests
class representing an /Dests dictionary object
|
class |
PDFDictionary
Class representing a PDF dictionary object
|
class |
PDFDPart |
class |
PDFDPartRoot |
class |
PDFEmbeddedFile
This class represents an embedded file stream.
|
class |
PDFEmbeddedFiles
Class representing an /EmbeddedFiles dictionary object (name tree).
|
class |
PDFEncoding
Class representing an /Encoding object.
|
class |
PDFEncryptionJCE
An implementation of the Standard Security Handler.
|
class |
PDFFileSpec
Class representing a /FileSpec object.
|
class |
PDFFont
Class representing a /Font object.
|
class |
PDFFontDescriptor
Class representing a font descriptor (/FontDescriptor object).
|
class |
PDFFontNonBase14
A common ancestor for Type1, TrueType, MMType1 and Type3 fonts
(all except base 14 fonts).
|
class |
PDFFontTrueType
Class representing a TrueType font.
|
class |
PDFFontType0
Class representing a Type0 font.
|
class |
PDFFontType1
Class representing a Type1 or MMType1 font (not necessary for the base 14).
|
class |
PDFFontType3
Class representing a Type3 font.
|
class |
PDFFormXObject
PDF Form XObject
A derivative of the PDFXObject, is a PDF Stream that has not only a
dictionary but a stream of image data.
|
class |
PDFFunction
class representing a PDF Function.
|
class |
PDFGoTo
class representing a /GoTo object.
|
class |
PDFGoToRemote
Class representing a /GoToR object.
|
class |
PDFGState
Class representing a /ExtGState object.
|
class |
PDFICCBasedColorSpace
Represents an ICCBased color space in PDF.
|
class |
PDFICCStream
Special PDFStream for ICC profiles (color profiles).
|
class |
PDFIdentifiedDictionary
Identified Dictionary.
|
class |
PDFImageXObject
PDF XObject
A derivative of the PDF Object, is a PDF Stream that has not only a
dictionary but a stream of image data.
|
class |
PDFInfo
class representing an /Info object
|
class |
PDFInternalLink
class used to create a PDF internal link
|
class |
PDFJavaScriptLaunchAction
PDF Action which executes some JavaScript code.
|
class |
PDFLaunch
This class represents the /Launch action.
|
class |
PDFLayer
Optional Content Group Dictionary, which we will call a 'layer'.
|
class |
PDFLink
class representing an /Annot object of /Subtype /Link
|
class |
PDFMetadata
Special PDFStream for Metadata.
|
class |
PDFName
Class representing a PDF name object.
|
class |
PDFNames
Class representing a PDF Names object
|
class |
PDFNameTreeNode
Class representing a PDF name tree node.
|
class |
PDFNavigator
Navigation Node Dictionary, which we call a 'navigator'.
|
class |
PDFNavigatorAction |
class |
PDFNumber
This class represents a simple number object.
|
class |
PDFNumberTreeNode
Class representing a PDF number tree node.
|
class |
PDFNumsArray
Class representing an "Nums" array object (for Number Trees).
|
class |
PDFOutline
This represents a single Outline object in a PDF, including the root Outlines
object.
|
class |
PDFOutputIntent
Represents the OutputIntent dictionary.
|
class |
PDFPage
Class representing a /Page object.
|
class |
PDFPageLabels
Class representing a PDF /PageLabels dictionary.
|
class |
PDFPages
class representing a /Pages object.
|
class |
PDFParentTree
Class representing a PDF /ParentTree.
|
class |
PDFPathPaint
Base class for PDF painting operations.
|
class |
PDFPattern
class representing a PDF Function.
|
class |
PDFResourceContext
The PDF resource context.
|
class |
PDFResources
Class representing a /Resources object.
|
class |
PDFRoot
Class representing a Root (/Catalog) object.
|
class |
PDFSeparationColorSpace
This class represents a "Separation" color space.
|
class |
PDFSetOCGStateAction |
class |
PDFShading
class representing a PDF Smooth Shading object.
|
class |
PDFStream
Class representing a PDF stream.
|
class |
PDFStructElem
Class representing a PDF Structure Element.
|
static class |
PDFStructElem.Placeholder
Class representing a placeholder for a PDF Structure Element.
|
class |
PDFStructTreeRoot
Class representing a PDF /StructTreeRoot dictionary.
|
class |
PDFT1Stream
Special PDFStream for embedding Type 1 fonts.
|
class |
PDFText
This class represents a simple number object.
|
class |
PDFToUnicodeCMap
Class representing ToUnicode CMaps.
|
class |
PDFTransitionAction |
class |
PDFTTFStream
Special PDFStream for embeddable TrueType fonts.
|
class |
PDFUri
class used to create a PDF Uri link
|
class |
PDFXObject
Abstract base class of PDF XObjects.
|
class |
StructureHierarchyMember
An element in the document's structure tree.
|
class |
TransitionDictionary
Transition Dictionary
This class is used to build a transition dictionary to
specify the transition between pages.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<PDFObject> |
PDFStructElem.kids
Elements to be added to the kids array.
|
protected java.util.List<PDFObject> |
PDFDocument.objects
the objects themselves
|
protected java.util.List<PDFObject> |
PDFDocument.trailerObjects
List of objects to write in the trailer
|
| Modifier and Type | Method and Description |
|---|---|
PDFObject |
ASCIIHexFilter.getDecodeParms()
Get the decode params.
|
abstract PDFObject |
PDFFilter.getDecodeParms()
return a parameter dictionary for this filter, or null
|
PDFObject |
FlateFilter.getDecodeParms()
Get the decode params for this filter.
|
PDFObject |
ASCII85Filter.getDecodeParms()
Get the decode parameters.
|
PDFObject |
DCTFilter.getDecodeParms()
Get the decode params for this filter.
|
PDFObject |
CCFFilter.getDecodeParms()
return a parameter dictionary for this filter, or null
|
PDFObject |
NullFilter.getDecodeParms()
return a parameter dictionary for this filter, or null
|
PDFObject |
PDFReference.getObject()
Returns the PDF object
|
PDFObject |
PDFObject.getParent()
Returns this objects's parent.
|
PDFObject |
PDFDocument.registerObject(PDFObject obj)
Registers a
PDFObject in this PDF document. |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<PDFObject> |
PDFStructElem.getKids() |
| Modifier and Type | Method and Description |
|---|---|
void |
PDFAnnotList.addAnnot(PDFObject link)
add an /Annot object of /Subtype /Link.
|
void |
PDFResourceContext.addAnnotation(PDFObject annot)
set this page's annotation list
|
void |
PDFStructTreeRoot.addKid(PDFObject kid)
Adds the given object to the array of kids.
|
abstract void |
StructureHierarchyMember.addKid(PDFObject kid)
Adds the given object to the array of kids.
|
void |
PDFStructElem.addKid(PDFObject kid)
Adds a kid to this structure element.
|
void |
PDFDocument.addObject(PDFObject obj)
Adds a
PDFObject to this document. |
void |
PDFDocument.addTrailerObject(PDFObject obj)
Add trailer object.
|
void |
PDFDocument.assignObjectNumber(PDFObject obj)
|
protected boolean |
PDFGState.contentEquals(PDFObject obj)
Check if the other PDFObject has the same content as the current object.
|
protected boolean |
PDFObject.contentEquals(PDFObject o)
Check if the other PDFObject has the same content as the current object.
|
protected boolean |
PDFFunction.contentEquals(PDFObject obj)
Check if the other PDFObject has the same content as the current object.
|
protected boolean |
PDFGoToRemote.contentEquals(PDFObject obj)
Check if the other PDFObject has the same content as the current object.
|
protected boolean |
PDFShading.contentEquals(PDFObject obj)
Check if the other PDFObject has the same content as the current object.
|
protected boolean |
PDFGoTo.contentEquals(PDFObject obj)
Check if the other PDFObject has the same content as the current object.
|
protected boolean |
PDFLink.contentEquals(PDFObject obj)
Check if the other PDFObject has the same content as the current object.
|
protected boolean |
PDFFileSpec.contentEquals(PDFObject obj)
Check if the other PDFObject has the same content as the current object.
|
protected boolean |
PDFPattern.contentEquals(PDFObject obj)
Check if the other PDFObject has the same content as the current object.
|
protected boolean |
PDFColor.contentEquals(PDFObject obj)
Check if the other PDFObject has the same content as the current object.
|
protected boolean |
PDFJavaScriptLaunchAction.contentEquals(PDFObject obj)
Check if the other PDFObject has the same content as the current object.
|
protected boolean |
PDFLaunch.contentEquals(PDFObject obj)
Check if the other PDFObject has the same content as the current object.
|
byte[] |
PDFEncryption.encrypt(byte[] data,
PDFObject refObj)
Encrypt an array of bytes using a reference PDFObject for calculating
the encryption key.
|
byte[] |
PDFEncryptionJCE.encrypt(byte[] data,
PDFObject refObj)
Encrypt an array of bytes using a reference PDFObject for calculating
the encryption key.
|
static int |
PDFDocument.outputIndirectObject(PDFObject object,
java.io.OutputStream stream)
Outputs the given object, wrapped by obj/endobj, to the given stream.
|
PDFObject |
PDFDocument.registerObject(PDFObject obj)
Registers a
PDFObject in this PDF document. |
void |
CCFFilter.setDecodeParms(PDFObject decodeParms)
Sets the CCF decoding parameters
|
void |
PDFObject.setParent(PDFObject parent)
Sets the direct parent object.
|
void |
PDFStructElem.setParent(PDFObject parent)
Sets the direct parent object.
|
protected int |
PDFDocument.streamIndirectObject(PDFObject o,
java.io.OutputStream stream) |
| Modifier and Type | Method and Description |
|---|---|
static void |
PDFDictionary.getChildren(java.util.Collection<java.lang.Object> values,
java.util.Set<PDFObject> children) |
void |
PDFObject.getChildren(java.util.Set<PDFObject> children) |
void |
PDFResources.getChildren(java.util.Set<PDFObject> children) |
void |
PDFImageXObject.getChildren(java.util.Set<PDFObject> children) |
void |
PDFLink.getChildren(java.util.Set<PDFObject> children) |
void |
PDFAnnotList.getChildren(java.util.Set<PDFObject> children) |
void |
PDFCIDFont.getChildren(java.util.Set<PDFObject> children) |
void |
PDFICCBasedColorSpace.getChildren(java.util.Set<PDFObject> children) |
void |
PDFArray.getChildren(java.util.Set<PDFObject> children) |
void |
PDFOutline.getChildren(java.util.Set<PDFObject> children) |
void |
PDFDictionary.getChildren(java.util.Set<PDFObject> children) |
void |
AbstractPDFStream.getChildren(java.util.Set<PDFObject> children) |
| Constructor and Description |
|---|
PDFArray(PDFObject parent)
Create a new, empty array object
|
PDFArray(PDFObject parent,
double[] values)
Create an array object.
|
PDFArray(PDFObject parent,
int[] values)
Create an array object.
|
PDFArray(PDFObject parent,
java.util.List<?> values)
Create an array object.
|
PDFArray(PDFObject parent,
java.lang.Object[] values)
Create the array object
|
PDFDictionary(PDFObject parent)
Create a new dictionary object.
|
PDFNumsArray(PDFObject parent)
Create a new, empty array object.
|
PDFObject(PDFObject parent)
Constructor for direct objects.
|
PDFReference(PDFObject obj)
Creates a new PDF reference.
|
PDFStructElem(PDFObject parent,
StructureType structureType)
Creates a new structure element.
|
Placeholder(PDFObject parent) |
| Modifier and Type | Class and Description |
|---|---|
class |
PageSequenceStructElem |
Copyright 1999-2020 The Apache Software Foundation. All Rights Reserved.


Model Item Property Tests
set all controls to invalid
set all controls to valid
set all controls to readonly
set all controls to readwrite
set all controls to required
set all controls to optional
set all controls to non-relevant
set all controls to relevant


SweetFreeStuff.com
///////////////////////////////////////////
Free Subscription to Bass Player
Posted: 05 May 2015 11:09 AM PDT
http://feedproxy.google.com/&edburner&utm_medium=email
Free Subscription to Bass Player
The post Free Subscription to Bass Player appeared first on
SweetFreeStuff.com.
///////////////////////////////////////////
Free Innisfree Green Tea Moisturizing Sample Kit
Posted: 05 May 2015 11:08 AM PDT
http://feedproxy.google.com/&edburner&utm_medium=email
\Follow the steps outlined on the page to get it. Free Innisfree Green Tea
Moisturizing Sample Kit
The post Free Innisfree Green Tea Moisturizing Sample Kit appeared first on
SweetFreeStuff.com.
///////////////////////////////////////////
Free Lucky Charms Sample (Twitter)
Posted: 05 May 2015 10:33 AM PDT
http://feedproxy.google.com/&edburner&utm_medium=email
Follow the link and retweet the message, then click the link to get the
free sample. Free Lucky Charms Sample (Twitter)
The post Free Lucky Charms Sample (Twitter) appeared first on
SweetFreeStuff.com.
///////////////////////////////////////////
Free Subscription to CNET Magazine
Posted: 05 May 2015 10:09 AM PDT
http://feedproxy.google.com/&edburner&utm_medium=email
Free Subscription to CNET Magazine
The post Free Subscription to CNET Magazine appeared first on
SweetFreeStuff.com.
///////////////////////////////////////////
Free Sleepy Bear Keychain
Posted: 05 May 2015 09:51 AM PDT
http://feedproxy.google.com/&edburner&utm_medium=email
Enroll in Wyndham Rewards to get a Free Sleepy Bear Keychain. Today only.
Free Sleepy Bear Keychain
The post Free Sleepy Bear Keychain appeared first on SweetFreeStuff.com.
///////////////////////////////////////////
Free Subscription to Diabetic Living
Posted: 05 May 2015 04:16 AM PDT
http://feedproxy.google.com/&edburner&utm_medium=email
Free Subscription to Diabetic Living
The post Free Subscription to Diabetic Living appeared first on
SweetFreeStuff.com.
///////////////////////////////////////////
Free Subscription to National Review Magazine
Posted: 05 May 2015 04:08 AM PDT
http://feedproxy.google.com/&edburner&utm_medium=email
Free Subscription to National Review Magazine
The post Free Subscription to National Review Magazine appeared first on
SweetFreeStuff.com.
///////////////////////////////////////////
15 Free Pampers Gifts to Grow Points
Posted: 05 May 2015 01:15 AM PDT
http://feedproxy.google.com/&edburner&utm_medium=email
To login please click here and enter the
codes: FBCIN5893333315 and TWIT89CNEK11115 for 15 more points. (If you
need to register, click here to sign up and receive 100 points!) The
Pampers Gifts to Grow Rewards Program rewards you for choosing Pampers
diapers, training pants and wipes for your growing baby. To start, simply
collect the codes from all your Continue reading 15 Free Pampers Gifts to
Grow Points
The post 15 Free Pampers Gifts to Grow Points appeared first on
SweetFreeStuff.com.


Probably, the most basic correlation between these two things are the way they look. If you look at a hash in Ruby, you will notice that it is declared in a key/value pattern, in all it's incarnations. There is usually a value, or the 'meat' of the hash, in other words, the thing that is actually returned from the hash when called. Then there is a key, or the 'getter', in other words, the things that is referenced in order to call its associated value. Java-Script objects work the exact same way.
Java-Script objects, are created with curly braces. Is it already looking familiar? Secondly, all Java-Script attributes are declared in key values pairs, via the colon operator. Thirdly, all Java-Script objects come with attribute accessors. That means that all of their attributes are directly callable via attribute name. Fourthly, Java-Script objects, much like Ruby hash elements, may have extra attributes added to them directly and dynamically, after the object was created, much like how Ruby hash elements are added after the hash is created.
RubyHash = {key1: value1, key2:value2, key3:value3, key4:value4} how to call a hash element: RubyHash[key2] => value2 JavaScriptobject = {attribute1:value1, attribute2:value2, attribute3:value3, attribute4:value4} how to access a JS object attribute: JavaScriptobject[attribute2] = value2 (may also be accessed with a 'dot' eg: JavaScriptobject.attribute2 = value2)
In Java-Script, objects come in three forms: constants, variables, and methods. Objects may contain other objects.
All Java-Script objects either contain one constant, or sets of constants working as key/values pairs. (these are variables)
Methods, are declared as variable objects that essential are a 'function' keyword, followed by a pair of parenthesis to optionally encapsulate any parameters the function may have, passed to them by their function call arguments. Then a block of code afterward that acts upon the information given as input (in any), and performs a certain task.
Both may be bypassed by anonymous objects, created in an instant, and gone in an instant.
Both have attributes that store dynamic information and methods that act upon input and/ or the attributes, depending on the nature of the method.
Both may be modified and used dynamically.
(in the form: name={}, where name is the name of the object we are creating.), there are no classes in Java-Script, only methods, so you need to directly declare all object attributes upon creation of the object, or dynamically as new attributes are needed.
Java-Script objects are also created via 'Constructor functions'. These functions, usually starting with a capitol letter, act as object factories, or templates, much in the same way that ruby classes make ruby objects. Attributes in Java-Script objects, (the key-values pairs in ruby hashes) are derived from these special constructor functions via the 'this' keyword. Where the convention is "this.keyName=value" and values are usually arguments passed to parametes of the constructor function when the object is created (via the 'new' keyword).
For example:
0: 1: function Student(name, score) 2: { 3: this.student_name=name; 4: this.student_score=score; 5: this.put_together=function() 6: { 7: return this.student_name+ " scored "+ this.student_score+"% in webslingology." 8: } 9: } 10: var Peter_parker=new Student("Peter Parker", 98) 11: console.log(Peter_parker.put_together()) =>Peter Parker scored 98% in webslingology.
Jaca_script objects have attributes, and some of those attributes may have values that are other objects. (Much in the same way that some hashes have value that are other hashes), but if that value is an object, that has the same attribute in its list of attributes, that also has it's value the object of context, then the keyword '[circular]' will automatically replace that value to tell the user that this relationship is circular. This is important, because a mutual relationship is important for some objects, and it helps up keep track of those in shorthand.


public abstract class FlicBroadcastReceiver
extends BroadcastReceiver
FlicButton.registerListenForBroadcast(int)
.
See also FlicBroadcastReceiverFlags
.| Constructor and Description |
|---|
FlicBroadcastReceiver() |
| Modifier and Type | Method and Description |
|---|---|
void |
onButtonClickOrHold(Context context,
FlicButton button,
boolean wasQueued,
int timeDiff,
boolean isClick,
boolean isHold)
Used for the scenario where you want to listen on button click and hold.
|
void |
onButtonRemoved(Context context,
FlicButton button)
Called when the button was removed in the Flic App, or when the user disconnected this app from the button in the Flic App (if so the button can be grabbed again as usual).
|
void |
onButtonSingleOrDoubleClick(Context context,
FlicButton button,
boolean wasQueued,
int timeDiff,
boolean isSingleClick,
boolean isDoubleClick)
Used for the scenario where you want to listen on single click and double click.
|
void |
onButtonSingleOrDoubleClickOrHold(Context context,
FlicButton button,
boolean wasQueued,
int timeDiff,
boolean isSingleClick,
boolean isDoubleClick,
boolean isHold)
Used for the scenario where you want to listen on single click, double click and hold.
|
void |
onButtonUpOrDown(Context context,
FlicButton button,
boolean wasQueued,
int timeDiff,
boolean isUp,
boolean isDown)
Called when the button was pressed or released.
|
void |
onReceive(Context context,
Intent intent) |
protected abstract void |
onRequestAppCredentials(Context context)
Sets app credentials.
|
public final void onReceive(Context context, Intent intent)
protected abstract void onRequestAppCredentials(Context context)
FlicManager.setAppCredentials(String, String, String)
and set the appropriate app credentials.context
- The Context in which the receiver is runningpublic void onButtonUpOrDown(Context context, FlicButton button, boolean wasQueued, int timeDiff, boolean isUp, boolean isDown)
context
- The Context in which the receiver is runningbutton
- The buttonwasQueued
- If the event was locally queued in the button because it was disconnected. After the connection is completed, the event will be sent with this parameter set to true.timeDiff
- If the event was queued, the timeDiff will be the number of seconds since the event happened.isUp
- True if up, else falseisDown
- True if down, else falsepublic void onButtonClickOrHold(Context context, FlicButton button, boolean wasQueued, int timeDiff, boolean isClick, boolean isHold)
context
- The Context in which the receiver is runningbutton
- The buttonwasQueued
- If the event was locally queued in the button because it was disconnected. After the connection is completed, the event will be sent with this parameter set to true.timeDiff
- If the event was queued, the timeDiff will be the number of seconds since the event happened.isClick
- True if click, else falseisHold
- True if hold, else falsepublic void onButtonSingleOrDoubleClick(Context context, FlicButton button, boolean wasQueued, int timeDiff, boolean isSingleClick, boolean isDoubleClick)
context
- The Context in which the receiver is runningbutton
- The buttonwasQueued
- If the event was locally queued in the button because it was disconnected. After the connection is completed, the event will be sent with this parameter set to true.timeDiff
- If the event was queued, the timeDiff will be the number of seconds since the event happened.isSingleClick
- True if single click, else falseisDoubleClick
- True if double click, else falsepublic void onButtonSingleOrDoubleClickOrHold(Context context, FlicButton button, boolean wasQueued, int timeDiff, boolean isSingleClick, boolean isDoubleClick, boolean isHold)
context
- The Context in which the receiver is runningbutton
- The buttonwasQueued
- If the event was locally queued in the button because it was disconnected. After the connection is completed, the event will be sent with this parameter set to true.timeDiff
- If the event was queued, the timeDiff will be the number of seconds since the event happened.isSingleClick
- True if single click, else falseisDoubleClick
- True if double click, else falseisHold
- True if hold, else falsepublic void onButtonRemoved(Context context, FlicButton button)
context
- The Context in which the receiver is running.button
- The button


TLC594* multi-channel, daisy-chainable, constant-current sink, 12bit PWM LED driver.
More...
|
| static void | initialize (uint16_t channels=0, uint8_t dots=63, bool writeCH=true, bool writeDC=true) |
| |
|
static void | setChannel (uint16_t channel, uint16_t value) |
| | set the 12bit value of a channel call transfer() to update the chip
|
| |
| static void | setAllChannels (uint16_t value, bool update=false) |
| |
|
static uint16_t | getChannel (uint16_t channel) |
| | get the stored 12bit value of a channel this does reflect the actual value in the chip
|
| |
|
static void | setDotCorrection (uint16_t channel, uint8_t value) |
| | set the 6bit dot correction value of a channel call transfer() to update the chip
|
| |
| static void | setAllDotCorrection (uint8_t value, bool update=false) |
| |
|
static uint8_t | getDotCorrection (uint16_t channel) |
| | get the stored 6bit dot correction value of a channel this does reflect the actual value in the chip
|
| |
|
static void | writeChannels (bool flush=true) |
| | transfer channel data to driver chip
|
| |
|
static void | writeDotCorrection () |
| | transfer dot correction data to driver chip
|
| |
|
static void | latch () |
| | writes data from the input shift register to either GS or DC register.
|
| |
| static bool | isError () |
| |
|
static uint8_t * | getGrayscaleData () |
| |
|
static uint8_t * | getDotCorrectionData () |
| |
|
static uint8_t * | getStatusData () |
| |
template<uint16_t CHANNELS, typename Spi, typename Xlat, typename Vprog = xpcc::GpioUnused, typename Xerr = xpcc::GpioUnused>
class xpcc::TLC594X< CHANNELS, Spi, Xlat, Vprog, Xerr >
This class does not use the DCPRG pin, as writing to the EEPROM requires 22V to be applied to Vprog, requiring additional external circuits. Use of any EEPROM functions is therefore not implemented here. Make sure that pin is connected to Vcc, otherwise Dot Correction does not work.
This class also does not control the BLANK pin, as the setup of the timer to drive that pin is platform and configuration specific. Switching off all LEDs using one command is not implemented here.
This driver can be used for the 16-channel TLC5940 and 24-channel TLC5947 and probably similar TLC59s as well, simply by adjusting the number of CHANNELS. Therefore this class can also be used with daisy-chained TLC59s, e.g. to control two TLC5940s set CHANNELS to 2*16.
WARNING
Each channel in the TLC594x chip drives a transistor using a feedback loop to make it meet a particular current requirement. If a channel is disconnected, the feedback loop will fully drive the transistor. If most of the channels are disconnected (quite common in a testing environment if not in production), this will end up pulling quite a bit of power from the chip's 3.3 or 5v supply. This can significantly heat up the chip and cause power supply issues.
- Template Parameters
-
| CHANNELS | Number of channels must be multiples of 4, adjust for daisy-chained chips |
| Spi | Spi interface |
| Xlat | Level triggered latch pin |
| Vprog | Vprog pin, use xpcc::GpioUnused if not connected |
| Xerr | Error pin, use xpcc::GpioUnused if not connected |
- Author
- Niklas Hauser


Distributing PHP applications
over http
microservices obligatory buzzword
Giorgio Sironi
Giorgio Sironi (@giorgiosironi)
- I'm a developer (writes code, design stuff)
- Interested in
- Object-oriented programming
- Automated testing and TDD
- Distributed systems
Context
Probably already distributing
| JavaScript Client(*) |
| PHP Web server(*) |
| MySQL database |
| Headless Client(*) |
| PHP Web server(*) |
| MongoDB database |
Why distributing along microservices
- code segregation (hopefully with decoupling as fitness function)
- scalability problems identification
- isolation of failures
- team partitioning (Conway's law)
The problems
| latency |
chatty interfaces, N+1 query problem |
| concurrency |
lost updates, race conditions |
| partial failure |
Another application does not respond (and you don't know why) |
4 styles of integration
File upload
Shared Database
Remote Procedure Call
Asynchronous messaging
HTTP microservices
> POST /messages
> User-Agent: curl/7.32.0
> Host: connectivity.onebip.com
> Accept: application/json
> Content-Type: application/json
>
> {"text":"Hello world", "phonenumber": "39.......",
..., "message": "http://www.onebip.com/message/123"}
< HTTP/1.1 202 Accepted
< Date: Mon, 22 Sep 2014 07:17:26 GMT
Easy: authentication
Trusted environment (VPC/LAN) for some applications
X-Authentication header carrying a signed timestamp
Easy: backward compatibility
| A |
B |
Initial versions |
| A |
B |
Intermediate version of A, having both old and new field name |
| A |
B |
New version of B using new name |
| A |
B |
New version of A only sending new field name |
Medium: latency
Moving the Domain Model from RPC to messaging
Hard: failure
* Could not resolve host: connectivity.onebip.com
* Closing connection 0
curl: (6) Could not resolve host: connectivity.onebip.com
Hard: failure
Messaging over HTTP with an internal job system
Moving Infrastructure from RPC to messaging
Messaging from A to B
Asynchronous commands, possibly with callbacks
A -> B
Job in A
$request = Onebip\Http\Request::to('http://connectivity.onebip.com/messages', 'POST')
->withBody(...)
->withAuthentication()
->asJob()
->ensureIs(200, 409)
->inBackground()
->send();
Frees B from having to be up and running all the time, network partitions
Aspects: messaging semantics
You should probably never do anything with the result of an external call
/**
* @return void
*/
function send(RequestJob $job);
Aspects: idempotence
Retrying the delivery of a message leads to the same end result than the original call
$ curl -v -X POST http://...
...
> Timeout
$ curl -v -X POST http://...
...
> HTTP/1.1 409 Conflict
Aspects: retry policy
- new DontRetry()
- new RetryOnce() (the most difficult step)
- RetryManyTimes::forTimes($n)->spaced(60)
- ExponentialBackoff::atFirstWaiting(5)->upTo(3600)
Aspects: queue persistence
My message queue delivers 4 gazillion messages/hour!
With what persistence?
RAM, filesystem of a single machine?
Or a database with replica?
Conclusion
decoupled PHP applications can collaborate over HTTP
reducing latency requires a messaging architecture over RPC
a job system can then deal with failure
produce events, send them to someone else


Report: PSG consider swoop for Liverpool’s Adam Lallana
Adam Lallana is out of contract next summer.
by Jay WilliamsParis Saint-Germain want to sign Liverpool midfielder Adam Lallana, according to The Mirror.
Liverpool could lose Lallana with PSG ready to open pre-contract negotiations in January. Lallana is out of contract in summer 2020 so PSG can sign him on a free transfer for next season.
Lallana has been a bit-part player at Liverpool recently after a string of injuries. The England midfielder has also lost his place in the national team.
However, PSG are ready to hand him a lifeline and offer him the chance to play in France. PSG are the reigning Ligue 1 champions and looked nailed on to win the league again.
PSG want a new winger because Edinson Cavani is leaving. The Uruguayan is heading to the United States to join LA Galaxy as Zlatan Ibrahimovic’s replacement. So PSG want Lallana to fill the void Cavani will leave.
TBR’s view
This is a potentially bizarre transfer. PSG can offer Lallana the chance to win the league in France and compete in Champions League football so it will be a similar project to his current role as a Liverpool bit-part player.
At this stage of his career, the 31-year-old needs to think about his playing time. After five years at Liverpool, it could be the time to move on and this is an exciting opportunity.
Have something to tell us about this article?
Let us know


DELIVERY CHARGE
FROM POSTCODE : {{origincity | uppercase}}
TO POSTCODE : {{destinationcity | uppercase}}
ITEM TYPE : {{itemType | uppercase}} | WEIGHT : {{inputWeight}} KG
| Delivery Fee |
{{deliverycharge | number: '1.2-2'}} |
| Surcharges |
{{surcharge | number: '1.2-2'}} |
| Estimated Price |
{{price | number: '1.2-2'}} |
- All prices are inclusive of 6 % SST.
- Surcharge are estimated for Out of Delivery Area.
- Weight are applied based on Volumetric Weight (L x W x H /6000) or actual
weight whichever is higher.
- Line Clear Express reserves the right to change the rate without prior
notice.


CONTINUE
StatementWHILE
or
FOR
loop. It is an error to call CONTINUE
outside of a
WHILE
or FOR
loop.CONTINUE;
-- Prints the odd numbers from 1 to 9.
DECLARE @counter = 0;
WHILE @counter < 10 BEGIN
SET @counter = @counter + 1;
IF @counter % 2 = 0 -- True for even numbers.
CONTINUE;
PRINT @counter;
END


If the task number you're looking for is not listed, please contact your supervisor or the Emergency Coordination Centre.


Setup and Options
Options Page:
Right after your first start you should open the Option page and configure the rules you want to use.
There are also options for printing.
Use Feat Rules for Pilots:
This enables/disables the language and feat drop-down-menus in the pilot window.
Use Max. Aircraft Characteristics:
This enables/disables the validation of the maximum aircraft characteristics,
which is loaded from the aircraftConfigs.ae file.
Modified Rocket Hardpoint Mass Reduction:
The official rule is that each RHP that is removed, reduces the weight of 10 lbs. The preset custom rules
reduces the weight of 125 lbs. (which is the FF5 housrule). You can adjust the custom value if you change the
ruleConfigs.ae file. How you do that is described here.
Print Aircraft Flavor Sheet:
If this option is checked, you print also the flavor sheet.
Using the FF5 Loadout Housrule:
If you look into to the "data" sub-directory you will find 3 different baseData files.


Off-The-Record
Profile
- First Name:
- Last Name:
Privacy
- View Profile:
- Search:
- Friend Request:
- Start Conversation:
Danger Zone
Conversations
- No active conversations
Friends
Requests
Sent
Received
Friends:
Friends of Friends:
Non-Friends:
Online Friends
None of your friends are online :(


Example app¶
We’ll be building a simple twitter-like site. The source code for the example can be found in the examples/twitter
directory. You can also browse the source-code on github. There is also an example blog app if that’s more to your liking.
The example app uses the flask web framework which is very easy to get started with. If you don’t have flask already, you will need to install it to run the example:
pip install flask
Running the example¶
After ensuring that flask is installed, cd
into the twitter example directory and execute the run_example.py
script:
python run_example.py
The example app will be accessible at http://localhost:5000/
Diving into the code¶
For simplicity all example code is contained within a single module, examples/twitter/app.py
. For a guide on structuring larger Flask apps with peewee, check out Structuring Flask Apps.
Models¶
In the spirit of the popular web framework Django, peewee uses declarative model definitions. If you’re not familiar with Django, the idea is that you declare a model class for each table. The model class then defines one or more field attributes which correspond to the table’s columns. For the twitter clone, there are just three models:
- User:
- Represents a user account and stores the username and password, an email address for generating avatars using gravatar, and a datetime field indicating when that account was created.
- Relationship:
- This is a utility model that contains two foreign-keys to the User model and stores which users follow one another.
- Message:
- Analagous to a tweet. The Message model stores the text content of the tweet, when it was created, and who posted it (foreign key to User).
If you like UML, these are the tables and relationships:
In order to create these models we need to instantiate a SqliteDatabase
object. Then we define our model classes, specifying the columns as Field
instances on the class.
# create a peewee database instance -- our models will use this database to
# persist information
database = SqliteDatabase(DATABASE)
# model definitions -- the standard "pattern" is to define a base model class
# that specifies which database to use. then, any subclasses will automatically
# use the correct storage.
class BaseModel(Model):
class Meta:
database = database
# the user model specifies its fields (or columns) declaratively, like django
class User(BaseModel):
username = CharField(unique=True)
password = CharField()
email = CharField()
join_date = DateTimeField()
class Meta:
order_by = ('username',)
# this model contains two foreign keys to user -- it essentially allows us to
# model a "many-to-many" relationship between users. by querying and joining
# on different columns we can expose who a user is "related to" and who is
# "related to" a given user
class Relationship(BaseModel):
from_user = ForeignKeyField(User, related_name='relationships')
to_user = ForeignKeyField(User, related_name='related_to')
class Meta:
indexes = (
# Specify a unique multi-column index on from/to-user.
(('from_user', 'to_user'), True),
)
# a dead simple one-to-many relationship: one user has 0..n messages, exposed by
# the foreign key. because we didn't specify, a users messages will be accessible
# as a special attribute, User.message_set
class Message(BaseModel):
user = ForeignKeyField(User)
content = TextField()
pub_date = DateTimeField()
class Meta:
order_by = ('-pub_date',)
Note
Note that we create a BaseModel class that simply defines what database we would like to use. All other models then extend this class and will also use the correct database connection.
Peewee supports many different field types which map to different column types commonly supported by database engines. Conversion between python types and those used in the database is handled transparently, allowing you to use the following in your application:
- Strings (unicode or otherwise)
- Integers, floats, and
Decimal
numbers. - Boolean values
- Dates, times and datetimes
None
(NULL)- Binary data
Creating tables¶
In order to start using the models, its necessary to create the tables. This is a one-time operation and can be done quickly using the interactive interpreter. We can create a small helper function to accomplish this:
def create_tables():
database.connect()
database.create_tables([User, Relationship, Message])
Open a python shell in the directory alongside the example app and execute the following:
>>> from app import *
>>> create_tables()
Note
If you encounter an ImportError it means that either flask or peewee was not found and may not be installed correctly. Check the Installing and Testing document for instructions on installing peewee.
Every model has a create_table()
classmethod which runs a SQL CREATE TABLE statement in the database. This method will create the table, including all columns, foreign-key constaints, indexes, and sequences. Usually this is something you’ll only do once, whenever a new model is added.
Peewee provides a helper method Database.create_tables()
which will resolve inter-model dependencies and call create_table()
on each model.
Note
Adding fields after the table has been created will required you to either drop the table and re-create it or manually add the columns using an ALTER TABLE query.
Alternatively, you can use the schema migrations extension to alter your database schema using Python.
Note
You can also write database.create_tables([User, ...], True)
and peewee will first check to see if the table exists before creating it.
Establishing a database connection¶
You may have noticed in the above model code that there is a class defined on the base model named Meta that sets the database
attribute. Peewee allows every model to specify which database it uses. There are many Meta options you can specify which control the behavior of your model.
This is a peewee idiom:
DATABASE = 'tweepee.db'
# Create a database instance that will manage the connection and
# execute queries
database = SqliteDatabase(DATABASE, threadlocals=True)
When developing a web application, it’s common to open a connection when a request starts, and close it when the response is returned. You should always manage your connections explicitly. For instance, if you are using a connection pool, connections will only be recycled correctly if you call connect()
and close()
.
We will tell flask that during the request/response cycle we need to create a connection to the database. Flask provides some handy decorators to make this a snap:
@app.before_request
def before_request():
g.db = database
g.db.connect()
@app.after_request
def after_request(response):
g.db.close()
return response
Note
We’re storing the db on the magical variable g
- that’s a
flask-ism and can be ignored as an implementation detail. The important
takeaway is that we connect to our db every request and close that connection
when we return a response.
Making queries¶
In the User model there are a few instance methods that encapsulate some user-specific functionality:
following()
: who is this user following?followers()
: who is following this user?
These methods are similar in their implementation but with an important difference in the SQL JOIN and WHERE clauses:
def following(self):
# query other users through the "relationship" table
return (User
.select()
.join(Relationship, on=Relationship.to_user)
.where(Relationship.from_user == self))
def followers(self):
return (User
.select()
.join(Relationship, on=Relationship.from_user)
.where(Relationship.to_user == self))
Creating new objects¶
When a new user wants to join the site we need to make sure the username is available, and if so, create a new User record. Looking at the join() view, we can that our application attempts to create the User using Model.create()
. We defined the User.username field with a unique constraint, so if the username is taken the database will raise an IntegrityError
.
try:
with database.transaction():
# Attempt to create the user. If the username is taken, due to the
# unique constraint, the database will raise an IntegrityError.
user = User.create(
username=request.form['username'],
password=md5(request.form['password']).hexdigest(),
email=request.form['email'],
join_date=datetime.datetime.now()
)
# mark the user as being 'authenticated' by setting the session vars
auth_user(user)
return redirect(url_for('homepage'))
except IntegrityError:
flash('That username is already taken')
We will use a similar approach when a user wishes to follow someone. To indicate a following relationship, we create a row in the Relationship table pointing from one user to another. Due to the unique index on from_user
and to_user
, we will be sure not to end up with duplicate rows:
user = get_object_or_404(User, username=username)
try:
with database.transaction():
Relationship.create(
from_user=get_current_user(),
to_user=user)
except IntegrityError:
pass
Performing subqueries¶
If you are logged-in and visit the twitter homepage, you will see tweets from the users that you follow. In order to implement this cleanly, we can use a subquery:
# python code
messages = Message.select().where(Message.user << user.following())
This code corresponds to the following SQL query:
SELECT t1."id", t1."user_id", t1."content", t1."pub_date"
FROM "message" AS t1
WHERE t1."user_id" IN (
SELECT t2."id"
FROM "user" AS t2
INNER JOIN "relationship" AS t3
ON t2."id" = t3."to_user_id"
WHERE t3."from_user_id" = ?
)
Other topics of interest¶
There are a couple other neat things going on in the example app that are worth mentioning briefly.
Support for paginating lists of results is implemented in a simple function called
object_list
(after it’s corollary in Django). This function is used by all the views that return lists of objects.def object_list(template_name, qr, var_name='object_list', **kwargs): kwargs.update( page=int(request.args.get('page', 1)), pages=qr.count() / 20 + 1 ) kwargs[var_name] = qr.paginate(kwargs['page']) return render_template(template_name, **kwargs)
Simple authentication system with a
login_required
decorator. The first function simply adds user data into the current session when a user successfully logs in. The decoratorlogin_required
can be used to wrap view functions, checking for whether the session is authenticated and if not redirecting to the login page.def auth_user(user): session['logged_in'] = True session['user'] = user session['username'] = user.username flash('You are logged in as %s' % (user.username)) def login_required(f): @wraps(f) def inner(*args, **kwargs): if not session.get('logged_in'): return redirect(url_for('login')) return f(*args, **kwargs) return inner
Return a 404 response instead of throwing exceptions when an object is not found in the database.
def get_object_or_404(model, *expressions): try: return model.get(*expressions) except model.DoesNotExist: abort(404)
More examples¶
There are more examples included in the peewee examples directory, including:
- Example blog app using Flask and peewee. Also see accompanying blog post.
- An encrypted command-line diary. There is a companion blog post you might enjoy as well.
- Analytics web-service (like a lite version of Google Analytics). Also check out the companion blog post.
Note
Like these snippets and interested in more? Check out flask-peewee - a flask plugin that provides a django-like Admin interface, RESTful API, Authentication and more for your peewee models.