Pygments
The full Pygments API
« Back To IndexContents
This page describes the Pygments API.
High-level API
Functions from the pygments module:
- def lex(code, lexer):
- Lex code with the lexer (must be a Lexer instance) and return an iterable of tokens. Currently, this only calls lexer.get_tokens().
- def format(tokens, formatter, outfile=None):
- Format a token stream (iterable of tokens) tokens with the formatter (must be a Formatter instance). The result is written to outfile, or if that is None, returned as a string.
- def highlight(code, lexer, formatter, outfile=None):
- This is the most high-level highlighting function. It combines lex and format in one function.
Functions from pygments.lexers:
- def get_lexer_by_name(alias, **options):
Return an instance of a Lexer subclass that has alias in its aliases list. The lexer is given the options at its instantiation.
Will raise pygments.util.ClassNotFound if no lexer with that alias is found.
- def get_lexer_for_filename(fn, **options):
Return a Lexer subclass instance that has a filename pattern matching fn. The lexer is given the options at its instantiation.
Will raise pygments.util.ClassNotFound if no lexer for that filename is found.
- def get_lexer_for_mimetype(mime, **options):
Return a Lexer subclass instance that has mime in its mimetype list. The lexer is given the options at its instantiation.
Will raise pygments.util.ClassNotFound if not lexer for that mimetype is found.
- def guess_lexer(text, **options):
Return a Lexer subclass instance that's guessed from the text in text. For that, the analyse_text() method of every known lexer class is called with the text as argument, and the lexer which returned the highest value will be instantiated and returned.
pygments.util.ClassNotFound is raised if no lexer thinks it can handle the content.
- def guess_lexer_for_filename(filename, text, **options):
As guess_lexer(), but only lexers which have a pattern in filenames or alias_filenames that matches filename are taken into consideration.
pygments.util.ClassNotFound is raised if no lexer thinks it can handle the content.
- def get_all_lexers():
Return an iterable over all registered lexers, yielding tuples in the format:
(longname, tuple of aliases, tuple of filename patterns, tuple of mimetypes)
New in Pygments 0.6.
Functions from pygments.formatters:
- def get_formatter_by_name(alias, **options):
Return an instance of a Formatter subclass that has alias in its aliases list. The formatter is given the options at its instantiation.
Will raise pygments.util.ClassNotFound if no formatter with that alias is found.
- def get_formatter_for_filename(fn, **options):
Return a Formatter subclass instance that has a filename pattern matching fn. The formatter is given the options at its instantiation.
Will raise pygments.util.ClassNotFound if no formatter for that filename is found.
Functions from pygments.styles:
- def get_style_by_name(name):
Return a style class by its short name. The names of the builtin styles are listed in pygments.styles.STYLE_MAP.
Will raise pygments.util.ClassNotFound if no style of that name is found.
- def get_all_styles():
Return an iterable over all registered styles, yielding their names.
New in Pygments 0.6.
Lexers
A lexer (derived from pygments.lexer.Lexer) has the following functions:
- def __init__(self, **options):
The constructor. Takes a **keywords dictionary of options. Every subclass must first process its own options and then call the Lexer constructor, since it processes the stripnl, stripall and tabsize options.
An example looks like this:
def __init__(self, **options): self.compress = options.get('compress', '') Lexer.__init__(self, **options)
As these options must all be specifiable as strings (due to the command line usage), there are various utility functions available to help with that, see Option processing.
- def get_tokens(self, text):
This method is the basic interface of a lexer. It is called by the highlight() function. It must process the text and return an iterable of (tokentype, value) pairs from text.
Normally, you don't need to override this method. The default implementation processes the stripnl, stripall and tabsize options and then yields all tokens from get_tokens_unprocessed(), with the index dropped.
- def get_tokens_unprocessed(self, text):
This method should process the text and return an iterable of (index, tokentype, value) tuples where index is the starting position of the token within the input text.
This method must be overridden by subclasses.
- def analyse_text(text):
- A static method which is called for lexer guessing. It should analyse the text and return a float in the range from 0.0 to 1.0. If it returns 0.0, the lexer will not be selected as the most probable one, if it returns 1.0, it will be selected immediately.
For a list of known tokens have a look at the Tokens page.
A lexer also can have the following attributes (in fact, they are mandatory except alias_filenames) that are used by the builtin lookup mechanism.
- name
- Full name for the lexer, in human-readable form.
- aliases
- A list of short, unique identifiers that can be used to lookup the lexer from a list, e.g. using get_lexer_by_name().
- filenames
- A list of fnmatch patterns that match filenames which contain content for this lexer. The patterns in this list should be unique among all lexers.
- alias_filenames
- A list of fnmatch patterns that match filenames which may or may not contain content for this lexer. This list is used by the guess_lexer_for_filename() function, to determine which lexers are then included in guessing the correct one. That means that e.g. every lexer for HTML and a template language should include \*.html in this list.
- mimetypes
- A list of MIME types for content that can be lexed with this lexer.
Formatters
A formatter (derived from pygments.formatter.Formatter) has the following functions:
- def __init__(self, **options):
As with lexers, this constructor processes options and then must call the base class __init__.
The Formatter class recognizes the options style, full and title. It is up to the formatter class whether it uses them.
- def get_style_defs(self, arg=''):
This method must return statements or declarations suitable to define the current style for subsequent highlighted text (e.g. CSS classes in the HTMLFormatter).
The optional argument arg can be used to modify the generation and is formatter dependent (it is standardized because it can be given on the command line).
This method is called by the -S command-line option, the arg is then given by the -a option.
- def format(self, tokensource, outfile):
This method must format the tokens from the tokensource iterable and write the formatted version to the file object outfile.
Formatter options can control how exactly the tokens are converted.
 (New in Pygments 0.7.)
- name
- Full name for the formatter, in human-readable form.
- aliases
- A list of short, unique identifiers that can be used to lookup the formatter from a list, e.g. using get_formatter_by_name().
- filenames
- A list of fnmatch patterns that match filenames for which this formatter can produce output. The patterns in this list should be unique among all formatters.
Option processing
The pygments.util module has some utility functions usable for option processing:
- class OptionError
- This exception will be raised by all option processing functions if the type or value of the argument is not correct.
- def get_bool_opt(options, optname, default=None):
Interpret the key optname from the dictionary options as a boolean and return it. Return default if optname is not in options.
The valid string values for True are 1, yes, true and on, the ones for False are 0, no, false and off (matched case-insensitively).
- def get_int_opt(options, optname, default=None):
- As get_bool_opt, but interpret the value as an integer.
- def get_list_opt(options, optname, default=None):
- If the key optname from the dictionary options is a string, split it at whitespace and return it. If it is already a list or a tuple, it is returned as a list.
- def get_choice_opt(options, optname, allowed, default=None):
- If the key optname from the dictionary is not in the sequence allowed, raise an error, otherwise return it. New in Pygments 0.8.


Inpei102.github.io
Carrier 42QTD018R8S Series Handbücher.
Carrier 42QTD018R8S Series Handbücher and Lowrance Elite-9 Handbücher.


You can currently bag £400 off glamorous cruises to Dubai and Abu Dhabi
Royal Caribbean's Jewel of the Seas is setting off on some glamorous sailings in 2020 across Dubai and Abu Dhabi and there are currently cruise deals to be had
by Julie Delahaye, https://www.facebook.com/juliedjournoThinking of kicking off 2020 in style with a glamorous cruise holiday, exploring new cities and getting plenty of winter sun? Then you might want to check out Mirror Cruise's latest deal.
The cruise deals website currently has an eight-night Jewel of the Emirates holiday package, which includes a seven-night cruise on board Jewel of the Seas, an overnight stay in Dubai and your return flights.
The seven-night Jewel of the Seas cruise has some very glamorous ports of call on its itinerary; we're talking the likes of Dubai Doha, Bahrain, Sir Bani Yas Island and Abu Dhabi, as well as a day at sea.
The holiday usually costs £1,099pp but you can currently bag it from £699pp with Mirror Cruise . (It's worth noting that the cheapest prices are subject to availability).
The price is based on two people sharing a cabin, so that makes for a saving of £800 per couple!
Jewel of the Seas alone makes for quite a glamorous getaway.
The cruise ship underwent a £20million renovation in 2016 complete with new staterooms, three new restaurants and wine bars, a poolside movie screen and a rock-climbing wall.
Other highlights on board the ship also includes Broadway-style shows, an adults-only solarium, movies under the stars, sushi-making classes and even mini golf.
Then of course there'll be ample opportunity to explore the cities whether you're taking in Dubai's incredible skyline, home to the world's tallest building the Burj Khalifa, or exploring the picturesque beaches in Abu Dhabi.
The deal is valid for the itinerary departing on the 2nd February 2020 - perfect if you're after winter sun - but don't be disheartened if you can't quite make the offer work for you on that date.
There are heaps more itineraries with similar itineraries from January to March 2020, with prices starting from £729pp.
You can check out the discounted packages on the Mirror Cruise website , including more Dubai & Emirates cruises if you're looking for different travel dates.


This lifts a predicate A -> Bool
to a transducer from A
to A
.
We can use these functions to lift functions and predicates to transducers, and then feed them into reduce
. In particular, consider mapping(square)
. That lifts square
to a transducer ((C, Int) -> C) -> ((C, Int) -> C)
, where C
can be any data type. If we feed a reducer into mapping(square)
we get another reducer. A simple reducer that comes up often when dealing with arrays is append
, which Swift doesn't have natively implemented but we can do easily enough:


Creative Crosswalks was a project that the city of Muncie started to increase awareness of the different neighborhoods and what they have to offer in Muncie. Read more about the Creative Crosswalks project from Muncie Action Plan here! Read about the project from the Ball State Daily News here! I was a designer for Riverside Normal City Neighborhood. Working with the neighborhood association, the Ball State Architecture school, and Muncie Arts and Culture Council, we designed a logo and a crosswalk that highlighted the music venues, restaurants, and cultural offerings of the neighborhood. The project consisted of identity design and painting crosswalks in the neighborhood.


A cannon used to fire cannonballs in a construction map.
More...
|
|
Vector2 | DPosition = new Vector2() |
| | The position of the cannon.
|
| |
|
|
static Vector2 | CSize = new Vector2(2, 2) |
| | The size of the cannon: (2, 2)
|
| |
A cannon used to fire cannonballs in a construction map.
| game.CCannon.CCannon |
( |
CGame |
game, |
|
|
Vector2 |
position |
|
) |
| |
Creates a new cannon at a position and initializes the initial velocities.
- Parameters
-
| position | The position of the cannon |
| final void game.CCannon.CannonballDestroyed |
( |
CGame |
game | ) |
|
pushes cannon back into owner's ready cannon queue when cannonball dies
- Parameters
-
| game | the game the cannon is in |
| final void game.CCannon.Draw2D |
( |
CGame |
game | ) |
|
Draws the 2D tile for the cannon.
- Parameters
-
| final void game.CCannon.Draw3D |
( |
CGame |
game | ) |
|
Draws the 3D tile for its owner if it has one.
- Parameters
-
| final void game.CCannon.FireAt |
( |
CGame |
game, |
|
|
Vector2 |
target |
|
) |
| |
Fires a cannonball at the target and adds the plume animation.
- Parameters
-
| game | The game to fire in |
| target | The position of the target |
Gets the owner of the cannon based on the floor tile it is located on.
- Parameters
-
| game | The game to search for tile |
- Returns
- Pointer to owner or NULL
| final void game.CCannon.Update |
( |
CGame |
game | ) |
|
Does nothing.
- Parameters
-
| game | The game to update in |
The documentation for this class was generated from the following file:
- android/src/game/CCannon.java


{% extends 'email/email_base.html' %} {% block content %}
|
April News From Origin Protocol
It has been another amazing month at Origin Protocol! We are working hard to build the sharing economy without intermediaries. We are so excited to have a so many people from all and the globe joining us on our journey! Strategic SaleWe are happy to announce that Origin has raised $28.5M in our strategic sale. These strategic partners include traditional Venture Capital firms, top Silicon Valley angel investors, global cryptocurrency funds, and founders of other leading blockchain companies. While this round was limited to accredited investors, we are currently working on multiple projects that are focused on giving the broader community an ability to participate in our platform in a meaningful way. Read the full funding announcement on our blog.CommunityWe now have over 23,000 members on Telegram! This is all organic without any sort of bounties or airdrop. We are thankful to those who invited friends and family into our community. ProductWe have been heads down and working hard developing Origin.js, our smart contract library, and other components of our platform. Identity is the foundation of much of what we are building, and we’re proud of the ground-breaking work we’ve been doing in this area. We recently announced our support of ERC 725 and open-sourced our identity playground. This is the first known working implementation of this identity standard, authored by Fabian Vogelsteller (creator of the ERC 20 standard, the Mist browser and Web3) and we’re excited to implement this open standard as part of the Origin platform.Over 40 people have now contributed to our open-source codebase and we are thankful for the amount of enthusiasm from the open-source community. Stan James is doing an amazing job coordinating a truly global team. PartnershipsWe are thrilled that over 45 marketplace partners have signed commitments to build on Origin’s platform. We will be supporting some of the top teams in blockchain like CanYa and Spin (Pin Protocol), as well as thriving marketplaces like ServisHero (freelancing in Southeast Asia) and Kozaza (homesharing in Korea) that are moving their businesses to the blockchain.SecurityWe had a few phishing sites pop up and try to scam our users. If you see an email that looks like it's from us, be sure to verify the information on our Telegram and website to make sure it is really from us. Please report any suspicious activity to<EMAIL_ADDRESS>immediately.EventsWe have spoken at several conferences lately (Beyond Blocks Tokyo, ETHDenver, CryptoBlockCon in LA, GMIC in Beijing) and will be attending more throughout the year. Our cofounder Matt Liu is currently on the road giving presentations, meeting with our community, and talking to potential partners in Asia. Matt has met with several sharing economy giants such as Grab (which recently acquired Uber in Southeast Asia), Ofo, GO-JEK, and Xiaozhu and enjoyed the chance to learn from them while sharing our perspective on how the blockchain will impact the sharing economy. Members of the Origin team will also be attending the following blockchain conferences, and we’d love to say hello if you’re going to be attending:
Know any other conferences we should be speaking at? Email<EMAIL_ADDRESS>Join our Telegram to get more regular news updates or Join our Discord if you want to get more involved with our work. Thanks to everyone for being a part of our community. We couldn't do this without you. Cheers from Origin Protocol! |


Girl Develop It is here to provide affordable and accessible programs to learn software through mentorship and hands-on instruction.
Some “rules”
In this section, we will learn:
There are a couple of ways of doing this, including the createdb command line tool, but the easiest is use the create database command while logged into the running PostgreSQL instance:
yourusername# create database db_name_goes_here;
If a database with that name already exists, you’ll get an error like this:
yourusername# ERROR: database "test_db" already exists
While logged into your running PostgreSQL instance, create a database called test_db.
It’s okay if you’re currently connected to the furbabies database.
You can still create a new database from there.
furbabies# create database test_db;
CREATE TABLE animal (
id serial PRIMARY KEY,
shelter_id uuid NOT NULL CONSTRAINT shelter_id_unique UNIQUE,
name varchar(255),
date_of_birth date,
type varchar(5) NOT NULL,
gender varchar(1),
altered boolean NOT NULL DEFAULT FALSE,
ok_with_dogs boolean NOT NULL DEFAULT FALSE,
ok_with_cats boolean NOT NULL DEFAULT FALSE,
date_of_surrender date NOT NULL
);
Connect to test_db and create a new table called fav_book
Right now, we’ll only add the id column, but never fear!
We’ll add more columns soon ;)
furbabies# \c test_db;
test_db# CREATE TABLE fav_book(id serial PRIMARY KEY);
Now if we look at all the tables in our new database, we should see the fav_book table!
test_db# \dt;
List of relations
Schema | Name | Type | Owner
--------+-----------+-------+---------
public | fav_book | table | yourusername
(1 row)
The DROP statement is used to delete a table from a database.
test_db# DROP TABLE fav_book;
test_db# \dt
No relations found.
test_db=# drop table fav_book;
DROP TABLE
test_db=# \dt
No relations found.
test_db=# drop table fav_book;
ERROR: table "fav_book" does not exist
test_db# DROP TABLE IF EXISTS fav_book;
NOTICE: table "fav_book" does not exist, skipping
DROP TABLE
You can use ALTER TABLE to:
You can also use the IF EXISTS or IF NOT EXISTS keywords to avoid errors, for example, when trying to drop a column that does not exist or trying to add a column that already exists.
ALTER TABLE fav_book ADD COLUMN IF NOT EXISTS whoopee_im_a_real_boy_now boolean;
Recreate the fav_book table (protip: use the up arrow until you see the create table statement we used earlier).
furbabies# \c test_db;
test_db# CREATE TABLE fav_book(id serial PRIMARY KEY);
Let’s add a column for the book title. The general format will look like:
furbabies# ALTER TABLE table_name ADD COLUMN column_name data_type default_value contraints;
Design questions: What should we name the new column? What data type do you think it should be?
alter table fav_book add column title varchar(128);
alter table fav_book add column title varchar(255) not null;
alter table fav_book add column book_title varchar(500) default 'no title';
alter table fav_book add column book_title varchar(500) not null default 'no title';
Now if we describe the fav_book table, we should see our new
column and any constraints or defaults we’ve added.
Depending on how you have declared your new column, you may
see something different:
test_db# \d+ fav_book;
Table "public.fav_book"
Column | Type | Modifiers | Storage | Stats target | Description
------------+------------------------+--------------------------------------------------------+----------+--------------+-------------
id | integer | not null default nextval('fav_book_id_seq'::regclass) | plain | |
book_title | character varying(500) | not null default 'no title'::character varying | extended | |
Indexes:
"fav_book_pkey" PRIMARY KEY, btree (id)
ALTER TABLE won’t do things like rename columns for us.
It also won’t magically solve tricky conversions like changing
a varchar column to a number column.
So, what do we do in these cases?
The exact solution depends on the problem, but in general, you would
first add a new column. Then, you would migrate the data over from
the old column to the new column, running any necessary conversion
logic in the process. Finally, you would drop the old column.
We’ve talked about these a little bit so far, and we’ve
made use of foreign keys when we were writing all those awesome joins.
When we declared our new fav_book table, we created the id column as a
primary key:
CREATE TABLE fav_book(id serial PRIMARY KEY);
When you declare a primary key, you get the unique constraint for free.
A table can only have one primary key, but the primary key does not always
have to be a single column. You can specify a composite key, instead.
(But we’re only using single-column primary keys in this series.)
Another thing you should know is that primary keys can’t be null (except in Sqlite ¯\_(ツ)_/¯).
To create a foreign key, you would specify the reference with the aptly named REFERENCES keyword.
For example, here’s how the adoption table was created:
CREATE TABLE adoption (
id serial PRIMARY KEY,
adoption_date date,
person_id bigint REFERENCES person (id),
animal_id bigint REFERENCES animal (id)
);
The template for adding a FK when declaring a column looks like this:
name_of_new_column data_type_of_original_column REFERENCES original_table (original_column_name)
Things to remember:
The data type of the referencing column should be exactly the same
as the original column. After all, it will hold exactly the same kind of data.
(Remember that in Postgres, serial is really bigint under the covers.)
You can add a foreign key (or indeed, any constraint) after the column
has already been created.
If you do, though, you’ll need to make sure
that the data in the column already conforms to the constraint.
If it does not, you will need to run a data migration to update the
data appropriately before adding the constraint.
Let’s create a new table called author, which the fav_book table will reference.
It should have at least 2 columns: an id (which is the primary key) and
a column or set of columns for the author’s name.
Then we can add a column to the fav_book table that is foreign keyed
to the newly created author table.
Work with a partner or rock it on your own!
test_db# CREATE TABLE author (
id serial PRIMARY KEY,
name varchar(255)
);
test_db# CREATE TABLE author (
id serial PRIMARY KEY,
first_name varchar(128),
last_name varchar(128)
);
test_db# ALTER TABLE fav_book ADD COLUMN author_id bigint REFERENCES author(id);
test_db# ALTER TABLE fav_book ADD COLUMN author_id bigint NOT NULL REFERENCES author(id);
Once we’ve added a foreign key, we’ve also added a dependency.
We cannot create reference a table that does not exist, so any referenced
tables need to be created before any columns that reference them.
Likewise, we cannot drop tables/columns that are referenced by other tables.
For example, if we decided we didn’t want the author table anymore,
we would have to drop the author_id column in fav_book before we
could drop author.
We’ve already talked a little bit about constraints, so some of these should be review. We’ll talk about the new ones:
It’s also good to know that you can (and should) name constraints.
We’ve already seen NOT NULL and UNQUE constraints in the wild, so, briefly, here is how you would implement them yourself:
test_db# ALTER TABLE fav_book ADD COLUMN publication_date datetime NOT NULL;
test_db# ALTER TABLE fav_book ADD COLUMN isbn varchar(13) UNIQUE;
A CHECK clause requires new data to meet a certain set of criteria
before it is inserted into a column.
For example, we could add a new column to our book column called price,
and require that price be a non-negative number:
test_db# ALTER TABLE fav_book ADD COLUMN price numeric
CONSTRAINT fav_book_positive_price CHECK (price > 0);
Now, if we try to insert a row in the table with a negative price, we’ll get an error:
test_db# INSERT INTO fav_book (book_title, author_id, price)
VALUES ('The Hitch Hiker''s Guide To The Galaxy', 1, -10.50);
ERROR: new row for relation "fav_book" violates check constraint "fav_book_positive_price"
DETAIL: Failing row contains (1, The Hitch Hiker's Guide To The Galaxy, 1, -10.50).
If you didn’t want to name the check constraint, the line would look like this:
test_db# ALTER TABLE fav_book ADD COLUMN price numeric CHECK (price > 0);
If you don’t name the column, the database system will name it for you. In some systems, like SQL Server, you get random strings (like mini UUIDs), but in PostgreSQL, you get more readable constraints. In this case, you’ll get the name: fav_book_price_check.
We’ve talked a little bit about default constraints, but as a review,
the DEFAULT constraint inserts a default value in a column if no value is provided.
Let’ say we want to expand our books table to include a column for
whether or not we have a hard copy or not. Let’s say we’re
a pretty environmentally minded, so we’d like the default to be false.
test_db# ALTER TABLE fav_book ADD COLUMN hard_copy boolen DEFAULT false;
When you add a default to a new column in a table that is already populated, all existing rows will get that default. Your mileage may vary in other database systems. Always good to check the docs.
We’ve seen how to drop tables. We can do the same thing for columns or constraints, like so:
test_db# ALTER TABLE fav_book DROP COLUMN publication_date;
test_db# ALTER TABLE fav_book DROP CONSTRAINT fav_book_positive_price;
If you didn’t name your constraints, you’ll need to check
what the name is. There are a few different ways to do this, but the
easiest way for now is: \d+ table_name
Like dropping tables, these actions are destructive, so use with care.
Flesh out your test_db! You can stick with the book
theme or pick a new one like music, tv shows, movies, or anything
that interests you.
Try to use at least one of each of the constraints, and remember that you
can always drop columns or constraints if you need to!
advanced topics
Locking is a mechanism to deal with concurrent access to a row or set of rows in a database.
This is an important topic to be familiar with, especially if you are a developer.
One way of categorizing locks is into read locks and write locks.
Write locks prevent another thread from modifying the
locked row(s) until the thread that has the lock is finished with its changes.
The idea behind this is to prevent data from being corrupted or made invalid.
Read locks prevent another thread from reading the locked
row(s) until the the thread that has the lock is finished with its changes.
This idea behind this to prevent someone from getting uncommitted data.
You may find that it used less frequently than write locks, especially if peformance
is considered more important than consistency, but this is all depends
on the business requirements.
There are a lot of details about locking that we aren’t going to go into, but here are a few things to know:
A transaction is an atomic unit of database operations.
If you are a developer or will be writing programmatic SQL statements,
transactions are a good thing to have a working knowledge of.
Everything inside the transaction will either be committed or rolled back
(undone) together.
Commonly, you will see this used when you want to commit the changes only
if all the actions were successful, and roll them back if there was a problem.
This can be useful in situations where a set of changes must take effect
for any of them to be valid. For example, perhaps a business requirement is that
new accounts and users must be created together. Empty accounts are not allowed.
In this case, the insert statements would need to be explicitly wrapped in a
single transaction.
The specific syntax will depend on the database, but, in general, a transaction begins with either the BEGIN or BEGIN TRANSACTION statement and ends with the aptly named END TRANSACTION. You an also use the keywords COMMIT or ROLLBACK to end the transaction. COMMIT works like END TRANSACTION. ROLLBACK will roll back the changes in the transaction block.
test_db# BEGIN TRANSACTION;
insert into author (name) values ('Donald A. Norman');
insert into fav_book (book_title) values ('The Design of Everyday Things');
END TRANSACTION;
TRANSACTION;
BEGIN
INSERT 0 1
ERROR: null value in column "author_id" violates not-null constraint
DETAIL: Failing row contains (8, The Design of Everyday Things, null, null, f).
ROLLBACK
This first example works exactly like the last example, since END TRANSACTION and COMMIT behave the same:
test_db# BEGIN TRANSACTION;
insert into author (name) values ('Donald A. Norman');
insert into fav_book (book_title) values ('The Design of Everyday Things');
COMMIT;
In the next example, the row will be inserted correctly and then the changes will be rolled back:
test_db# BEGIN TRANSACTION;
insert into author (name) values ('Donald A. Norman');
ROLLBACK;
BEGIN
INSERT 0 1
ROLLBACK
Final note: Transactions only work with DML
(data manipulation language), i.e. inserts, updates and deletes.
Transactions do not apply to DDL (data definition language),
i.e. creating, altering, and dropping tables, columns, or databases.
These changes are already atomic (the A part of ACID).
Another topic to have a working knowledge of if you are developer:
Indexes are a special lookup table that an RDBMS can use when
searching for a record given a value for a column or set of columns.
They are often added to speed up data retrieval.
Intuitively, you can think of an index in a database as being
like the index in the back of a book. Usually, the underlying
structure for an index is a B-tree.
For example, we could add an index to the book title column:
test_db# CREATE INDEX ON fav_book (book_title);
Indexes are not performance panaceas. They are not always appropriate and have some limitations:
Good index tuning isn’t easy, as any experienced
DBA (database administrator) will tell you. Different people have
different philosophies on what makes for good index tuning,
and you’ll find a lot of op-eds about the right way to do to it.
Take them all with a grain of salt.
If you have a DBA, they will take care of most (or all) of this for you.


Tales from the Agile battlefield
Running productive sprints
What this talk is and what it's not
Highlights of some lessons learnt in moving to agile
A description of our current working process
An overview of some of the things we're working towards
It is NOT a scrum master training session...
onefinestay is a hotel operated out of other people's homes.
1500+ homes across London, New York, Paris and LA
100s of daily activities
400+ concurrent guests over Christmas
“The Airbnb For The 1%”
A little bit about onefinestay Engineering
Development teams of 2-10 developers
~20 developers running parallel sprints
Building for internal clients as much as customers
Sprints
2 week parallel sprints for dev teams
Monday-Friday
Daily standups
Sprint checkins / Team standups
Sprint planning Thursday before the sprint starts
Hack / Test days the first Monday of the sprint
Retrospectives the last Friday of the sprint
Tickets Overview
Scoping
Development life cycle
Definition of done
Scoping
Meetings with the relevant stakeholders
Developers write tickets
Organised in Epics + the Backlog
Development life cycle
Branch ALL the things
GitHub pull request ALL the things (?!)
Code review ALL the things
Build ALL the things
The Battlefield
Team formation (blockers / dependencies)
Know the enemy (individual sprint plans)
Decisive blows (closing out tickets)
Definition of done
Code review
Jenkins
User Acceptance Testing (UAT) - where necessary
“... but, it's not done unless it's released!?”
Releasing
Separate to development sprint cycle
More Jenkins
Release branches individually or as bundles
Gonzo / Fabric
What did we learn
Only add process where necessary
Make sure "value" is based on the team scale
Facilitate people doing what they're good at
Iterate process changes sprint to sprint
Make sure the tools work
Moving Forward Overview
Scoping
Releasing
Reviewing ticket scope
Better peer review ahead of scheduling
Reviewing with product to confirm requirements match
Releasing
Continuous Integration / Delivery
Cinch
UAT environments


The Less module enables developers to access our public Less variables & mixins in their application.
Our Less module is not intended as a general-purpose library of utility mixins and variables such as LessHat.
{% highlight json %} { "dependencies": { "lasso": "^3", "lasso-less": "^3", "@ebay/skin": "^{{ page.version | slice: 0, 2 }}" } } {% endhighlight %}NOTE: This module requires the additional lasso-less plugin dependency in your app package.json.


Two men charged for brazen killing of domino-playing Manchester man
Two men who reside in the Corporate Area have been charged for the brazen daylight killing of a man while he played dominoes in Manchester two weeks ago.
Mario Martin, 43, a mason of Cassia Crescent, in Olympic Gardens, St Andrew, and Jesse Reynolds, 32, a janitor of Water Street, in Denham Town, west Kingston, have been charged with murder, conspiracy to murder and illegal possession of firearm and ammunition.
They were formally charged on Thursday after they were pointed out during an identification parade, the police disclosed.
It’s reported that about 11:00a.m. on November 2, Cornel Whitfield, a mason of Clarke’s Town Road, in Mandeville, was among a group of persons at a shop playing dominoes when he was surprised by two men armed with guns.
It’s reported that the men, who were travelling on foot, opened fire, hitting him several times before making their escape. No one else was injured.


node
The graph node at which the traversal starts. If omitted, a random node is used.process
Alternative to visit() if elements don't implement Visitable.userData
Optional user data that is passed to every visited node.node
The graph node at which the traversal starts. If omitted, a random node is used.process
Alternative to visit() if elements don't implement Visitable.userData
Optional user data that is passed to every visited node.de.polygonal.core.util.AssertionError
source is null, target is null or source equals target (if debug flag is set).de.polygonal.core.util.AssertionError
size() equals maxSize() (if debug flag is set).de.polygonal.core.util.AssertionError
source is null, target is null or source equals target (if debug flag is set).de.polygonal.core.util.AssertionError
copier is null: element is not of type Cloneable (if debug flag is set).de.polygonal.core.util.AssertionError
node is null, node does not belong to this graph or graph is empty (if debug flag is set).var graph = new de.polygonal.ds.Graph<String>(); var a = graph.addNode('a'); var b = graph.addNode('b'); var c = graph.addNode('c'); graph.addSingleArc(a, b, 1.0); graph.addSingleArc(b, a, 1.0); graph.addMutualArc(a, c, 1.0); trace(graph); //output: {Graph, size: 3} |< {GraphNode, val: c, connected to: a} {GraphNode, val: b, connected to: a} {GraphNode, val: a, connected to: c,b} >|


Anisie Uwimana
Software engineer and data analyst
I found the fun of programming in the joy of pure creation
PROJECTS
Software engineer and data analyst
I found the fun of programming in the joy of pure creation


MONSTER SLAYER
Prepare yourself for an epic battle
MONSTER HEALTH
YOUR HEALTH
GAME OVER!
YOU LOST!
YOU WON!
IT'S A DRAW!
NEW GAME
ATTACK
SPECIAL ATTACK
HEAL
SURRENDER
BATTLE LOG
{{ currentlyMessage.actionBy }} - {{ currentlyMessage.actionType }} - {{ currentlyMessage.actionValue }}


Boolean expressions are very similar to Simple expressions, however, they offer some more control over results.
This is done by the boolean keywords 'AND
' and 'OR
', so:
dog bed
and
dog AND bed
Both match:
dog bed
However:
dog OR bed
Matches either:
dog
or bed
(or dog bed
, but as two separate matches)
This is useful for filtering and finding more results.
Boolean expressions are, for the most part, case insensitive (but not keywords, see Keywords and case insensitivity below), so:
cat
Matches all of:
cat
, Cat
, cAt
, CAt
, caT
, CaT
, cAT
, CAT
The boolean keywords 'AND
' and 'OR
' are case sensitive, so:
cat and mouse
Matches:
cat and mouse
But not:
cat mouse
Whereas cat AND mouse
would.
Boolean expressions search for whole words only, so:
pet
Will not match any of:
petulant
, carpet
, trumpeter
, etc.
Boolean expression searches ignore whitespace (spaces, tabs, line endings, etc.) in both the search expression and within search results.
Note: not to be confused with the '_
' character, see also: Other characters below.
Boolean expressions consider letters and digits (of any spoken language) to be part of a word. Also acknowledged are:-
'
' (Unicode/ASCII code 39
- single-quote/apostrophe)
-
' (Unicode/ASCII code 45
- hyphen/minus/dash)
_
' (Unicode/ASCII code 95
- underscore/understrike/underbar/low-line)
All other characters are ignored.
Note: for more information about Unicode, check out: https://www.unicode.org/.
For simpler searches (but with less control), consider using/learning about:
For more control over your searches, consider using/learning about:
If searching within an EPUB document, consider also using/learning about:


This plugin provides Flash fallback as well as it provides Pre Post to securely create non cookie based upload URL.
When using non-flash mode, you can simply set upload-url to HTTP URL where files will be uploaded.
By default it is true, files are uploaded as soon as they are selected.
When using pre-post method, a JSON payload will be uploaded to specified post-url along with specified post-data. The result must contain a valid upload URL at upload-path specified.
When using pre-post method, this property must contain JSON payload data. It should not be JSON encoded, it can be any JavaScript object type.
When using pre-post method, upload-path will be used to retrive upload url from the resultant JSON data.
If upload-on-select is false, this command must be specified as next to any UI operation or any form post.
Since flash does not send cookies along with upload, it is recommended that first we post data and server must send a unique one time usage upload url.
If you are ok with not sending cookies for upload validation, then you can directly bind upload-url property where the files will be uploaded.


Referral for Mike Smith
The clinic will contact you to book an appointment.
When the clinic contacts you, they will need your Booking Reference Number and Password, so keep these with you.
If the clinic does not contact you by Friday 15th December 2017, you can phone them on:0113 123 1234 (Monday to Friday, 9am to 5pm)
Your appointment request details
Booking reference number
0002 7480 8900
Clinic |
Location
Beckett St, Leeds, LS9 7TF
Referred by
Dr Zubeir Smith at Colton Mill Medical
Support services requested for this appointment |


What you should know about references
BetterBatteryStats does not collect data in the background but uses references saved at specific times (on specific events):
- Boot: is saved when your phone boots, deletes all other refrences
- Unplug: is saved when you unplug your phone from the charger
- Charged: is saved when your phone gets charged to 100%
- Screen Off: is saved when the screen of your phone goes off
- Custom: is saved when you select the option to save a custom reference from the menu
As long as those events did not occur or after a reboot BBS will notify you about a missing reference. This is not a bug, it's the way BBS was designed
v<IP_ADDRESS> 2013-03-15
- Fixed caching issues
- Added more logging
- Fixed synchronization issue sometimes leading to empty "to" stat
- Fixed tasker plugin issue
v<IP_ADDRESS> 2013-03-14
- Fixed "to" battery % and voltage always being the current value
- Fixed possible FC and error conditions from gplay crash reports
- Fixed errors due to updating from 1.11 to 1.12 (inconsistent readings)
v<IP_ADDRESS> 2013-03-11
- Fixed problems when migrating from 1.11
v<IP_ADDRESS> 2013-03-11
- Added from/to references (spinners) instead of only having "since" ref to "current"
- Added active monitoring
- When initially starting the app a reference 'unplugged' is created automatically
- Fixed empty stats on screen rotate
- Added a pref to not refresh the widgets automatically when screen goes on
- Changed the watchdog behavior: 'screen off' is always saved when watchdog is enabled, 'screen on' saving must be enabled in prefs and will trigger only if screen off time is bigger than threshold
- Added credits
- Fixed alarm details not being shown when there is no activity involved
- Better logging verbosity controlled by advanced debug preference
- Optimized real estate on main screen and package info
- Fixed tiny font in widgets
- Added pref to save dumpfile to private folder
- Fixed alarms for android 4.2.2
- Fix for 1x1 widget stopping being updated
- Fix for fallback ref not being read in 1x1 and 2x1 widgets
- Less intrusive logging
- New readme and rate dialogs
- Fixed spinner height
- Filter 0-values applies to CPU state as well
- Added (experimental) support for wakeup_sources (replacement of "old" kernel wakelock representation)
- Main view automatically refreshes "current" when opened (can be turned off in advanced settings)
- Fixed 0 kwl and pwl in 2x2 widget
- Fixed FC when calling BBS from watchdog notification
- Fixed FC condition causing unknown error
- Fixed CPU states showing negative percents
- Due to changes in the way references are computed all prefs related to the stat type are getting migrated to "unplugged" (coming from 1.11)
- Partial wakelocks and kernel wakelocks always show the same time for all stats
- Fixed online KB failing to update
- Changed the way su operations are processed
- Make sure all root operations are running in an own thread
- Added pref to show/hide the "reference to" spinner
- Added screen on reference (saved when watchdog is active)
- References are now stored in a database
- Fixed FC condition in RAW alarms
- Optimized loading for speed
- Fixed watchdog not issuing any alerts
- Fixed typos
- Freeze time when BBS is opened / resumed (use "refresh" to update)
- Long press on list item copies its text to the clipboard
- Option to write dmesg to file
- Screen brightness stats/li>
- Retrieval of KB is now an async task
- Added mV/h to battery info (dumpfile)


CLEARASIL DAILY CLEAR ADULT TINTED ACNE TREATMENT- sulfur and resorcinol cream
Reckitt Benckiser LLC
Disclaimer: Most OTC drugs are not reviewed and approved by FDA, however they may be marketed if they comply with applicable regulations and policies. FDA has not evaluated whether this product complies.
| Active ingredients |
Purpose |
| Resorcinol 2% |
Acne medication |
| Sulfur 8% |
Acne medication |
Use
for the treatment of acne
Warnings
For external use only
Do not use on
- broken skin
- large areas of the skin
When using this product
- apply only to areas with acne
- rinse eyes right away with water if it gets in eyes
- skin irritation and dryness is more likely to occur if you use another topical acne medication at the same time. If irritation occurs, only use one topical medication at a time.
Stop use and ask a doctor if skin irritation occurs or gets worse
Keep out of reach of children. If swallowed, get medical help or contact a Poison Control Center right away.
Directions
- clean the skin thoroughly before applying this product
- cover the entire affected area with a thin layer one to three times daily
- because excessive drying of the skin may occur, start with one application daily, then gradually increase to two or three times daily if needed or as directed by a doctor.
- if bothersome dryness or peeling occurs, reduce application to once a day or every other day.
Other information
- keep tightly closed
- keep away from heat
Inactive ingredients
Water, Alcohol Denat., Bentonite, Glyceryl Stearate SE, Propylene Glycol, Isopropyl Myristate, Fragrance, Simethicone, Methylparaben, Propylparaben, Titanium Dioxide, Iron Oxides
Questions?
Call 1-866-25-CLEAR (1-866-252-5327). You may also report side effects to this phone number
Distributed by: Reckitt Benckiser LLC
Parsippany, NJ 07054-0224
Made in USA © RB 2011
PRINCIPAL DISPLAY PANEL - 18 g Tube Carton
Clearasil®
DAILY CLEAR®
Adult Tinted Acne
Treatment Cream
Sulfur 8%, Resorcinol 2% Acne Medication


Monero Mining Pool
Pool HR:
Network HR:
Blocks found:
Last block found:
Payment threshold:
Pool fee:
Pool port:
Miners connected:
Your HR:
Balance due:
Miner address:
https://github.com/jtgrassie/monero-pool


Burge: Philosophy of Language and Mind: 1950-1990 SEP entry on Theories of Meaning Stanley: Philosophy of Language in the Twentieth Century


(Photo © Racorn | Dreamstime)
Bundling is the process of collecting all resources used in a page and then compiling them into a single and optimized file.
This will drastically reduce the number of network requests the browser will have to do to complete the page loading that will so load the page faster.
There are actually two way of doing this:
In-Browser bundler: this method does not require any build tool nor plugins, it just works in the browser as-is.
 It requires Node.js to be installed.
Usually when a website or application is ready for production you can decide to bundle it in order to gain better performances. All of its components and resources will be crunched into a single file and loaded from memory rather than from network/localhost.
Include the zuix-bundler extension script in your app right after the main zuix script inclusion:
<script src="js/zuix.min.js"></script>
<script src="https://genielabs.github.io/zuix/js/zuix-bundler.min.js"></script>
After adding this script you can reload the page and generate the application bundle by typing in the developer console of the browser the command
zuix.saveBundle()
This will create and save the app.bundle.js file to the Downloads folder.
Copy the generated file to your website/app root and include it right after the main zuix script inclusion.
<script src="js/zuix.min.js"></script>
<script src="app.bundle.js"></script>
Remove the zuix-bundler
script inclusion from your app after the bundle is created.
When using lazy-loading only components loaded so far will be included in the bundle (incremental bundling).
To force inclusion of all components/resources used in the app, issue the following commands in the console:
// disable lazy-loading
zuix.lazyLoad(false)
// force loading of all components
zuix.componentize()
// create the bundle
zuix.saveBundle()
Also external JavaScript libraries and CSS files can be included in the app bundle. In order to achieve this, remove the <script src="..."></script>
or <link rel="stylesheet">
and use the method zuix.using(...)
instead to load the script/css.
// Loading a .css style
const flaCss = 'https://cdnjs.cloudflare.com/ajax/libs/flex-layout-attribute/1.0.3/css/flex-layout-attribute.min.css';
zuix.using('style', flaCss, function(res, styleObject) {
console.log("Added Flex Layout Attributes CSS.", res, styleObject);
});
// Loading a .js script
const momentJs = 'https://momentjs.com/downloads/moment.js';
zuix.using('script', momentJs, function(res, scriptObject){
console.log("Added Moment.js.", res, scriptObject);
});
// Loading a zuix component
zuix.using('component', '@lib/extensions/animate_css', function(res, componentContext){
console.log("Added AnimateCSS extension for zUIx.", res, componentContext);
});
If the zuix.using
method is called on a resource that was already loaded, it will just ignore the request.
This method is also used to create self-contained components that can be loaded without having to worry about external dependencies to include.
As an example I remixed the zuix-app-4 of my previous post into zuix-app-5.
In case you missed my previous post:
[[ DEV.TO POST https://dev.to/genejams/adding-a-viewpager-to-the-mobile-web-app-n67 ]]
This is the new source code and this is what I did:
components/news_list
) that can load data from an RSS feedcomponents/random_item
with a components/news_list/item
and components/news_list/item_mini
head
section of index.html
and added them with zuix.using(..)
to the index.js
I wanted the RSS feed to be the one from Google News, but unfortunately Google no longer give this service (so sad), so I ended up using the CNN feed as it was the only feed with nice images and up-to-date titles.
Most feeds of this kind do not allow downloading from a different domain so I used the cors-anywhere.herokuapp.com
proxy to hack CORS behavior. This proxy gets very slow sometimes, but that's ok for an example.
So, to sum up, the zuix-app-5 is the version without the app.bundle.js
(not bundled) and I used it to create the bundled version that is available on zuix-app-6.
Here is a comparison between the two versions.
This is the source code for zuix-app-6
.
The image above shows the bundling process of zuix-web-starter
used for the zuix website itself.
But… since it's already kind of a long post, I'll just briefly put the main features here:


The Fun Number System
问题描述 :
In a k bit 2′s complement number, where the bits are indexed from 0 to k-1, the weight of the most significant bit (i.e., in position k-1), is -2^(k-1), and the weight of a bit in any position i (0 ≤ i < k-1) is 2^i. For example, a 3 bit number 101 is -2^2 + 0 + 2^0 = -3. A negatively weighted bit is called a negabit (such as the most significant bit in a 2's complement number), and a positively weighted bit is called a posibit.
A Fun number system is a positional binary number system, where each bit can be either a negabit, or a posibit. For example consider a 3-bit fun number system Fun3, where bits in positions 0, and 2 are posibits, and the bit in position 1 is a negabit. (110)Fun3 is evaluated as 2^2-2^1 + 0 = 3. Now you are going to have fun with the Fun number systems! You are given the description of a k-bit Fun number system Funk, and an integer N (possibly negative. You should determine the k bits of a representation of N in Funk, or report that it is not possible to represent the given N in the given Funk. For example, a representation of -1 in the Fun3 number system (defined above), is 011 (evaluated as 0 – 2^1 + 2^0), and
representing 6 in Fun3 is impossible.
A Fun number system is a positional binary number system, where each bit can be either a negabit, or a posibit. For example consider a 3-bit fun number system Fun3, where bits in positions 0, and 2 are posibits, and the bit in position 1 is a negabit. (110)Fun3 is evaluated as 2^2-2^1 + 0 = 3. Now you are going to have fun with the Fun number systems! You are given the description of a k-bit Fun number system Funk, and an integer N (possibly negative. You should determine the k bits of a representation of N in Funk, or report that it is not possible to represent the given N in the given Funk. For example, a representation of -1 in the Fun3 number system (defined above), is 011 (evaluated as 0 – 2^1 + 2^0), and
representing 6 in Fun3 is impossible.
输入:
The first line of the input file contains a single integer t (1 ≤ t ≤ 10), the number of test cases, followed by the input data for each test case. Each test case is given in three consecutive lines. In the first line there is a positive integer k (1 ≤ k ≤ 64). In the second line of a test data there is a string of length k, composed only of letters n, and p, describing the Fun number system for that test data, where each n (p) indicates that the bit in that position is a negabit (posibit).
The third line of each test data contains an integer N (-2^63 ≤ N < 2^63), the number to be represented in the Funk number
system by your program.
The third line of each test data contains an integer N (-2^63 ≤ N < 2^63), the number to be represented in the Funk number
system by your program.
输出:
For each test data, you should print one line containing either a k-bit string representing the given number N in the Funk number system, or the word Impossible, when it is impossible to represent the given number.
样例输入:
2 3 pnp 6 4 ppnn 10
样例输出:
Impossible 1110
解题代码:
/* @author: */ import java.util.Scanner; public class Main{ public static void main(String args[]){ long n; int k,t; int ans[]=new int[65]; char a[]=new char[66]; Scanner sc=new Scanner(System.in); t=sc.nextInt(); while((t--)!=0){ k=sc.nextInt(); a=sc.next().toCharArray(); n=sc.nextLong(); for(int i=0;i< k;i++){ if((n&0x1)!=0){ ans[k-1-i]=1; if(a[k-i-1]=='p') n=n-1; else n=n+1; }else ans[k-1-i]=0; n/=2; } if(n==0){ for(int i=0;i< k;i++) System.out.printf("%d",ans[i]); System.out.printf("\n"); }else System.out.printf("Impossible\n"); } } }
(adsbygoogle = window.adsbygoogle || []).push({});
可是看了很多算法书什么的都是说的(start-end)/2哎。。。
学习了
,,,,,,,,,,,,,,,
代码是给出了，但是解析的也太不清晰了吧！如 13 abejkcfghid jkebfghicda
第一步拆分为 三部分 (bejk, cfghi, d) * C(13,3)，为什么要这样拆分，原则是什么？
我想整理一下leetcode的题解，站长能不能给权限
一开始就规定不相邻节点颜色相同，可能得不到最优解。我想个类似的算法，也不确定是否总能得到最优解：先着一个点，随机挑一个相邻点，着第二色，继续随机选一个点，但必须至少有一个边和已着点相邻，着上不同色，当然尽量不增加新色，直到完成。我还找不到反例验证他的错误。。希望LZ也帮想想, 有想法欢迎来邮件。谢谢
网站不错
必须试过啊
根本过不了。。。。
真心不错，力顶作者
失误失误，转载错了。已经改正，抱歉。
有点意思
在第 18行的，while(scanf("%d %dn", &n, &c), n)，这句有错吧
算法是程序的灵魂，算法分简单和复杂，如果不搞大数据类，程序员了解一下简单点的算法也是可以的，但是会算法的一定要会编程才行，程序员不一定要会算法，利于自己项目需要的可以简单了解。


An arc diagram
is a special kind of network graph. It is consituted by nodes
that represent entities and by links
that show relationships between entities. In arc diagrams, nodes are displayed along a single axis
and links are represented with arcs.
Here is a simple example. Five links between 6 nodes are represented using a 2d network diagram (left) and an arc diagram (right)
# Libraries
library(tidyverse)
library(viridis)
library(patchwork)
library(hrbrthemes)
library(igraph)
library(ggraph)
library(colormap)
# A really simple edge list
links=data.frame(
source=c("A", "A", "A", "A", "B"),
target=c("B", "C", "D", "F","E")
)
# Transform to a igraph object
mygraph <- graph_from_data_frame(links)
# Make the usual network diagram
p1 <- ggraph(mygraph) +
geom_edge_link(edge_colour="black", edge_alpha=0.3, edge_width=0.2) +
geom_node_point( color="#69b3a2", size=5) +
geom_node_text( aes(label=name), repel = TRUE, size=8, color="#69b3a2") +
theme_void() +
theme(
legend.position="none",
plot.margin=unit(rep(2,4), "cm")
)
# Make a cord diagram
p2 <- ggraph(mygraph, layout="linear") +
geom_edge_arc(edge_colour="black", edge_alpha=0.3, edge_width=0.2) +
geom_node_point( color="#69b3a2", size=5) +
geom_node_text( aes(label=name), repel = FALSE, size=8, color="#69b3a2", nudge_y=-0.1) +
theme_void() +
theme(
legend.position="none",
plot.margin=unit(rep(2,4), "cm")
)
p1 + p2
Arc diagrams are not as good as 2d network charts to convey the overall node structure. It has 2 main advantages tough:
Here is an example showing the co-authorship network of a researcher. Vincent Ranwez is author of several scientific publications and counts more than 100 co-authors, all represented by a node on the following chart. If two people have already been on the same paper, they are linked by an arc.
# Load data
dataUU <- read.table("https://raw.githubusercontent.com/holtzy/data_to_viz/master/Example_dataset/13_AdjacencyUndirectedUnweighted.csv", header=TRUE)
# Transform the adjacency matrix in a long format
connect <- dataUU %>%
gather(key="to", value="value", -1) %>%
mutate(to = gsub("\\.", " ",to)) %>%
na.omit()
# Number of connection per person
c( as.character(connect$from), as.character(connect$to)) %>%
as.tibble() %>%
group_by(value) %>%
summarize(n=n()) -> coauth
colnames(coauth) <- c("name", "n")
#dim(coauth)
# Create a graph object with igraph
mygraph <- graph_from_data_frame( connect, vertices = coauth, directed = FALSE )
# Find community
com <- walktrap.community(mygraph)
#max(com$membership)
#Reorder dataset and make the graph
coauth <- coauth %>%
mutate( grp = com$membership) %>%
arrange(grp) %>%
mutate(name=factor(name, name))
# keep only 10 first communities
coauth <- coauth %>%
filter(grp<16)
# keep only this people in edges
connect <- connect %>%
filter(from %in% coauth$name) %>%
filter(to %in% coauth$name)
# Create a graph object with igraph
mygraph <- graph_from_data_frame( connect, vertices = coauth, directed = FALSE )
# prepare a vector of n color in the viridis scale
mycolor <- colormap(colormap=colormaps$viridis, nshades=max(coauth$grp))
mycolor <- sample(mycolor, length(mycolor))
# Make the graph
ggraph(mygraph, layout="linear") +
geom_edge_arc(edge_colour="black", edge_alpha=0.2, edge_width=0.3, fold=TRUE) +
geom_node_point(aes(size=n, color=as.factor(grp), fill=grp), alpha=0.5) +
scale_size_continuous(range=c(0.5,8)) +
scale_color_manual(values=mycolor) +
geom_node_text(aes(label=name), angle=65, hjust=1, nudge_y = -1.1, size=2.3) +
theme_void() +
theme(
legend.position="none",
plot.margin=unit(c(0,0,0.4,0), "null"),
panel.spacing=unit(c(0,0,3.4,0), "null")
) +
expand_limits(x = c(-1.2, 1.2), y = c(-5.6, 1.2))
Note: you can read more about this story in the dedicated page.
A possible variation in arc diagrams consists to make the links wider when the connection is stronger. To do so you need a weighted network
where each connection as a weight.
Since it is not the case in the previous autorship network, here is another one showing the character co-occurrence in the chapters of Victor Hugo’s classic novel Les Misérables. This example comes from Gaston Sanchez and is described more in depth here (with R code).
# see code at https://www.r-bloggers.com/arc-diagrams-in-r-les-miserables/
The order of nodes is the key for arc diagrams. See the following figure showing the same arc diagram than above, but with nodes displayed in a random order. Harder to find any insight isn’t it?
#Reorder dataset randomly
coauth <- coauth %>%
slice( sample(c(1:nrow(coauth)), nrow(coauth)))
# Create a graph object with igraph
mygraph <- graph_from_data_frame( connect, vertices = coauth, directed = FALSE )
# prepare a vector of n color in the viridis scale
mycolor <- colormap(colormap=colormaps$viridis, nshades=max(coauth$grp))
mycolor <- sample(mycolor, length(mycolor))
# Make the graph
ggraph(mygraph, layout="linear") +
geom_edge_arc(edge_colour="black", edge_alpha=0.2, edge_width=0.3, fold=TRUE) +
geom_node_point(aes(size=n, color=as.factor(grp), fill=grp), alpha=0.5) +
scale_size_continuous(range=c(0.5,8)) +
scale_color_manual(values=mycolor) +
geom_node_text(aes(label=name), angle=65, hjust=1, nudge_y = -1.1, size=2.3) +
theme_void() +
theme(
legend.position="none",
plot.margin=unit(c(0,0,0.4,0), "null"),
panel.spacing=unit(c(0,0,3.4,0), "null")
) +
expand_limits(x = c(-1.2, 1.2), y = c(-5.6, 1.2))
The R and Python graph galleries are 2 websites providing hundreds of chart example, always providing the reproducible code. Click the button below to see how to build the chart you need with your favorite programing language.
R graph gallery Python gallery
Any thoughts on this? Found any mistake? Disagree? Please drop me a word on twitter or in the comment section below:
A work by Yan Holtz for data-to-viz.com


--------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------
7
Human Resources Policies
We are expected to
–
Comply with all legislative and regulatory requirements
Refrain from interfering with or curtailing the enjoyment of human rights of
the others
Respect rights of the others
Respond promptly to any concerns about possible violation of personal rights,
mistreatment and human rights issues
VIII. Relationship with Business Partners
The DIPI will take whatever steps are necessary to ensure that we conduct business
transactions in a fair and equitable manner.
You must take whatever steps are necessary to fully comply with all applicable anti-
trust and fair competition laws and internal anti-trust/competition law guidelines
established separately which apply to all our business activities, in order to
continue to maintain fair and equitable dealings in the marketplace.
You must not undertake any personal activity that conflicts with the interests of the
DIPI or its customers. You are responsible for identifying and managing actual
conflicts or the appearance of any conflicts and for bringing these to the attention
of your supervisor.
You are prohibited from giving or accepting gifts, entertainment, travel, payments
and other considerations of value unless they are in accordance with the rules and
policies established for your location.
You must not, directly or indirectly, offer, promise, give, or demand a bribe or other
undue advantage to obtain or retain business or other improper advantage.
In
particular, you should:
1.
Not offer, nor give in to demands, to pay the employees of business partners
any portion of a contract payment. You should not use subcontracts, purchase
orders or consulting agreements as means of channelling payments to the
employees of business partners, or to their relatives or business associates.
2.
Ensure that remuneration of agents is appropriate and for legitimate services
only.
Anti-trust & Competition
It is the Company's policy to lawfully compete in the marketplace. This commitment
includes respecting the rights of our competitors and abiding by all applicable laws
in the course of competing. The Company expects its competitors to respect our
rights to compete lawfully in the marketplace, and we must respect their rights
equally. No employee or officer is permitted to engage in price fixing, bid rigging,
allocation of markets or customers, or similar illegal anti-competitive activities.
For example, engaging in, conspiring to, or agreeing to do any of the following
actions is prohibited:
Agreeing or consulting with competitor(s) regarding prices, terms or


Pulls the latest changes from the remote tracking branch.
git pull
to fetch and apply the latest changes from the remote.git pull
# Assuming the remote `patch-1` branch is ahead of the local one
git checkout patch-1
git pull # The local `patch-1` branch is now up to date with the remote branch


Reports any string literals which contain an octal escape sequence immediately followed by a digit. Such strings may be confusing, and are often the result of errors in escape code creation.
Powered by InspectionGadgets


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CloudServersClient
Provides access to Cloud Servers via their REST API.
All commands return a Future of the result from Cloud Servers. Any exceptions incurred during processing will be backend in anExecutionException
as documented in Future#get()
.
CloudServersAsyncClient
,
| Method Summary | |
|---|---|
void |
changeAdminPass(int id,
String adminPass)
This operation allows you to change the administrative password. |
void |
confirmResizeServer(int id)
The resize function converts an existing server to a different flavor, in essence, scaling the server up or down. |
Image |
createImageFromServer(String imageName,
int serverId)
This operation creates a new image for the given server ID. |
Server |
createServer(String name,
int imageId,
int flavorId,
CreateServerOptions... options)
This operation asynchronously provisions a new server. |
SharedIpGroup |
createSharedIpGroup(String name,
CreateSharedIpGroupOptions... options)
This operation creates a new shared IP group. |
boolean |
deleteBackupSchedule(int serverId)
Delete backup schedule for the specified server. |
boolean |
deleteImage(int id)
This operation deletes an image from the system. |
boolean |
deleteServer(int id)
This operation deletes a cloud server instance from the system. |
boolean |
deleteSharedIpGroup(int id)
This operation deletes the specified shared IP group. |
Addresses |
getAddresses(int serverId)
List all server addresses returns empty set if the server doesn't exist |
BackupSchedule |
getBackupSchedule(int serverId)
List the backup schedule for the specified server |
Flavor |
getFlavor(int id)
This operation returns details of the specified flavor. |
Image |
getImage(int id)
This operation returns details of the specified image. |
Limits |
getLimits()
All accounts, by default, have a preconfigured set of thresholds (or limits) to manage capacity and prevent abuse of the system. |
Server |
getServer(int id)
This operation returns details of the specified server. |
SharedIpGroup |
getSharedIpGroup(int id)
This operation returns details of the specified shared IP group. |
Set<Flavor> |
listFlavors(ListOptions... options)
List available flavors (IDs and names only) in order to retrieve all details, pass the option withDetails() |
Set<Image> |
listImages(ListOptions... options)
List available images (IDs and names only) in order to retrieve all details, pass the option withDetails() |
Set<String> |
listPrivateAddresses(int serverId)
List all private server addresses returns empty set if the server doesn't exist |
Set<String> |
listPublicAddresses(int serverId)
List all public server addresses returns empty set if the server doesn't exist |
Set<Server> |
listServers(ListOptions... options)
List all servers (IDs and names only) This operation provides a list of servers associated with your identity. |
Set<SharedIpGroup> |
listSharedIpGroups(ListOptions... options)
List shared IP groups (IDs and names only) in order to retrieve all details, pass the option withDetails() |
void |
rebootServer(int id,
RebootType rebootType)
The reboot function allows for either a soft or hard reboot of a server. |
void |
rebuildServer(int id,
RebuildServerOptions... options)
The rebuild function removes all data on the server and replaces it with the specified image. |
void |
renameServer(int id,
String newName)
This operation allows you to update the name of the server. |
void |
replaceBackupSchedule(int id,
BackupSchedule backupSchedule)
Enable/update the backup schedule for the specified server |
void |
resizeServer(int id,
int flavorId)
The resize function converts an existing server to a different flavor, in essence, scaling the server up or down. |
void |
revertResizeServer(int id)
The resize function converts an existing server to a different flavor, in essence, scaling the server up or down. |
void |
shareIp(String addressToShare,
int serverToTosignBindressTo,
int sharedIpGroup,
boolean configureServer)
/** This operation allows you share an IP address to the specified server This operation shares an IP from an existing server in the specified shared IP group to another specified server in the same group. |
void |
unshareIp(String addressToShare,
int serverToTosignBindressTo)
This operation removes a shared IP address from the specified server. |
| Methods inherited from interface java.io.Closeable |
|---|
close |
| Method Detail |
|---|
Limits getLimits()
Set<Server> listServers(ListOptions... options)
withDetails()
Server getServer(int id)
Server
boolean deleteServer(int id)
Server
void rebootServer(int id, RebootType rebootType)
rebootType
- With a soft reboot, the operating system is signaled to restart, which allows for a
graceful shutdown of all processes. A hard reboot is the equivalent of power cycling
the server.void resizeServer(int id, int flavorId)
void confirmResizeServer(int id)
void revertResizeServer(int id)
Server createServer(String name, int imageId, int flavorId, CreateServerOptions... options)
options
- - used to specify extra files, metadata, or ip parameters during server creation.void rebuildServer(int id, RebuildServerOptions... options)
options
- - imageId is an optional argument. If it is not specified, the server is rebuilt
with the original imageId.void shareIp(String addressToShare, int serverToTosignBindressTo, int sharedIpGroup, boolean configureServer)
configureServer
-
if set to true, the server is configured with the new address, though the address is
not enabled. Note that configuring the server does require a reboot.
If set to false, does not bind the IP to the server itself. A heartbeat facility
(e.g. keepalived) can then be used within the servers to perform health checks and
manage IP failover.void unshareIp(String addressToShare, int serverToTosignBindressTo)
addressToShare
- serverToTosignBindressTo
- void changeAdminPass(int id, String adminPass)
void renameServer(int id, String newName)
Set<Flavor> listFlavors(ListOptions... options)
withDetails()
Flavor getFlavor(int id)
Flavor
Set<Image> listImages(ListOptions... options)
withDetails()
Image getImage(int id)
Image
boolean deleteImage(int id)
Image
Image createImageFromServer(String imageName, int serverId)
ResourceNotFoundException
- if the server is not foundImage
Set<SharedIpGroup> listSharedIpGroups(ListOptions... options)
withDetails()
SharedIpGroup getSharedIpGroup(int id)
SharedIpGroup
SharedIpGroup createSharedIpGroup(String name, CreateSharedIpGroupOptions... options)
CreateSharedIpGroupOptions
to specify an server.
boolean deleteSharedIpGroup(int id)
SharedIpGroup
BackupSchedule getBackupSchedule(int serverId)
ResourceNotFoundException
- , if the server doesn't existboolean deleteBackupSchedule(int serverId)
void replaceBackupSchedule(int id, BackupSchedule backupSchedule)
Addresses getAddresses(int serverId)
Set<String> listPublicAddresses(int serverId)
Set<String> listPrivateAddresses(int serverId)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


{% if state %}
{% else %}
{% endif %}
Door Status
Open
Door Status
Closed
| Date | Time | Event |
|---|---|---|
| {{ door_history[(events-10+row)][column] }} | {% endfor %}
Garage Door Web Application created by Ben Parmeter, copyright 2017.
For administration tasks, system information and licenses click here.


On 4 March 2017, 6 new articles were published in 6 journals.
On the Durability of Carceral Logics: A Review of Three New Works
Commentary: the Importance of Medicaid Expansion For Criminal Justice Populations in the South
Female Criminality in Russia: A Research Note From A Penal Colony
Crimes By Visitors Versus Crimes By Residents: the Influence of Visitor Inflows
“Tilted Scales:” the Impact of the U.s. Supreme Court on American Income Inequality


About Me | Portfolio
I recently graduated from a Front-End Web Development course at General Assembly where I learned HTML, CSS, JavaScript, jQuery and how to be an awesome Front-End Web Developer!
During my spare time, I enjoy senior water aerobics, pickling, and spending time with my goldfish, Jerry.
Web Developer, Earth Treks Climbing Center (2015 - present)
Web Developer, Canyon Tours (2010 - 2015)
Web Developer, San Francisco Giants (2005 - 2010)
Front End Web Development, General Assembly (2015)
Bachelor of Science, Computer Science, College of Soft Knocks (2009)
High School Diploma (Honors), School of Hard Knocks (2005)


From KVM
Contents |
Setting guest network
Guest (VM) networking in kvm is the same as in qemu, so it is possible to refer to other documentations about networking for qemu. This page will try to explain how to configure the most frequent types of network needed.
User Networking
Use case:
- You want a simple way for your virtual machine to access to the host, to the internet or to resources available on your local network.
- You don't need to access your guest from the network or from another guest.
- You are ready to take a huge performance hit.
- Warning: User networking does not support a number of networking features like ICMP. Certain applications (like ping) may not function properly.
Prerequisites:
- You need kvm up and running
- If you don't want to run as root, the user you want to use needs to have rw access to /dev/kvm
- If you want to be able to access the internet or a local network, your host system must be able to access the internet or the local network
Solution:
- simply run your guest without specifying network parameters, which by default will create user-lever (a.k.a slirp) networking:
qemu-system-x86_64 -hda /path/to/hda.img
Notes:
- The IP address can be automatically assigned to the guest thanks to the DHCP service integrated in QEMU
- If you run multiple guests on the host, you don't need to specify a different MAC address for each guest
- The default is equivalent to this explicit setup:
qemu-system-x86_64 -hda /path/to/hda.img -netdev user,id=user.0 -device e1000,netdev=user.0
- user.0 identifier above is just to connect the two halves into one, you may use any identifier you wish, such as "n" or "net0".
- Use rtl8139 instead of e1000 to get 8139-series NIC.
- You can still access one specific port on the guest using the "hostfwd" option. This means e.g. if you want to transport a file with scp from host to guest, start the guest with "-device e1000,netdev=user.0 -netdev user,id=user.0,hostfwd=tcp::5555-:22". Now you are forwarding the host port 5555 to the guest port 22. After starting up the guest, you can transport a file with e.g. "scp -P 5555 file.txt root@localhost:/tmp" from host to guest. Or you can also use other address of the host to connect to.
private virtual bridge
Use case:
- You want to set up a private network between 2 or more virtual machines. This network won't be seen from the other virtual machines nor from the real network.
Prerequisites:
- You need kvm up and running
- If you don't want to run as root, the user you want to use needs to have rw access to /dev/kvm
- You need the following commands installed on your system, and if you don't want to run as root, the user you want to use needs to be able to sudo the following command:
/sbin/ip /usr/sbin/brctl /usr/sbin/tunctl
Solution:
- You need to create a bridge, e-g:
sudo /usr/sbin/brctl addbr br0
- You need a qemu-ifup script containing the following:
#!/bin/sh set -x switch=br0 if [ -n "$1" ];then /usr/bin/sudo /usr/sbin/tunctl -u `whoami` -t $1 /usr/bin/sudo /sbin/ip link set $1 up sleep 0.5s /usr/bin/sudo /usr/sbin/brctl addif $switch $1 exit 0 else echo "Error: no interface specified" exit 1 fi
- Generate a MAC address, either manually or using:
#!/bin/bash # generate a random mac address for the qemu nic printf 'DE:AD:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256))
- Run each guest with the following, replacing $macaddress with the value from the previous step
qemu-system-x86_64 -hda /path/to/hda.img -device e1000,netdev=net0,mac=$macaddress -netdev tap,id=net0
Notes:
- If you don't want to run as root, the qemu-ifup must be executable by the user you want to use
- You can either create a system-wide qemu-ifup in /etc/qemu-ifup or use another one. In the latter case, run
qemu-system-x86_64 -hda /path/to/hda.img -device e1000,netdev=net0,mac=$macaddress -netdev tap,id=net0,script=/path/to/qemu-ifup
- Each guest on the private virtual network must have a different MAC address
public bridge
WARNING: The here shown method, will not work with most(all?) wireless drivers, as these do not support bridging.
Use case:
- You want to assign an IP address to your virtual machines and make them accessible from your local network
- You also want performance out of your virtual machine.
Prerequisites:
- You need kvm up and running
- If you don't want to run as root, the user you want to use needs to have rw access to /dev/kvm
- You need the following commands installed on your system, and if you don't want to run as root, the user you want to use needs to be able to sudo the following command:
/sbin/ip /usr/sbin/brctl /usr/sbin/tunctl
- Your host system must be able to access the internet or the local network
Solution 1: using distro sysconfig script
| RedHat's way | Debian's way | SuSE's way |
|---|---|---|
DEVICE=br0 BOOTPROTO=dhcp ONBOOT=yes TYPE=Bridge |
/etc/network/interfaces # Replace old eth0 config with br0 auto # Use old eth0 config for br0, plus bridge stuff iface br0 inet dhcp bridge_ports eth0 bridge_stp off bridge_maxwait 0 bridge_fd 0 |
|
- /etc/init.d/networking restart
- The bridge br0 should get the ip address (either static/dhcp) while the physical eth0 is left without ip address.
VLANs
Please note that the rtl8139 virtual network interface driver does not support VLANs. If you want to use VLANs with your virtual machine, you must use another virtual network interface like virtio.
When using VLANs on a setup like this and no traffic is getting through to your guest(s), you might want to do:
# cd /proc/sys/net/bridge # ls bridge-nf-call-arptables bridge-nf-call-iptables bridge-nf-call-ip6tables bridge-nf-filter-vlan-tagged # for f in bridge-nf-*; do echo 0 > $f; done
Solution 2: manual
- You need to create a bridge, e-g:
sudo /usr/sbin/brctl addbr br0
- Add one of your physical interface to the bridge, e-g for eth0:
sudo /usr/sbin/brctl addif br0 eth0
- You need a qemu-ifup script containing the following:
#!/bin/sh set -x switch=br0 if [ -n "$1" ];then /usr/bin/sudo /usr/sbin/tunctl -u `whoami` -t $1 /usr/bin/sudo /sbin/ip link set $1 up sleep 0.5s /usr/bin/sudo /usr/sbin/brctl addif $switch $1 exit 0 else echo "Error: no interface specified" exit 1 fi
- Generate a MAC address, either manually or using:
#!/bin/sh # generate a random mac address for the qemu nic printf 'DE:AD:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256))
- Run each guest with the following, replacing $macaddress with the value from the previous step
qemu-system-x86_64 -hda /path/to/hda.img -device e1000,netdev=net0,mac=$macaddress -netdev tap,id=net0
Notes:
- If you don't want to run as root, the qemu-ifup must be executable by the user you want to use
- You can either create a system-wide qemu-ifup in /etc/qemu-ifup or use another one. In the latter case, run
qemu-system-x86_64 -hda /path/to/hda.img -device e1000,netdev=net0,mac=$macaddress -netdev tap,id=net0,script=/path/to/qemu-ifup
- Each guest on the network must have a different MAC address
iptables/routing
you can also connect your guest vm to a tap in your host. then setting iptables rules in your host to become a router + firewall for your vm.
Routing would be done simply by creating the default route on the client to the IP of the host (and allowing IP forwarding) and setting a route to the tap? device of the client on the host.
Test the setup beforehand:
- Hostside: Allow IPv4 forwarding and add route to client (could be put in a script - route has to be added after the client has started):
sysctl -w net.ipv4.ip_forward=1 # allow forwarding of IPv4 route add -host <ip-of-client> dev <tap-device> # add route to the client
- Clientside: Default GW of the client is of course then the host (<ip-of-host> has to be in same subnet as <ip-of-client> ...):
route add default gw <ip-of-host>
- Clientside v2: If you host IP is not on the same subnet as <ip-of-client>, then you must manually add the route to host before you create default route:
route add -host <ip-of-host> dev <network-interface> route add default gw <ip-of-host>
vde
Another option is using vde (virtual distributed ethernet).
performance
Data on benchmarking results should go in here. There's now a page dedicated to ideas for improving Networking Performance.
Compatibility
There's another, old and obsolete syntax of specifying network for virtual machines. Above examples uses -netdev..-device model, old way used -net..-net pairs. For example,
-netdev tap,id=net0 -device e1000,netdev=net0,mac=52:54:00:12:34:56
is about the same as old
-net tap,vlan=0 -net nic,vlan=0,model=e1000,macaddr=52:54:00:12:34:56
(note mac => macaddr parameter change as well; vlan=0 is the default).
Old way used the notion of "VLANs" - these are QEMU VLANS, which has nothing to do with 802.1q VLANs. Qemu VLANs are numbered starting with 0, and it's possible to connect one or more devices (either host side, like -net tap, or guest side, like -net nic) to each VLAN, and, in particular, it's possible to connect more than 2 devices to a VLAN. Each device in a VLAN gets all traffic received by every device in it. This model was very confusing for the user (especially when a guest has more than one NIC).
In new model, each host side correspond to just one guest side, forming a pair of devices based on -netdev id= and -device netdev= parameters. It is less confusing, it is faster (because it's always 1:1 pair), and it supports more parameters than old -net..-net way.
However, -net..-net is still supported, used widely, and mentioned in lots of various HOWTOs and guides around the world. It is also a bit shorter and so faster to type.


ParaAVL provides a means of mapping current and historical paratransit AVL data.
http://rtcappsrv.rtc.com/paraLeaf
Current Version
0.5.1 (Beta)
This website uses the following:
The data provided on this site is for informational purposes only.
Absolutely no accuracy or completeness guarantee is implied or intended.
ParaAVL contacts


Safe reconstruction and guarantees
We want the ability reconstruct images from fewer samples as this would allow cheaper and faster
imaging. We can achieve this because natural images lie in a subspace of their domain, they are structured.
But how can this reconstruction from fewer samples go wrong?
- we need to ensure you have sampled the 'right' information.
- we need to make sure that beliefs do not outcompete the measurements (safety)
Recent work has used learned priors (via a GAN, see
reading.md for references)
to act as a regulariser on partially reconstructed images.
What I am worried about is, for example, a tumor being removed from a reconstruction
because our prior knowledge about the images allocates the tumor low probability.
If these algorithms are to be used in paractice they will need to provide guarantees.
For example, provable bounds on the likelihood of introducing a false positive,
or a false negative classification.
Compressed sensing
Copressed sensing is typically formaised as finding the optimal solution
to an $L_1$ minimisation problem, such that the reconstruction explains
the measurements. Where $y$ are the measreuments (far fewer than the size of $x$) made by the forward process $f$.
The truth we want to reconver is $\hat x$. And finally $\phi(\cdot)$ is the
all important sparse basis.
$$
\begin{align}
y &= f(\hat x) \\
\mathop{\text{argmin}}_x &\parallel \phi(x) \parallel_1 \text{ s.t. } \parallel f(x) - y\parallel_2 < \epsilon \\
\end{align}
$$
Another way to think about this is that: because we have few measurements,
there are many possible images that explain these measurements.
Thus we need to external information, regularisers/beliefs, to pick a
reconstruction out of the many plausible ones.
We could write this set of plausible images, given the measurements as;
$$
\begin{align}
\mathcal S &= \{x_i: \parallel \psi(x) - y \parallel_2 \le \epsilon, \forall x_i \in \mathbb R^n\} \tag{4} \\
\end{align}
$$
Which priors/regularisers work and why?
Some regularisers and sparse domains have been used for many years and have shown great success.
These include, using the fourier and wavelet bases or the total variation regulariser.
$$
\begin{align}
\mathop{\text{argmin}}_x & \parallel \psi(x) - y \parallel_2 + \lambda \parallel \text{fft}(x) \parallel_1 \tag{2}\\
\end{align}
$$
As mentioned above, recent work has used GANs in place of traditional regularisers.
$$
\begin{align}
\mathop{\text{argmin}}_x & \parallel \psi(x) - y \parallel_2 + \lambda \cdot \text{discriminator}(x) \tag{3}\\
\end{align}
$$
However, I am worried that there is a fundamental difference between these regularisers.
Conjecture: compressed sensing regularisers (TV, L1) are 'safer' than learned regularisers.
TV and $ L_1 $ (in a 'simple' domain) seem to lack the ability to add semantically meaningful information. I want to say something like:
learned priors can add objects with marcoscopic structure into the reconstructed image.
but that is not true. $ L_1 $ in the fourier domain can regularise large wavelength signals and thus have globally structured effects.
Questions I would like to find answers for:
- Under which conditions are macroscopic fantaies added?
- What is the definition of macroscopic? How can it be measured?
Note: I think there are some important relationships to;
- mode collapse. If a mode has been dropped by the learned prior
then it will push the reconstruction away from that location. How can
you verify that all modes have been captured?
- adversarial examples. Inperceptibly small changes to an image
can cause classification error. So if a learned prior introduces these
artifacts then, while looking similar to us, automated classifiers will miss classify the image.
- That fourier/wavelet/TV are not 'semantically meaningful' to a down stream classification task (???)
Guarantees
If I get a MRI scan and I am told that 12-samples were used to
construct the images that show I have a tumor, I am going to want some
guarantees on what information can be added (or removed) into the reconstruction.
What form could these guarantees take?
- bounds on false positive/negatives, $ \text{mistakes} \sim {O(log{\frac{1}{n_{samples}}})} $
- empirical tests, $ \text{class}(x) \approx \text{class}(\text{recon}_k(y)) $
But, empirical tests only apply to the existing data gathered,
and provide no guarantees for the future.
Given a MRI dataset and a classification task (like classifying images with/without tumors).
We want to find the minimum number of samples such that images with tumors and without are $\delta$ likely
to be distinguishable.
Safe reconstruction
What we want to is balance the two competing objectives:
A reconstruction that explains the measurements, and a reconstruction
that is structured according to our prior beliefs.
What we dont want is our prior beliefs out-competing the
measurements made (given other beliefs about the accuracy the measurements).
In the original framing of the problem (see Compressed Sensing) this is not an
issue because we are optimising the image such that the reconstruction
must explain the measurements.
But, in practice you often use the Largangian multiplier to make optimisation easier.
$$
\mathop{\text{argmin}}_x \parallel \phi(x) \parallel_1 + \lambda \parallel f(x) - y\parallel_2 \\
$$
We have now lost the nice guarantee that the reconstructed $ x $ must explain
the data (within $ \epsilon $). The reconstruction now relies on the
optimisation prodceure/dynamics (which is possibly nonconvex) and the value of the multiplier.
So, we want to;
- be able to calculate a lambda, given beliefs about the amount of noise in the measurements,
- project gradients from optimising the prior back into a 'safe' set (possibly
related to Strongly typed agents)


This example uses the allow_unhandled_action option to allow standard Delphi SOAP webservice functionality.
Visit /wsdl for WSDL
Visit /customer for Customer REST


'Found WHAT?' said the Duck.
'Found IT,' the Mouse replied rather crossly: 'of course you know what "it" means.'
'I know what "it" means well enough, when I find a thing,' said the Duck: 'it's generally a frog or a worm. The question is, what did the archbishop find?'
The Mouse did not notice this question, but hurriedly went on, '"—found it advisable to go with Edgar Atheling to meet William and offer him the crown. William's conduct at first was moderate. But the insolence of his Normans—" How are you getting on now, my dear?' it continued, turning to Alice as it spoke.
'As wet as ever,' said Alice in a melancholy tone: 'it doesn't seem to dry me at all.'
'In that case,' said the Dodo solemnly, rising to its feet, 'I move that the meeting adjourn, for the immediate adoption of more energetic remedies—'