An Angularjs module with full feature of sweetalert libarary.
It's a directive and a provider to use sweetalert in js code and in html.
these mudole use:
SweetAlert AngularJS wrapper that is here develop by: oitozero
and ng-sweet-alert an angularjs directive that is here develop by: tushariscoolster
tnx for all.
if you need just a directive to use in html or need just fire sweetalret from your js code you can use one of tushariscoolster sn-sweet-alert directive or oitozero ngSweetAlert wrapper but when need both of them (like me) use ngSweetAlertFull.
Sweet Alert is a beautiful replacement for Javascript's "Alert".
SweetAlert.swal({
title: "Are you sure?",
text: "Your will not be able to recover this imaginary file!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: false},
function(){
SweetAlert.swal("Booyah!");
});
SweetAlert.swal({
title: "Are you sure?",
text: "Your will not be able to recover this imaginary file!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",confirmButtonText: "Yes, delete it!",
cancelButtonText: "No, cancel plx!",
closeOnConfirm: false,
closeOnCancel: false },
function(isConfirm){
if (isConfirm) {
SweetAlert.swal("Deleted!", "Your imaginary file has been deleted.", "success");
} else {
SweetAlert.swal("Cancelled", "Your imaginary file is safe :)", "error");
}
});
SweetAlert.swal({
title: "Sweet!",
text: "Here's a custom image.",
imageUrl: "http:://oitozero.com/avatar/avatar.jpg" });
This Directive can be use in angular js application ,without writing a javascript code,All configuration can be done in HTML itself
Getting StartedInstall it via bower
You can try by chaging option on fly and try it!!! Enjoy
| Option | |
|---|---|
| sweet-options | |
| sweet-confirm-option | |
| sweet-cancel-option | |
| sweet-on-confirm | checkConfirm() |
| sweet-on-cancel | checkCancel() |
{{htmlSweetOption}}{{sweet.option}}{{htmlSweetConfirm}}{{sweet.confirm}}{{htmlSweetCancel}}{{sweet.cancel}}{{htmlSweetOnConfirmCancel}}
Try It


rolling hash
string
trie
]
Leetcode 1044. Longest Duplicate Substring
https://leetcode.com/problems/longest-duplicate-substring
This is quite difficult problem in fact and you will be very unlucky if you have this on real interview. However if you familiar with Rabin-Karp algorighm, it will be not so difficult. You can see it in full details on Wikipedia: https://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm
Here I briefly explain the idea of it. Imagine, that we have string abcabcddcb
, and we want to check if there are two substrings of size 3
, which are equal. Idea is to hash this substrings, using rolling hash, where d
is our base and q
is used to avoid overflow.
- for
abc
we evaluate[ord(a)*d^2 + ord(b)*d^1 + ord(c)*d^0] % q
- for
bca
we evaluate[ord(b)*d^2 + ord(c)*d^1 + ord(a)*d^0] % q
Note, that we can evaluate rolling hash inO(1)
, for more details please see wikipedia. …
However, it can happen that we have collisions, we can falsely get two substrings with the same hash, which are not equal. So, we need to check our candidates.
Binary search for help
Note, that we are asked for the longest duplicate substring. If we found duplicate substring of length 10
, it means that there are duplicate substrings of lenths 9,8, ...
. So, we can use binary search to find the longest one.
Complexity of algorighm is O(n log n)
if we assume that probability of collision is low.
How to read the code
I have RabinKarp(text, M,q)
function, where text
is the string where we search patterns, M
is the length we are looking for and q
is prime modulo for Rabin-Karp algorighm.
- First, we need to choose
d
, I chosed = 256
, because it is more thanord(z)
. - Then we need to evaluate auxiliary value
h
, we need it for fast update of rolling hash. - Evalute hash for first window
- Evaluate hashes for all other windows in
O(n)
(that isO(1)
for each window), using evaluatedh
. - We keep all hashes in dictionary: for each hash we keep start indexes of windows.
- Finally, we iterate over our dictionary and for each unique hash we check all possible combinations and compare not hashes, but original windows to make sure that it was not a collision.
Now, to the longestDupSubstring(S)
function we run binary search, where we run our RabinKarp
funcion at most log n
times.
class Solution:
def RabinKarp(self,text, M, q):
if M == 0: return True
h, t, d = (1<<(8*M-8))%q, 0, 256
dic = defaultdict(list)
for i in range(M):
t = (d * t + ord(text[i]))% q
dic[t].append(i-M+1)
for i in range(len(text) - M):
t = (d*(t-ord(text[i])*h) + ord(text[i + M]))% q
for j in dic[t]:
if text[i+1:i+M+1] == text[j:j+M]:
return (True, text[j:j+M])
dic[t].append(i+1)
return (False, "")
def longestDupSubstring(self, S):
beg, end = 0, len(S)
q = (1<<31) - 1
Found = ""
while beg + 1 < end:
mid = (beg + end)//2
isFound, candidate = self.RabinKarp(S, mid, q)
if isFound:
beg, Found = mid, candidate
else:
end = mid
return Found
Further discussion I did some research in this domain, and there are different ways to handle this problem:
- You can solve it, using suffix array in
O(n log n)
(or evenO(n)
with suffix trees) complexity, see https://cp-algorithms.com/string/suffix-array.html for suffix array which is a bit easier than suffix trees https://en.wikipedia.org/wiki/Suffix_tree - You can solve it with Tries, complexity To be checked.
- I think there is solution where we use KMP, but I have not seen one yet.
- If you have more ideas, plese let me know!
If you like the solution, you can upvote it on leetcode discussion section: Problem 1044


When the new Libyan president of the United Nations Human Rights Commission, Najat Al-Hajjaji, made her inaugural speech at the opening of the 59th session of the Commission in Geneva on 17th March 2003 she was interrupted by six activists from Reporters Without Borders who threw leaflets into the meeting room. (Reporters Without Borders are also known as Reporters san Frontieres or just RSF)
As a result the pressure group may have its UN consultative status suspended. The way this harsh punishment has been decided and the process that led to this decision is farcical and sets a precedent that should not be allowed to stand.
The chair of the United Nations Human Rights Commission Committee usually rotates between various regional groups. The regional group who’s turn it is nominates someone and that person is unanimously elected by acclamation. At least that’s the way it worked for 46 years until South African Sipho George Nene nominated Libyan Najat Al-Hajjaji for the job. The Americans were not happy with the choice due to Libya’s poor human rights record and insisted on a vote. The charter of the commission required a secret ballot that was duly conducted on January 20th 2003.
The 53 members of the committee voted as follows.
- 33 In favor of Najat Al-Hajjaji as president -17 Abstained -3 Against
The Third World Network an independent non-profit network involved in issues relating to development and the Third World reported:
South Africa’s Sipho George Nene, who had proposed the name of Ms. Najat Al-Hajjaji for the chair, in a statement before the ballot (which the US had requested) said that the Commission and the African Group had been placed in a difficult and unenviable position. It was regrettable that the US delegation had opted for the extreme method of demonstrating its non-endorsement of the African Group’s candidate. The decision to propose Ms. Najat Al-Hajjaji’s name had been taken by the highest political organ of the African Union. The group hence had no choice but to respond to the political challenge posed by the subjection of the election to a vote.
For 46 years, the tried and tested practice of the unanimous election of the Chair of the commission had contributed positively in setting a solid foundation for the proceedings of the Commission. This “reliable practice” had been violated today. But the African group hoped that this unfortunate act would not be emulated in the future. “The rights of regional groups to present candidates of their choice should be respected.” Great efforts had been made to persuade the US to use other available methods to express its displeasure. But these had failed. The African group urged members to demonstrate their confidence in the tried and tested methods of the past by voting for the African candidate with a resounding majority.
Geneva, 20th January 2003 Chakravarthi Raghavan
On the 18th March 2003, one day after the leaflet throwing incident at the opening session, the American representative Jeane Kirkpatrick had the following to say
Some criticism aimed at the Commission overlooks positive steps taken in recent sessions, but the widespread overall impression shared by many is that too many serious and systematic abuses of human rights go unchallenged or even covered-up in this body. The practice of electing the Commission members from some of the world’s worst human rights offenders is especially serious. The cynical resort to procedural tactics to avoid taking a position on human rights abuses has not gone unnoticed and is widely and rightly criticized.
The government and the people whom I have the privilege of representing want the Commission to keep the faith placed in it by the United Nations’ founders when they envisioned the prospect of a body devoted to the promotion and protection of fundamental human rights…
Address by Ambassador Jeane Kirkpatrick Head of the U.S. Delegation to the United Nations Commission on Human Rights Palais des Nations March 18, 2003
As a result of the leaflet throwing incident Cuba called for the suspension of RSF’s consultative status for one year. France called for no action to be taken and for due process to be followed which would allow RSF a chance to appear before the UN’s Committee on Non-Governmental Organizations before any action was taken. The committee took a vote on the 20th May 2003. Of the 19 members the voting came out as follows
- In favor of a ban – China, Côte d’Ivoire, Cuba, Iran, Pakistan, Russia, Sudan, Turkey and Zimbabwe
- Abstained – Cameroon, Colombia, India and Senegal
- In favor of no action – Germany, Chile, the United States, France, Peru and Romania
No due process was permitted and RSF were not given a chance to appear before the committee. RSF have pointed out the considerable irony of this result in a press release on their website they say:
All this would be laughable…if it did not show up the decay of the UN system, which has some of the world’s worst human rights violators giving lessons to those who denounce their actions and defend their victims.
On May 30th 2003 Sergio Vieira de Mello, the UN High Commissioner for Human Rights, said he opposes any attempt to exclude Reporters Without Borders from the United Nations by challenging its current observer status. But he cautioned.
As you know, these decisions are not taken by us or by the UN secretary-general, but by a committee in New York that deals with such matters.
To take effect, the move to ban RSF must be endorsed by the UN General Assembly’s Economic and Social Council, which will consider the proposal in Geneva between July 1st and 24th at the ECOSOC session. Who knows what is going to happen then? One thing seems certain to me the UN is broken, possibly beyond repair.


--- extends: minimal.j2 default_block: main title: Daniel Buscombe description: Home page of Daniel Buscombe ---
Colorado River, Grand Canyon National Park
I'm a Research Geologist at the Grand Canyon Monitoring and Research Center. I research and teach in a variety of areas, including Sedimentology, Geomorphology, Geospatial analysis, and Scalable Computation.


Class yii\mongodb\Command
| Inheritance | yii\mongodb\Command » yii\base\BaseObject |
|---|---|
| Implements | yii\base\Configurable |
| Available since version | 2.1 |
| Source Code | https://github.com/yiisoft/yii2-mongodb/blob/master/Command.php |
Command represents MongoDB statement such as command or query.
A command object is usually created by calling yii\mongodb\Connection::createCommand() or yii\mongodb\Database::createCommand(). The statement it represents can be set via the $document property.
To execute a non-query command, such as 'listIndexes', 'count', 'distinct' and so on, call execute(). For example:
$result = Yii::$app->mongodb->createCommand(['listIndexes' => 'some_collection'])->execute();
To execute a 'find' command, which return cursor, call query(). For example:
$cursor = Yii::$app->mongodb->createCommand(['projection' => ['name' => true]])->query('some_collection');
To execute batch (bulk) operations, call executeBatch(). For example:
Yii::$app->mongodb->createCommand()
->addInsert(['name' => 'new'])
->addUpdate(['name' => 'existing'], ['name' => 'updated'])
->addDelete(['name' => 'old'])
->executeBatch('some_collection');
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $databaseName | string | Name of the database that this command is associated with. | yii\mongodb\Command |
| $db | yii\mongodb\Connection | The MongoDB connection that this command is associated with. | yii\mongodb\Command |
| $document | array | Command document contents. | yii\mongodb\Command |
| $readConcern | \MongoDB\Driver\ReadConcern|string | Read concern to be used in this command. | yii\mongodb\Command |
| $readPreference | \MongoDB\Driver\ReadPreference | Read preference. | yii\mongodb\Command |
| $writeConcern | \MongoDB\Driver\WriteConcern|null | Write concern to be used in this command. | yii\mongodb\Command |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __call() | Calls the named method which is not a class method. | yii\base\BaseObject |
| __construct() | Constructor. | yii\base\BaseObject |
| __get() | Returns the value of an object property. | yii\base\BaseObject |
| __isset() | Checks if a property is set, i.e. defined and not null. | yii\base\BaseObject |
| __set() | Sets value of an object property. | yii\base\BaseObject |
| __unset() | Sets an object property to null. | yii\base\BaseObject |
| addDelete() | Adds the delete operation to the batch command. | yii\mongodb\Command |
| addInsert() | Adds the insert operation to the batch command. | yii\mongodb\Command |
| addUpdate() | Adds the update operation to the batch command. | yii\mongodb\Command |
| aggregate() | Performs aggregation using MongoDB Aggregation Framework. | yii\mongodb\Command |
| batchInsert() | Inserts batch of new documents into collection. | yii\mongodb\Command |
| canGetProperty() | Returns a value indicating whether a property can be read. | yii\base\BaseObject |
| canSetProperty() | Returns a value indicating whether a property can be set. | yii\base\BaseObject |
| className() | Returns the fully qualified name of this class. | yii\base\BaseObject |
| count() | Counts records in specified collection. | yii\mongodb\Command |
| createCollection() | Creates new collection in database associated with this command.s | yii\mongodb\Command |
| createIndexes() | Creates indexes in the collection. | yii\mongodb\Command |
| delete() | Removes documents from the collection. | yii\mongodb\Command |
| distinct() | Returns a list of distinct values for the given column across a collection. | yii\mongodb\Command |
| dropCollection() | Drops specified collection. | yii\mongodb\Command |
| dropDatabase() | Drops database associated with this command. | yii\mongodb\Command |
| dropIndexes() | Drops collection indexes by name. | yii\mongodb\Command |
| execute() | Executes this command. | yii\mongodb\Command |
| executeBatch() | Execute commands batch (bulk). | yii\mongodb\Command |
| explain() | Return an explanation of the query, often useful for optimization and debugging. | yii\mongodb\Command |
| find() | Performs find query. | yii\mongodb\Command |
| findAndModify() | Updates a document and returns it. | yii\mongodb\Command |
| getReadConcern() | Retuns read concern for this command. | yii\mongodb\Command |
| getReadPreference() | Returns read preference for this command. | yii\mongodb\Command |
| getWriteConcern() | Returns write concern for this command. | yii\mongodb\Command |
| group() | Performs aggregation using MongoDB "group" command. | yii\mongodb\Command |
| hasMethod() | Returns a value indicating whether a method is defined. | yii\base\BaseObject |
| hasProperty() | Returns a value indicating whether a property is defined. | yii\base\BaseObject |
| init() | Initializes the object. | yii\base\BaseObject |
| insert() | Inserts new document into collection. | yii\mongodb\Command |
| listCollections() | Returns the list of available collections. | yii\mongodb\Command |
| listDatabases() | Returns the list of available databases. | yii\mongodb\Command |
| listIndexes() | Returns information about current collection indexes. | yii\mongodb\Command |
| mapReduce() | Performs MongoDB "map-reduce" command. | yii\mongodb\Command |
| query() | Executes this command as a mongo query | yii\mongodb\Command |
| setReadConcern() | Sets read concern for this command. | yii\mongodb\Command |
| setReadPreference() | Sets read preference for this command. | yii\mongodb\Command |
| setWriteConcern() | Sets write concern for this command. | yii\mongodb\Command |
| update() | Update existing documents in the collection. | yii\mongodb\Command |
Protected Methods
| Method | Description | Defined By |
|---|---|---|
| beginProfile() | Marks the beginning of a code block for profiling. | yii\mongodb\Command |
| endProfile() | Marks the end of a code block for profiling. | yii\mongodb\Command |
| log() | Logs the command data if logging is enabled at $db. | yii\mongodb\Command |
Property Details
Name of the database that this command is associated with.
The MongoDB connection that this command is associated with.
Command document contents.
Read concern to be used in this command.
public $this setReadConcern ( $readConcern )
Read preference.
public $this setReadPreference ( $readPreference )
Write concern to be used in this command.
public $this setWriteConcern ( $writeConcern )
Method Details
Adds the delete operation to the batch command.
See also executeBatch().
| public $this addDelete ( $condition, $options = [] ) | ||
| $condition | array | Filter condition. |
| $options | array | Delete options. |
| return | $this | Self reference. |
|---|
Adds the insert operation to the batch command.
See also executeBatch().
| public $this addInsert ( $document ) | ||
| $document | array | Document to be inserted |
| return | $this | Self reference. |
|---|
Adds the update operation to the batch command.
See also executeBatch().
| public $this addUpdate ( $condition, $document, $options = [] ) | ||
| $condition | array | Filter condition |
| $document | array | Data to be updated |
| $options | array | Update options. |
| return | $this | Self reference. |
|---|
Performs aggregation using MongoDB Aggregation Framework.
In case 'cursor' option is specified \MongoDB\Driver\Cursor instance is returned, otherwise - an array of aggregation results.
| public array|\MongoDB\Driver\Cursor aggregate ( $collectionName, $pipelines, $options = [] ) | ||
| $collectionName | string | Collection name |
| $pipelines | array | List of pipeline operators. |
| $options | array | Optional parameters. |
| return | array|\MongoDB\Driver\Cursor | Aggregation result. |
|---|
Inserts batch of new documents into collection.
| public array|false batchInsert ( $collectionName, $documents, $options = [] ) | ||
| $collectionName | string | Collection name |
| $documents | array[] | Documents list |
| $options | array | List of options in format: optionName => optionValue. |
| return | array|false | List of inserted IDs, |
|---|
Marks the beginning of a code block for profiling.
See also endProfile().
| protected void beginProfile ( $token, $category ) | ||
| $token | string | Token for the code block |
| $category | string | The category of this log message |
Counts records in specified collection.
| public integer count ( $collectionName, $condition = [], $options = [] ) | ||
| $collectionName | string | Collection name |
| $condition | array | Filter condition |
| $options | array | List of options in format: optionName => optionValue. |
| return | integer | Records count |
|---|
Creates new collection in database associated with this command.s
| public boolean createCollection ( $collectionName, array $options = [] ) | ||
| $collectionName | string | Collection name |
| $options | array | Collection options in format: "name" => "value" |
| return | boolean | Whether operation was successful. |
|---|
Creates indexes in the collection.
| public boolean createIndexes ( $collectionName, $indexes ) | ||
| $collectionName | string | Collection name. |
| $indexes | array[] | Indexes specification. Each specification should be an array in format: optionName => value The main options are:
See [[https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/#options-for-all-index-types]] for the full list of options. |
| return | boolean | Whether operation was successful. |
|---|
Removes documents from the collection.
| public \MongoDB\Driver\WriteResult delete ( $collectionName, $condition, $options = [] ) | ||
| $collectionName | string | Collection name. |
| $condition | array | Filter condition. |
| $options | array | Delete options. |
| return | \MongoDB\Driver\WriteResult | Write result. |
|---|
Returns a list of distinct values for the given column across a collection.
| public array distinct ( $collectionName, $fieldName, $condition = [], $options = [] ) | ||
| $collectionName | string | Collection name. |
| $fieldName | string | Field name to use. |
| $condition | array | Query parameters. |
| $options | array | List of options in format: optionName => optionValue. |
| return | array | Array of distinct values, or "false" on failure. |
|---|
Drops specified collection.
| public boolean dropCollection ( $collectionName ) | ||
| $collectionName | string | Name of the collection to be dropped. |
| return | boolean | Whether operation was successful. |
|---|
Drops database associated with this command.
| public boolean dropDatabase ( ) | ||
| return | boolean | Whether operation was successful. |
|---|
Drops collection indexes by name.
| public array dropIndexes ( $collectionName, $indexes ) | ||
| $collectionName | string | Collection name. |
| $indexes | string | Wildcard for name of the indexes to be dropped. |
| return | array | Result data. |
|---|
Marks the end of a code block for profiling.
See also beginProfile().
| protected void endProfile ( $token, $category ) | ||
| $token | string | Token for the code block |
| $category | string | The category of this log message |
Executes this command.
| public \MongoDB\Driver\Cursor execute ( ) | ||
| return | \MongoDB\Driver\Cursor | Result cursor. |
|---|---|---|
| throws | yii\mongodb\Exception | on failure. |
Execute commands batch (bulk).
| public array executeBatch ( $collectionName, $options = [] ) | ||
| $collectionName | string | Collection name. |
| $options | array | Batch options. |
| return | array | Array of 2 elements:
|
|---|---|---|
| throws | yii\mongodb\Exception | on failure. |
| throws | yii\base\InvalidConfigException | on invalid $document format. |
Return an explanation of the query, often useful for optimization and debugging.
| public array explain ( $collectionName, $query ) | ||
| $collectionName | string | Collection name |
| $query | array | Query document. |
| return | array | Explanation of the query. |
|---|
Performs find query.
| public \MongoDB\Driver\Cursor find ( $collectionName, $condition, $options = [] ) | ||
| $collectionName | string | Collection name |
| $condition | array | Filter condition |
| $options | array | Query options. |
| return | \MongoDB\Driver\Cursor | Result cursor. |
|---|
Updates a document and returns it.
| public array|null findAndModify ( $collectionName, $condition = [], $update = [], $options = [] ) | ||
| $collectionName | ||
| $condition | array | Query condition |
| $update | array | Update criteria |
| $options | array | List of options in format: optionName => optionValue. |
| return | array|null | The original document, or the modified document when $options['new'] is set. |
|---|
Retuns read concern for this command.
| public \MongoDB\Driver\ReadConcern|string getReadConcern ( ) | ||
| return | \MongoDB\Driver\ReadConcern|string | Read concern to be used in this command. |
|---|
Returns read preference for this command.
| public \MongoDB\Driver\ReadPreference getReadPreference ( ) | ||
| return | \MongoDB\Driver\ReadPreference | Read preference. |
|---|
Returns write concern for this command.
| public \MongoDB\Driver\WriteConcern|null getWriteConcern ( ) | ||
| return | \MongoDB\Driver\WriteConcern|null | Write concern to be used in this command. |
|---|
Performs aggregation using MongoDB "group" command.
| public array group ( $collectionName, $keys, $initial, $reduce, $options = [] ) | ||
| $collectionName | string | Collection name. |
| $keys | mixed | Fields to group by. If an array or non-code object is passed, it will be the key used to group results. If instance of \MongoDB\BSON\Javascript passed, it will be treated as a function that returns the key to group by. |
| $initial | array | Initial value of the aggregation counter object. |
| $reduce | \MongoDB\BSON\Javascript|string | Function that takes two arguments (the current document and the aggregation to this point) and does the aggregation. Argument will be automatically cast to \MongoDB\BSON\Javascript. |
| $options | array | Optional parameters to the group command. Valid options include:
|
| return | array | The result of the aggregation. |
|---|
Inserts new document into collection.
| public \MongoDB\BSON\ObjectID|boolean insert ( $collectionName, $document, $options = [] ) | ||
| $collectionName | string | Collection name |
| $document | array | Document content |
| $options | array | List of options in format: optionName => optionValue. |
| return | \MongoDB\BSON\ObjectID|boolean | Inserted record ID, |
|---|
Returns the list of available collections.
| public array listCollections ( $condition = [], $options = [] ) | ||
| $condition | array | Filter condition. |
| $options | array | Options list. |
| return | array | Collections information. |
|---|
Returns the list of available databases.
| public array listDatabases ( $condition = [], $options = [] ) | ||
| $condition | array | Filter condition. |
| $options | array | Options list. |
| return | array | Database information |
|---|
Returns information about current collection indexes.
| public array listIndexes ( $collectionName, $options = [] ) | ||
| $collectionName | string | Collection name |
| $options | array | List of options in format: optionName => optionValue. |
| return | array | List of indexes info. |
|---|---|---|
| throws | yii\mongodb\Exception | on failure. |
Logs the command data if logging is enabled at $db.
| protected string|false log ( $namespace, $data, $category ) | ||
| $namespace | array|string | Command namespace. |
| $data | array | Command data. |
| $category | string | Log category |
| return | string|false | Log token, |
|---|
Performs MongoDB "map-reduce" command.
| public string|array mapReduce ( $collectionName, $map, $reduce, $out, $condition = [], $options = [] ) | ||
| $collectionName | string | Collection name. |
| $map | \MongoDB\BSON\Javascript|string | Function, which emits map data from collection. Argument will be automatically cast to \MongoDB\BSON\Javascript. |
| $reduce | \MongoDB\BSON\Javascript|string | Function that takes two arguments (the map key and the map values) and does the aggregation. Argument will be automatically cast to \MongoDB\BSON\Javascript. |
| $out | string|array | Output collection name. It could be a string for simple output ('outputCollection'), or an array for parametrized output (['merge' => 'outputCollection']). You can pass ['inline' => true] to fetch the result at once without temporary collection usage. |
| $condition | array | Filter condition for including a document in the aggregation. |
| $options | array | Additional optional parameters to the mapReduce command. Valid options include:
|
| return | string|array | The map reduce output collection name or output results. |
|---|
Executes this command as a mongo query
| public \MongoDB\Driver\Cursor query ( $collectionName, $options = [] ) | ||
| $collectionName | string | Collection name |
| $options | array | Query options. |
| return | \MongoDB\Driver\Cursor | Result cursor. |
|---|---|---|
| throws | yii\mongodb\Exception | on failure |
Sets read concern for this command.
| public $this setReadConcern ( $readConcern ) | ||
| $readConcern | \MongoDB\Driver\ReadConcern|string | Read concern, it can be an instance of \MongoDB\Driver\ReadConcern or scalar level value, for example: 'local'. |
| return | $this | Self reference |
|---|
Sets read preference for this command.
| public $this setReadPreference ( $readPreference ) | ||
| $readPreference | \MongoDB\Driver\ReadPreference|integer|string|null | Read reference, it can be specified as
instance of \MongoDB\Driver\ReadPreference or scalar mode value, for example: |
| return | $this | Self reference. |
|---|
Sets write concern for this command.
| public $this setWriteConcern ( $writeConcern ) | ||
| $writeConcern | \MongoDB\Driver\WriteConcern|integer|string|null | Write concern, it can be an instance of \MongoDB\Driver\WriteConcern
or its scalar mode value, for example: |
| return | $this | Self reference |
|---|
Update existing documents in the collection.
| public \MongoDB\Driver\WriteResult update ( $collectionName, $condition, $document, $options = [] ) | ||
| $collectionName | string | Collection name |
| $condition | array | Filter condition |
| $document | array | Data to be updated. |
| $options | array | Update options. |
| return | \MongoDB\Driver\WriteResult | Write result. |
|---|


!-->
HTMLmini
github
author
# I'm a comment, no one notices me! # This region contains the MINIhtml source # The region on the right contains the compiled HTML # The region below previews that HTML h2|HTMLmini Sandbox hr p ' Welcome to the HTMLmini sandbox!' ' HTML mini is a concise language that expands into HTML.' ' It is inspired by the likes of ' a[href'http://docs.emmet.io/']|emmet ' and ' a[href'http://haml.info/']|haml ' but focuses on preserving the HTML format while still' ' reducing the number of characters you have to type.' ' MINIhtml doesn\'t offer any crazy preprocessing options,' ' just a simple one-to-one translation to HTML.' p pre code|'
Including escaping HTML!
' p 'Why is HTMLmini awesome?' ul li|'It\'s lightweight' li|'It still looks like the HTML it creates' li|'It\'ll hyou a whole lot of key strokes' h3|Quick Reference table thead tr th|Description th|Source th|Output tbody tr td|Create a new element td.source|'div' td.source|'
' tr td|Setting ids td.source|'#my-id' td|'
' tr td|Setting classes td.source|'.class1.class2' td|'
' tr td|Setting attributes td.source|'[type\'my-type\'disabled]' td.source|'
' tr td|Setting text td.source|'p|Hello World' td.source|'
Hello World
' tr td|Setting text with a string td.source|'"All the characters!@#$%"' td.source|'All the characters!@#$%'


| |
|
Hi,
This is an automated {{report_name}} report from Faros.
{% if data %}
Here is the output of the report:
{% for field in header %}
| {{field}} |
{% endfor %}
{% for row in data %}
{% for field in row %}
| {{field}} |
{% endfor %}
{% endfor %}
{% else %}
This report had no data.
{% endif %}
|
|
|
|


Accuracy (mean of diagonal of confusion matrix) is 61.74%
| Category name | Accuracy | Sample training images | Sample true positives | False positives with true label | False negatives with wrong predicted label | ||||
|---|---|---|---|---|---|---|---|---|---|
| bedroom | 48.28% | store |
kitchen |
livingroom |
livingroom |
||||
| coast | 65.77% | opencountry |
opencountry |
opencountry |
highway |
||||
| forest | 89.91% | mountain |
opencountry |
mountain |
mountain |
||||
| highway | 71.25% | industrial |
opencountry |
opencountry |
mountain |
||||
| industrial | 33.65% | street |
store |
store |
insidecity |
||||
| insidecity | 70.19% | industrial |
tallbuilding |
street |
store |
||||
| kitchen | 44.55% | tallbuilding |
industrial |
livingroom |
bedroom |
||||
| livingroom | 41.80% | industrial |
store |
bedroom |
kitchen |
||||
| mountain | 71.17% | highway |
forest |
forest |
highway |
||||
| office | 70.43% | kitchen |
livingroom |
bedroom |
livingroom |
||||
| opencountry | 59.35% | coast |
coast |
highway |
mountain |
||||
| store | 50.23% | insidecity |
suburb |
insidecity |
tallbuilding |
||||
| street | 57.29% | industrial |
tallbuilding |
store |
opencountry |
||||
| suburb | 78.01% | opencountry |
insidecity |
street |
store |
||||
| tallbuilding | 64.06% | store |
industrial |
industrial |
store |
||||
| Category name | Accuracy | Sample training images | Sample true positives | False positives with true label | False negatives with wrong predicted label |


Luke
1
1 Dear Theophilus,
Many people have written reports about the amazing events that have happened among us.
2 We heard about these things from people who saw them happen, from the time everything first started happening. These people taught others about God's message.
3 I myself have carefully studied everything that these people wrote and taught. So I decided that it would also be good for me to write for you, noble Theophilus, an accurate account of these matters.
4 I am doing this so that you may know that what you have been taught about these things is true.
5 When King Herod ruled the province of Judea, there was a Jewish priest named Zechariah. He belonged to the group of priests called the Abijah group. He and his wife Elizabeth were both descended from Aaron.
6 God considered that both of them were righteous, because they always obeyed without fault everything that God had commanded.
7 But they had no children, because Elizabeth was unable to bear children. Furthermore, she and her husband were very old.
8 One day Zechariah was serving as a priest in the temple in Jerusalem during his group's regular time of service there.
9 Following their custom, the priests chose him by lot to go into the Lord's temple and burn incense.
10 When the time came for him to burn the incense, many people were praying in the courtyard outside the temple.
11 Then an angel whom the Lord had sent appeared to him. The angel was standing at the right side of the altar of incense.
12 When Zechariah saw the angel, he was startled and became very afraid.
13 But the angel said to him, "Zechariah, do not be afraid! When you prayed, the Lord heard your request. So your wife Elizabeth will bear a son for you. You must name him John.
14 You will be very happy, and many other people will also be happy because he is born.
15 God will consider him to be very important. He must never drink wine or any other alcoholic drink. He will be empowered by the Holy Spirit even before he is born.
16 He will persuade many descendants of Israel to stop sinning and start obeying the Lord their God again.
17 Your son will go in advance of the Lord as his forerunner and will be powerful in his spirit like the prophet Elijah was. He will cause parents to love their children again. He will cause many people who do not obey God to live wisely and to obey him as righteous people do. He will do this in order to cause many people to be ready when the Lord comes."
18 Then Zechariah said to the angel, "I am very old, and my wife is also very old. So how can I believe that the things you said will really happen?"
19 Then the angel said to him, "I am Gabriel! I stand in God's presence! I was sent to tell you this good news about what will happen to you.
20 What I have told you will certainly happen at the time God has decided, but you did not believe my words. So now God will cause you to be unable to talk until the day your son is born!"
21 While Zechariah and the angel were talking in the temple, the people in the courtyard were waiting for Zechariah to come out. They wondered why he was staying in the temple for such a long time.
22 When he came out, he was not able to speak to them. Because he could not talk, he made motions with his hands to try to explain what had happened. Then they realized that he had seen a vision from God while he was in the temple.
23 When Zechariah's time to work as a priest in the temple was finished, he left Jerusalem and went to his home.
24 Some time after this, his wife Elizabeth became pregnant, but she did not go out in public for five months.
25 She said to herself, "The Lord has enabled me to become pregnant. In this way, he had compassion on me and has taken away the reason that people looked down on me!"
26 When Elizabeth had been pregnant for almost six months, God sent the angel Gabriel to the town of Nazareth in the district of Galilee.
27 He went there to speak to a virgin named Mary. She was engaged to be married to a man named Joseph, who was a descendent of King David. The virgin's name was Mary.
28 The angel said to her, "Greetings! The Lord is with you and has shown great kindness to you!"
29 But Mary felt very troubled when she heard his greeting. She wondered what the angel meant by these words.
30 Then the angel said to her, "Do not be afraid, Mary, for you have received favor from God!
31 You will become pregnant and give birth to a son, and you must name him Jesus.
32 He will be great and will be called the Son of the Most High God. The Lord God will make him a king over his people as his ancestor David was.
33 He will rule forever over the the descendants of Jacob. He will rule forever!"
34 Then Mary said to the angel, "How can this happen, since I am a virgin?"
35 The angel replied, "The Holy Spirit will come to you and the power of God will cover you. So the baby you will bear will be holy, and he will be called the Son of God.
36 And listen to this. Your relative Elizabeth is pregnant with a son, even though she is very old. And though people thought that she could not bear children, she has now been pregnant for almost six months.
37 For God can do anything!"
38 Then Mary said, "All right, I am the Lord's servant, so let what you have said about me happen!" Then the angel left her.
39 Very soon after that, Mary got ready and went quickly to the highlands of Judea, to the city where Zechariah lived.
40 She entered his house and greeted his wife Elizabeth.
41 As soon as Elizabeth heard Mary greet her, the baby leaped inside Elizabeth's womb.
46 Then Mary praised God by saying:
"Oh, how I praise the Lord!
47 I feel very joyful about God,
who is the one who saves me.
48 I was only his lowly servant girl, but he did not forget me.
So from now on, people living in all time periods will say that God has blessed me.
49 They will say this because of the great things that God, the Powerful One, has done for me.
His name is holy!
50 He acts mercifully from one generation to the next toward those who respect him.
51 He shows people that he is very powerful.
He scatters those who think proudly within their inner beings.
52 He has stopped kings from ruling,
and he has honored people who are oppressed.
53 He has given good things to eat to those who are hungry,
and he has sent away rich people without giving them anything.
54-55 He has helped Israel, the people who serve him.
Long ago he promised our ancestors that he would be merciful to them.
He has kept that promise and has always acted mercifully toward Abraham and all who descended from him."
56 Mary stayed with Elizabeth for about three months. Then she returned to her home.
57 When it was time for Elizabeth to bear her child, she bore a son.
58 Her neighbors and relatives heard how the Lord had been so kind to her, and they were happy along with Elizabeth.
59 On the eighth day after this, people gathered together for the ceremony to circumcise the baby. Since his father's name was Zechariah, they wanted to give the baby the same name.
60 But his mother said, "No, his name must be John!"
61 So they said to her, "But John is not the name of any of your relatives!"
62 Then they made motions with their hands to his father, for him to indicate what name he wanted to be given to his son.
63 So he signaled that they should give him a tablet to write on. When they gave him one, he wrote on it, "His name is John." All those who were there were surprised!
64 Immediately Zechariah was able to speak again, and he began praising God.
65 Everyone who lived nearby was completely awed by what God had done. They told many other people about what had happened and the news spread all over the highlands of Judea.
66 Everyone who heard it kept thinking about it. They were saying, "We wonder what work this child will do when he grows up!" Because of everything that had happened, they were sure that God would be helping him in a powerful way.
67 After Zechariah's son was born, Zechariah was controlled by the Holy Spirit and he spoke these words from God:
68 "Praise the Lord, the God whom we people of Israel worship,
because he has come to set us, his people, free.
69 He is sending us someone who will powerfully save us,
someone who is descended from his servant, King David.
70 Long ago God caused his prophets to say that he would do that.
71 This powerful Savior will rescue us from our enemies,
and he will save us from the power of all those who hate us.
72 He has done this because he is merciful to our ancestors and remembers his holy covenant,
73 which is the oath that he promised to our ancestor Abraham.
74 God promised to rescue us from the power of our enemies,
and to enable us to serve him without being afraid,
75 in holy and righteous ways all of our lives.
76 Then Zechariah said this to his baby son:
"My child, you will be called a prophet
of the Most High God.
You will go ahead of the Lord
to prepare a people to be ready when he comes.
77 You will tell people that God is able to forgive them and save them from being punished for their sins.
78 God will forgive us because he is kind and merciful to us.
And because of that, this Savior, who is like the rising sun,
will come to us from heaven to help us.
79 He will shine on people who live in spiritual darkness and in the fear of death.
He will guide us so that we will live peacefully.
80 Over time, Zechariah and Elizabeth's baby boy grew up and became spiritually strong. Then he lived in a desolate region and was still living there when he began to preach publicly to God's people, Israel. l


|
PX4 Firmware
PX4 Autopilot Software http://px4.io
|
Header for a battery monitor connected via SMBus (I2C). More...
#include <px4_config.h>
#include <px4_workqueue.h>
#include <stdio.h>
#include <string.h>
#include <ecl/geo/geo.h>
#include <drivers/device/CDev.hpp>
#include <drivers/device/Device.hpp>
#include <drivers/device/i2c.h>
#include <drivers/drv_device.h>
#include <drivers/drv_hrt.h>
#include <uORB/topics/battery_status.h>
Go to the source code of this file.
Classes | |
| class | BATT_SMBUS |
Macros | |
| #define | DATA_BUFFER_SIZE 32 |
| #define | BATT_SMBUS_I2C_BUS PX4_I2C_BUS_EXPANSION |
| #define | BATT_SMBUS_CURRENT 0x0A |
| current register More... | |
| #define | BATT_SMBUS_AVERAGE_CURRENT 0x0B |
| current register More... | |
| #define | BATT_SMBUS_ADDR 0x0B |
| Default 7 bit address I2C address. 8 bit = 0x16. More... | |
| #define | BATT_SMBUS_ADDR_MIN 0x00 |
| lowest possible address More... | |
| #define | BATT_SMBUS_ADDR_MAX 0xFF |
| highest possible address More... | |
| #define | BATT_SMBUS_PEC_POLYNOMIAL 0x07 |
| Polynomial for calculating PEC. More... | |
| #define | BATT_SMBUS_TEMP 0x08 |
| temperature register More... | |
| #define | BATT_SMBUS_VOLTAGE 0x09 |
| voltage register More... | |
| #define | BATT_SMBUS_FULL_CHARGE_CAPACITY 0x10 |
| capacity when fully charged More... | |
| #define | BATT_SMBUS_RUN_TIME_TO_EMPTY 0x11 |
| predicted remaining battery capacity based on the present rate of discharge in min More... | |
| #define | BATT_SMBUS_AVERAGE_TIME_TO_EMPTY 0x12 |
| predicted remaining battery capacity based on the present rate of discharge in min More... | |
| #define | BATT_SMBUS_REMAINING_CAPACITY 0x0F |
| predicted remaining battery capacity as a percentage More... | |
| #define | BATT_SMBUS_CYCLE_COUNT 0x17 |
| number of cycles the battery has experienced More... | |
| #define | BATT_SMBUS_DESIGN_CAPACITY 0x18 |
| design capacity register More... | |
| #define | BATT_SMBUS_DESIGN_VOLTAGE 0x19 |
| design voltage register More... | |
| #define | BATT_SMBUS_MANUFACTURER_NAME 0x20 |
| manufacturer name More... | |
| #define | BATT_SMBUS_MANUFACTURE_DATE 0x1B |
| manufacture date register More... | |
| #define | BATT_SMBUS_SERIAL_NUMBER 0x1C |
| serial number register More... | |
| #define | BATT_SMBUS_MEASUREMENT_INTERVAL_US 100000 |
| time in microseconds, measure at 10Hz More... | |
| #define | BATT_SMBUS_TIMEOUT_US 1000000 |
| timeout looking for battery 10seconds after startup More... | |
| #define | BATT_SMBUS_MANUFACTURER_ACCESS 0x00 |
| #define | BATT_SMBUS_MANUFACTURER_DATA 0x23 |
| #define | BATT_SMBUS_MANUFACTURER_BLOCK_ACCESS 0x44 |
| #define | BATT_SMBUS_SECURITY_KEYS 0x0035 |
Typedefs | |
| typedef device::Device *(* | BATT_SMBUS_constructor) (int) |
Functions | |
| void | batt_smbus_usage () |
| Nuttshell accessible method to return the driver usage arguments. More... | |
| int | manufacture_date () |
| Nuttshell accessible method to return the battery manufacture date. More... | |
| int | manufacturer_name () |
| Nuttshell accessible method to return the battery manufacturer name. More... | |
| int | serial_number () |
| Nuttshell accessible method to return the battery serial number. More... | |
| device::Device * | BATT_SMBUS_I2C_interface (int bus) |
Header for a battery monitor connected via SMBus (I2C).
Designed for BQ40Z50-R1/R2
Definition in file batt_smbus.h.
| #define BATT_SMBUS_ADDR 0x0B |
Default 7 bit address I2C address. 8 bit = 0x16.
Definition at line 69 of file batt_smbus.h.
Referenced by BATT_SMBUS::search_addresses().
| #define BATT_SMBUS_ADDR_MAX 0xFF |
highest possible address
Definition at line 71 of file batt_smbus.h.
Referenced by BATT_SMBUS::search_addresses().
| #define BATT_SMBUS_ADDR_MIN 0x00 |
lowest possible address
Definition at line 70 of file batt_smbus.h.
Referenced by BATT_SMBUS::search_addresses().
| #define BATT_SMBUS_AVERAGE_CURRENT 0x0B |
| #define BATT_SMBUS_AVERAGE_TIME_TO_EMPTY 0x12 |
predicted remaining battery capacity based on the present rate of discharge in min
Definition at line 77 of file batt_smbus.h.
Referenced by BATT_SMBUS::cycle().
| #define BATT_SMBUS_CURRENT 0x0A |
| #define BATT_SMBUS_CYCLE_COUNT 0x17 |
number of cycles the battery has experienced
Definition at line 79 of file batt_smbus.h.
Referenced by BATT_SMBUS::get_startup_info().
| #define BATT_SMBUS_DESIGN_CAPACITY 0x18 |
design capacity register
Definition at line 80 of file batt_smbus.h.
| #define BATT_SMBUS_DESIGN_VOLTAGE 0x19 |
design voltage register
Definition at line 81 of file batt_smbus.h.
| #define BATT_SMBUS_FULL_CHARGE_CAPACITY 0x10 |
capacity when fully charged
Definition at line 75 of file batt_smbus.h.
Referenced by BATT_SMBUS::get_startup_info().
| #define BATT_SMBUS_I2C_BUS PX4_I2C_BUS_EXPANSION |
Definition at line 66 of file batt_smbus.h.
| #define BATT_SMBUS_MANUFACTURE_DATE 0x1B |
manufacture date register
Definition at line 83 of file batt_smbus.h.
Referenced by BATT_SMBUS::manufacture_date().
| #define BATT_SMBUS_MANUFACTURER_ACCESS 0x00 |
Definition at line 87 of file batt_smbus.h.
| #define BATT_SMBUS_MANUFACTURER_BLOCK_ACCESS 0x44 |
Definition at line 89 of file batt_smbus.h.
Referenced by BATT_SMBUS::block_read(), BATT_SMBUS::dataflash_read(), BATT_SMBUS::dataflash_write(), BATT_SMBUS::manufacturer_read(), and BATT_SMBUS::manufacturer_write().
| #define BATT_SMBUS_MANUFACTURER_DATA 0x23 |
Definition at line 88 of file batt_smbus.h.
| #define BATT_SMBUS_MANUFACTURER_NAME 0x20 |
manufacturer name
Definition at line 82 of file batt_smbus.h.
Referenced by BATT_SMBUS::manufacturer_name().
| #define BATT_SMBUS_MEASUREMENT_INTERVAL_US 100000 |
time in microseconds, measure at 10Hz
Definition at line 85 of file batt_smbus.h.
Referenced by BATT_SMBUS::cycle().
| #define BATT_SMBUS_PEC_POLYNOMIAL 0x07 |
Polynomial for calculating PEC.
Definition at line 72 of file batt_smbus.h.
Referenced by BATT_SMBUS::get_pec().
| #define BATT_SMBUS_REMAINING_CAPACITY 0x0F |
predicted remaining battery capacity as a percentage
Definition at line 78 of file batt_smbus.h.
Referenced by BATT_SMBUS::cycle(), and BATT_SMBUS::get_startup_info().
| #define BATT_SMBUS_RUN_TIME_TO_EMPTY 0x11 |
predicted remaining battery capacity based on the present rate of discharge in min
Definition at line 76 of file batt_smbus.h.
Referenced by BATT_SMBUS::cycle().
| #define BATT_SMBUS_SECURITY_KEYS 0x0035 |
Definition at line 90 of file batt_smbus.h.
| #define BATT_SMBUS_SERIAL_NUMBER 0x1C |
serial number register
Definition at line 84 of file batt_smbus.h.
Referenced by BATT_SMBUS::get_serial_number(), and BATT_SMBUS::get_startup_info().
| #define BATT_SMBUS_TEMP 0x08 |
| #define BATT_SMBUS_TIMEOUT_US 1000000 |
timeout looking for battery 10seconds after startup
Definition at line 86 of file batt_smbus.h.
| #define BATT_SMBUS_VOLTAGE 0x09 |
voltage register
Definition at line 74 of file batt_smbus.h.
Referenced by BATT_SMBUS::cycle(), and BATT_SMBUS::search_addresses().
| #define DATA_BUFFER_SIZE 32 |
Definition at line 64 of file batt_smbus.h.
Referenced by BATT_SMBUS::block_read(), BATT_SMBUS::dataflash_read(), BATT_SMBUS::dataflash_write(), BATT_SMBUS::manufacturer_read(), and BATT_SMBUS::manufacturer_write().
| typedef device::Device*(* BATT_SMBUS_constructor) (int) |
Definition at line 120 of file batt_smbus.h.
| device::Device * BATT_SMBUS_I2C_interface | ( | int | bus | ) |
Definition at line 109 of file batt_smbus_i2c.cpp.
References BATT_SMBUS_I2C::BATT_SMBUS_I2C().
| void batt_smbus_usage | ( | ) |
Nuttshell accessible method to return the driver usage arguments.
| int manufacture_date | ( | ) |
Nuttshell accessible method to return the battery manufacture date.
Definition at line 160 of file batt_smbus_main.cpp.
References batt_smbus::bus_options, batt_smbus::batt_smbus_bus_option::dev, batt_smbus::batt_smbus_bus_option::devpath, BATT_SMBUS::manufacture_date(), NUM_BUS_OPTIONS, PX4_ERROR, PX4_INFO, PX4_OK, and PX4_WARN.
Referenced by batt_smbus_main().
| int manufacturer_name | ( | ) |
Nuttshell accessible method to return the battery manufacturer name.
Definition at line 189 of file batt_smbus_main.cpp.
References batt_smbus::bus_options, batt_smbus::batt_smbus_bus_option::dev, batt_smbus::batt_smbus_bus_option::devpath, BATT_SMBUS::manufacturer_name(), NUM_BUS_OPTIONS, PX4_ERROR, PX4_INFO, PX4_OK, and PX4_WARN.
Referenced by batt_smbus_main().
| int serial_number | ( | ) |
Nuttshell accessible method to return the battery serial number.
Definition at line 213 of file batt_smbus_main.cpp.
References batt_smbus::bus_options, batt_smbus::batt_smbus_bus_option::dev, batt_smbus::batt_smbus_bus_option::devpath, BATT_SMBUS::get_serial_number(), NUM_BUS_OPTIONS, PX4_INFO, and PX4_OK.
Referenced by batt_smbus_main(), and ADIS16448::probe().


print_message_lines/3
print_message_lines(
+Stream,
+Severity,
+Lines)
Print the Lines to Stream, preceding each line with a prefix corresponding to Severity.
Any valid output stream.
[query,help,informational,warning,error,silent,
term]
Must be of the form [
Line1,
Line2, ...]
, where each
Linei must be of the form
[
Control_1-Args_1,
Control_2-Args_2, ...]
.
If Severity is a valid severity, the prefix will be as described
for print_message/2
, otherwise Severity itself will be
used as the prefix. If Severity is query
, no newline is
written after the last line (otherwise, a newline is written).
This predicate is intended to be used in conjunction with
user:message_hook/3
. After a message is intercepted using
user:message_hook/3
, this command is used to print the lines.
If the hook has not been defined, the arguments are those provided by
the system.
Stream errors (see ref-iou-sfh-est), plus:
instantiation_error
type_error
Suppose you want to intercept messages and force them to go to a different stream:
user:message_hook(Severity, Message, Lines):- my_stream(MyStream), print_message_lines(MyStream, Severity, Lines).


Browse our spring collection of useful webmaster tools and resources! Everything from JavaScript, CSS to PHP are covered!


--- layout: page description: "The Engineering Graduate Students Association of UCLA" ---
Engineering Graduate Students Association (eGSA) of UCLA represents the graduate students of the seven departments of the Henry Samueli School of Engineering and Applied Sciences (HSSEAS). We host events for graduate students, work with the administration, and strive to make the graduate experience productive, smooth, fruitful, and fun.


{% load static %} {% load bornhack %}
{{ invoice.created|date:"b jS, Y" }}
|
{{ invoice.order.invoice_address|linebreaks }}
{% else %}| Name | Quantity | Price |
Total
| |
{{ order_product.product.name }}
|
{{ order_product.quantity }}
|
{{ order_product.product.price|currency }}
|
{{ order_product.total|currency }}
{% endfor %}
| |
|
Included Danish VAT (25%)
|
{{ invoice.order.vat|currency }}
|
|
Invoice Total
|
{{ invoice.order.total|currency }}
| | |
Note: Danish law grants everyone a 14 days 'cooling-off' period for internet purchases, in which the customer can regret the purchase for any reason (including just changing your mind). In case you regret this purchase please contact us on<EMAIL_ADDRESS>for a full refund. This is possible until {{ invoice.regretdate|date:"b jS, Y" }}. Please see our General Terms & Conditions on our website for more information on order cancellation.


Demonstration of selected keystream generators based on LFSRs (linear feedback shift registers)
Name
Register length
Function
Contents
Generate
Generate key
Key length:
Geffe generator
(LFSR 1 & 2 & 3)
Stop-and-Go generator
(LFSR 1 & 2 & 3)
Shrinking generator
(LFSR 1 & 2)
Test key (FIPS PUB 140-2)
The mono bit test
The poker test
The long runs test
Generated key:


BEGIN
Good
Music
and
Booze
Spirits
to
Improve
Your
Mood
Good
Spirits
Are you 21
YES
or older?
NO
Good
Spirits
BACK
Too
So
BACK
Bad
Sad...
Good
Spirits
Select your preferred mood:
Happy
Zen
Thirsty
Sad
Energized
Calm
Good
Spirits
Select your choice of music:
Rock
Music
R&B
Music
Jazz
Music
Country
Music
Indie
Music
EDM
Music
Good
Spirits
Select your choice of liquor:
Brandy
Tequila
Rum
Vodka
Whiskey
Gin
Good
Spirits
RESTART
Listen
Drink


boData
Product Mentions
Sentiment Analysis
Logout
Sentiment Analysis
Product
coffee
muffins
latte
water
chocolate
cookie
Location
New York
Sentence
Sentiment
Confidence
Example: I love this soda
positive
99
Ready to Leave?
×
Select "Logout" below if you are ready to end your current session.


{% extends "base.html" %} {% block content %}
Tools for converting between various data types to the Discursis CSV type.


Is V still fast?
Monitoring compilation speed for each commit.
Running on a free tier AWS t2.micro instance (1 vCPU). Typical desktop hardware is 2-3 times faster.
Source code: fast.v
| timestamp |
commit |
commit message |
v -o v.c |
v -o v |
v -native 1mil.v |
v hello.v |
v.c size |
parse |
check |
cgen |
scan |
V lines |
V lines/s |


THE SEASON OF MEN A film review by Rachel Gordon Copyright 2001 filmcritic.com
The Season of Men is a ponderous portrait of Arab women slowly freeing themselves from tradition, each generation getting just a touch more gutsy than the one before it.
Aicha (Rabia Ben Abdallah) is the matron who starts the domino effect. After being married to Said (Ezzedine Gennoun) for some time, she decides she doesn't want to wait for the one month of the year that he returns, as is the custom of the village. Said finally relents that if she bears him a son, the family will move to the city with him. It's the dream of every woman in the village, each wife takes turns to joyfully brag about it even knowing the chances it will actually happen are slim.
She bears two healthy girls, Meriem (Ghania Benali) and Emna (Hend Sabri), and finally a son, Aziz (Adel Hergal). But after having moved to be close to Said, it becomes apparent that Aziz has health problems, and Aicha is blamed for this. Now, even more estranged from Said, Aicha decides to move back home with her daughters in tow.
But Aicha finds it difficult to keep close tabs on her growing daughters. Meriem is married but can't seem to provide her husband with sex whereas Emna sleeps with a married man and doesn't acknowledge tradition at all.
This setup could have become a gripping story of women coming into independent power, but it falls short of the mark by concentrating too much on flashbacks to drive cultural difficulties home. Again and again we see Aicha fight with her overbearing, power-hungry mother-in-law for the rights of her daughters. And when these scenes aren't taking over, there's always a cryptic "character looking in the mirror" shot right around the corner.
It is regrettable that the story doesn't focus more on interaction between Aicha and her daughters in the present. After all, Aicha has chosen to drag them away from their lives, due to Aziz's constant need for care. Instead of elaborating on how these women are becoming different from their predecessors, it repetitively concentrates on scenes of feminine claustrophobia within the community.
Still, there are beautifully poignant moments to this film. Each character is able to shine through a mixture of emotions. Watching Aicha stand up for her rights during especially emotional scenes demands respect for her decisions, even when they are fallible. Emna is allowed a strong, simple exploration of what she's learned when she tells her married lover that she never wants to marry. The overall strength of these women is articulated well through being three-dimensional instead of perfect icons.
The men are thankfully not seen as completely tyrannical, which is unusual for a film about female empowerment. For the most part they are simply following tradition, and some are open to allowing women more space.
The cultural details can also be refreshing, such as how these women prepare for their men with henna. It is interesting to see how every person in a given family has a specific task no matter their skill. Aziz is a young boy with health problems, but he is put to work weaving carpets.
The Season of Men is a unique cultural study of gradual feminine growth within a strict community. Though it has its share of misses, it is still a positive and reflexive look at a people much ignored.
Aka La saison des hommes.

Visit filmcritic.com on the Web at http://www.filmcritic.com
========== X-RAMR-ID: 29606 X-Language: en X-RT-ReviewID: 251697 X-RT-TitleID: 10000776 X-RT-SourceID: 178 X-RT-AuthorID: 3953 X-RT-RatingText: 2.5/5
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


The Airbus A380 is a double-deck, wide-body, four-engine jet airliner manufactured by European manufacturer Airbus. It is the world's largest passenger airliner, and the airports at which it operates have upgraded facilities to accommodate it. It was initially named Airbus A3XX and designed to challenge Boeing's monopoly in the large-aircraft market. The A380 made its first flight on 27 April 2005 and entered commercial service on 25 October 2007 with Singapore Airlines.
The A380's upper deck extends along the entire length of the fuselage, with a width equivalent to a wide-body aircraft. This gives the A380-800's cabin 550 square metres (5,920 sq ft) of usable floor space, 40% more than the next largest airliner, the Boeing 747-8, and provides seating for 525 people in a typical three-class configuration or up to 853 people in an all-economy class configuration. The A380-800 has a design range of 8,500 nautical miles (15,700 km), serving the second- and third-longest non-stop scheduled flights in the world (as of February 2017), and a cruising speed of Mach 0.85 (about 900 km/h, 560 mph or 490 kt at cruising altitude).
As of May 2017, Airbus had received 317 firm orders and delivered 213 aircraft; Emirates is the biggest A380 customer with 142 ordered of which 95 have been delivered.


I am a strong person. I am a strong person.
I am a strong person. I am a strong person.
I am a strong person. I am a strong person.
I am a strong person. I am a strong person.
Some text A quote in a paragraph
Some text.
In this example, :lang defines the quotation marks for q elements with lang="no":
Note: IE8 supports the :lang pseudo class only if a !DOCTYPE is specified.
Note: IE8 supports the :focus pseudo-class only if a !DOCTYPE is specified.


1.5 million transactions in that address. one does not want to importaddress that
blackjok3r17-Jan-19 04:12 PM
man that would be basically impossible
with - resan
jorian17-Jan-19 04:14 PM
so how does LABS mining work again?
all rewards go to a multisig?
and then daily 33% is split?
blackjok3r17-Jan-19 04:15 PM
no. 51% PoS
49% PoW
and 33% ( it was 10% I increased it a lot) of the total BR of 10 is sent in one transaction to the multi sig address every 1440 blocks
BR is 10 LABS ...
jorian17-Jan-19 04:16 PM
ahh. so that means 3.33 LABS per day go to the multisig
blackjok3r17-Jan-19 04:16 PM
yes... with 33% ... it was 10% but this was far too low IMO
jorian17-Jan-19 04:17 PM
what is the multisig good for?
blackjok3r17-Jan-19 04:19 PM
the multi sig is to pay notaries... I really couldnt figure out a way to make it pay them automatically. So we decided on a semi decentralised trust model of 15 ppl in a multi sig say 8/9 singers, that agree on a tally of notarisations (Alright has a py script that tallies them already)
Then each node is paid realtive to it preformance
jorian17-Jan-19 04:19 PM
ah of course, i was confused with easy mining from official notaries
not all labs notaries will mine(edited)
blackjok3r17-Jan-19 04:20 PM
they can stake I think... but it will hurt their ntoarisation counts
unless use diffrent node
jorian17-Jan-19 04:20 PM
yes, different node
any ETA?
blackjok3r17-Jan-19 04:20 PM
This is just about ready
I cant find any more bugs
maybe a test launch for 1 week
jorian17-Jan-19 04:21 PM
let's make a KMDLABS-lab
SHossain17-Jan-19 04:21 PM
@blackjok3r I guess ~1 KMD/month/node is good for current LABS NN. (based on my LABS node count currently) . for 20 nodes it would be 20 KMD/month. I can provide 100 KMD which should last 4-5 months? (i'm not the best guy for math)
jorian17-Jan-19 04:21 PM
i'd be happy to provide some KMD as well
blackjok3r17-Jan-19 04:22 PM
Yeah I will throw in some too, as will Alrght he said(edited)
SHossain17-Jan-19 04:22 PM
yes, if more NN ops come forward wtih some donation, that can cover the KMD costs
let me know which address you want the KMD to be sent
blackjok3r17-Jan-19 04:22 PM
we wil use teh multisig for ntoaries
and make a sendmany to fund them
The people who get multi sig at the start Im sure were already sorted. Need to confirm with @Alright though.
jorian17-Jan-19 04:24 PM
can't we make (probably james) a cc-faucet that can only send a certain amount of LABS to one of the LABS notaries per day?
blackjok3r17-Jan-19 04:24 PM
The idea was to pay it based on notariations... if you just pay a flat fee... thats probly possible to pay a faucet instead of a multisig.
but that delays things
While the change later will mean a hardfork... its a hard problem to solve and Id rather use the cluster itself to test such things than on the main chain.
jorian17-Jan-19 04:25 PM
ok
blackjok3r17-Jan-19 04:26 PM
if we make the multi sige number to high one person can withhold our pay (edited)
jorian17-Jan-19 04:27 PM
a group of persons
what is the M of N now?
blackjok3r17-Jan-19 04:27 PM
15 of 19 to be multisig, and then M to be decided
jl777c17-Jan-19 04:28 PM
cant . have 19
19 is more than 15
jorian17-Jan-19 04:28 PM
that's what he said
blackjok3r17-Jan-19 04:28 PM
ther is total 19, 15 of those
jl777c17-Jan-19 04:28 PM
ah, ok
1
jorian17-Jan-19 04:28 PM
8 of 15? too many? then there is at least a majority
blackjok3r17-Jan-19 04:29 PM
yeah 8 is what I wrote in the proposal I think
as long as majorty it should be good
jorian17-Jan-19 04:29 PM
oh haha
jl777c17-Jan-19 04:29 PM
maybe make it 5?
blackjok3r17-Jan-19 04:30 PM
5? to decide who gets paid what out of 33% of all mined coins?
jl777c17-Jan-19 04:30 PM
i am thinking about attrition and losing coins
blackjok3r17-Jan-19 04:30 PM
Hopefully this is ony temporary and it onyl happens once every 2 months...
jl777c17-Jan-19 04:30 PM
will there be 5 evil notaries
blackjok3r17-Jan-19 04:31 PM
surley we can get majority of notaries
jorian17-Jan-19 04:31 PM
Definition of attrition - sorrow for one's sins that arises from a motive other than that of the love of God
sounds about right
blackjok3r17-Jan-19 04:34 PM
5 ... it depnds how they are chosen.. I think with who we ahve now 5 is ok... its not something easily changed once done this.
jorian17-Jan-19 04:34 PM
well
how do elections work?
every 3 months?
blackjok3r17-Jan-19 04:34 PM
there are no elections
jorian17-Jan-19 04:34 PM
do the 9 worst notaries drop out?
oh
blackjok3r17-Jan-19 04:34 PM
the top nodes are kept
and teh bottom goes to a lottery
jorian17-Jan-19 04:35 PM
doing what exactly?
blackjok3r17-Jan-19 04:35 PM
maybe in this model 5 is a good idea
Bar_F1sh_Rel17-Jan-19 04:35 PM
I ran out of KMD on my labs notary 4 days ago
blackjok3r17-Jan-19 04:36 PM
!kmd tip @Bar_F1sh_Rel 1
!kmdtip @Bar_F1sh_Rel 1
KMD TipBotBOT17-Jan-19 04:36 PM
TipBot
Cannot tip with entered amount.
blackjok3r17-Jan-19 04:36 PM
must have ran out too
Bar_F1sh_Rel17-Jan-19 04:37 PM
Lol
jorian17-Jan-19 04:37 PM
!kmdtip 1 @Bar_F1sh_Rel
KMD TipBotBOT17-Jan-19 04:37 PM
TipBot
Cannot tip with entered amount.
jorian17-Jan-19 04:37 PM
what
add tip?
blackjok3r17-Jan-19 04:38 PM
Bot is on a fork?
jorian17-Jan-19 04:38 PM
!kmdtip tip @Bar_F1sh_Rel 1
KMD TipBotBOT17-Jan-19 04:38 PM
TipBot
Cannot tip with entered amount.
blackjok3r17-Jan-19 04:39 PM
yeah mine is empty too many rains
I put like 500 on it when it came out
jorian17-Jan-19 04:39 PM
lol
!kmdtip @Bar_F1sh_Rel 1
KMD TipBotBOT17-Jan-19 04:39 PM
TipBot
@jorian (jorian#4555)
You tipped @Bar_F1sh_Rel1 KMD
jorian17-Jan-19 04:39 PM
there ya go
Bar_F1sh_Rel17-Jan-19 04:39 PM
blackjok3r17-Jan-19 04:41 PM
hopefully his wallet filter doesnt filter it becauer it less than 1
Do you guys want a flag or RPC to switch that on and off?
TonyL17-Jan-19 04:41 PM
Nice proposal. When Binance?
1
1
1
Bar_F1sh_Rel17-Jan-19 04:42 PM
It's OK - that will add to my. 0.2 balance
blackjok3r17-Jan-19 04:42 PM
Not sure binance can take a coin like this for a fair while... while we have tried to break the tech as much as we can, there may still be flaws yet to be discovered.
1
jorian17-Jan-19 04:44 PM
is LABS going to be notarized btw?
1
TonyL17-Jan-19 04:46 PM
What will be a block reward and total supply of LABS?
blackjok3r17-Jan-19 04:47 PM
LABS is notarised ... to KMD already by its own notaries
BR is 10 .. divided PoS /PoW and notary nodes... total supply is uncapped 10 BR forever...


|
DBLPQueryEngine
0.1
|
Files | |
| file | Author.java |
| file | Data.java |
| file | Database.java |
| file | mainClass.java |
| file | myFrame.java |
| file | myPanel.java |
| file | myQuery1Panel.java |
| file | myQuery2Panel.java |
| file | myQuery3Panel.java |
| file | ParseEntityResolution.java |
| file | Parser.java |
| file | Query1Handler.java |
| file | Query2Handler.java |
| file | Query3Handler.java |
| file | ResultPanel.java |


bash
binarybash
processread
as an alternative to the sleep
commandstrftime
This is an alternative to sed
, awk
, perl
and other tools. The function below works by finding all leading and trailing white-space and removing it from the start and end of the string. The :
built-in is used in place of a temporary variable.
Example Function:
trim_string() {
# Usage: trim_string " example string "
: "${1#"${1%%[![:space:]]*}"}"
: "${_%"${_
---
## *[![:space:]]}"}"
printf '%s\n' "$_"
}
Example Usage:
$ trim_string " Hello, World "
Hello, World
$ name=" John Black "
$ trim_string "$name"
John Black
This is an alternative to sed
, awk
, perl
and other tools. The function below works by abusing word splitting to create a new string without leading/trailing white-space and with truncated spaces.
Example Function:
# shellcheck disable=SC2086,SC2048
trim_all() {
# Usage: trim_all " example string "
set -f
set -- $*
printf '%s\n' "$*"
set +f
}
Example Usage:
$ trim_all " Hello, World "
Hello, World
$ name=" John Black is my name. "
$ trim_all "$name"
John Black is my name.
The result of bash
’s regex matching can be used to replace sed
for a large number of use-cases.
CAVEAT: This is one of the few platform dependent bash
features. bash
will use whatever regex engine is installed on the user’s system. Stick to POSIX regex features if aiming for compatibility.
CAVEAT: This example only prints the first matching group. When using multiple capture groups some modification is needed.
Example Function:
Example Usage:
$ # Trim leading white-space.
$ regex ' hello' '^\s*(.*)'
hello
$ # Validate a hex color.
$ regex "#FFFFFF" '^(#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3}))$'
#FFFFFF
$ # Validate a hex color (invalid).
$ regex "red" '^(#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3}))$'
# no output (invalid)
Example Usage in script:
is_hex_color() {
if [[ $1 =~ ^(#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3}))$ ]]; then
printf '%s\n' "${BASH_REMATCH[1]}"
else
printf '%s\n' "error: $1 is an invalid color."
return 1
fi
}
read -r color
is_hex_color "$color" || color="#FFFFFF"
# Do stuff.
CAVEAT: Requires bash
4+
This is an alternative to cut
, awk
and other tools.
Example Function:
split() {
# Usage: split "string" "delimiter"
IFS=$'\n' read -d "" -ra arr <<< "${1//$2/$'\n'}"
printf '%s\n' "${arr[@]}"
}
Example Usage:
$ split "apples,oranges,pears,grapes" ","
apples
oranges
pears
grapes
$ split "1, 2, 3, 4, 5" ", "
1
2
3
4
5
# Multi char delimiters work too!
$ split "hello---world---my---name---is---john" "---"
hello
world
my
name
is
john
CAVEAT: Requires bash
4+
Example Function:
Example Usage:
$ lower "HELLO"
hello
$ lower "HeLlO"
hello
$ lower "hello"
hello
CAVEAT: Requires bash
4+
Example Function:
Example Usage:
$ upper "hello"
HELLO
$ upper "HeLlO"
HELLO
$ upper "HELLO"
HELLO
CAVEAT: Requires bash
4+
Example Function:
Example Usage:
$ reverse_case "hello"
HELLO
$ reverse_case "HeLlO"
hElLo
$ reverse_case "HELLO"
hello
Example Function:
Example Usage:
$ var="'Hello', \"World\""
$ trim_quotes "$var"
Hello, World
Example Function:
Example Usage:
$ strip_all "The Quick Brown Fox" "[aeiou]"
Th Qck Brwn Fx
$ strip_all "The Quick Brown Fox" "[[:space:]]"
TheQuickBrownFox
$ strip_all "The Quick Brown Fox" "Quick "
The Brown Fox
Example Function:
Example Usage:
$ strip "The Quick Brown Fox" "[aeiou]"
Th Quick Brown Fox
$ strip "The Quick Brown Fox" "[[:space:]]"
TheQuick Brown Fox
Example Function:
Example Usage:
$ lstrip "The Quick Brown Fox" "The "
Quick Brown Fox
Example Function:
Example Usage:
$ rstrip "The Quick Brown Fox" " Fox"
The Quick Brown
Example Function:
urlencode() {
# Usage: urlencode "string"
local LC_ALL=C
for (( i = 0; i < ${#1}; i++ )); do
: "${1:i:1}"
case "$_" in
[a-zA-Z0-9.~_-])
printf '%s' "$_"
;;
*)
printf '%%%02X' "'$_"
;;
esac
done
printf '\n'
}
Example Usage:
$ urlencode "https://github.com/dylanaraps/pure-bash-bible"
https%3A%2F%2Fgithub.com%2Fdylanaraps%2Fpure-bash-bible
Example Function:
Example Usage:
$ urldecode "https%3A%2F%2Fgithub.com%2Fdylanaraps%2Fpure-bash-bible"
https://github.com/dylanaraps/pure-bash-bible
Using a test:
if [[ $var == *sub_string* ]]; then
printf '%s\n' "sub_string is in var."
fi
# Inverse (substring not in string).
if [[ $var != *sub_string* ]]; then
printf '%s\n' "sub_string is not in var."
fi
# This works for arrays too!
if [[ ${arr[*]} == *sub_string* ]]; then
printf '%s\n' "sub_string is in array."
fi
Using a case statement:
case "$var" in
*sub_string*)
# Do stuff
;;
*sub_string2*)
# Do more stuff
;;
*)
# Else
;;
esac
if [[ $var == sub_string* ]]; then
printf '%s\n' "var starts with sub_string."
fi
# Inverse (var does not start with sub_string).
if [[ $var != sub_string* ]]; then
printf '%s\n' "var does not start with sub_string."
fi
if [[ $var == *sub_string ]]; then
printf '%s\n' "var ends with sub_string."
fi
# Inverse (var does not end with sub_string).
if [[ $var != *sub_string ]]; then
printf '%s\n' "var does not end with sub_string."
fi
Enabling extdebug
allows access to the BASH_ARGV
array which stores the current function’s arguments in reverse.
CAVEAT: Requires shopt -s compat44
in bash
5.0+.
Example Function:
reverse_array() {
# Usage: reverse_array "array"
shopt -s extdebug
f()(printf '%s\n' "${BASH_ARGV[@]}"); f "$@"
shopt -u extdebug
}
Example Usage:
$ reverse_array 1 2 3 4 5
5
4
3
2
1
$ arr=(red blue green)
$ reverse_array "${arr[@]}"
green
blue
red
Create a temporary associative array. When setting associative array values and a duplicate assignment occurs, bash overwrites the key. This allows us to effectively remove array duplicates.
CAVEAT: Requires bash
4+
CAVEAT: List order may not stay the same.
Example Function:
remove_array_dups() {
# Usage: remove_array_dups "array"
declare -A tmp_array
for i in "$@"; do
[[ $i ]] && IFS=" " tmp_array["${i:- }"]=1
done
printf '%s\n' "${!tmp_array[@]}"
}
Example Usage:
$ remove_array_dups 1 1 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 5
1
2
3
4
5
$ arr=(red red green blue blue)
$ remove_array_dups "${arr[@]}"
red
green
blue
Example Function:
random_array_element() {
# Usage: random_array_element "array"
local arr=("$@")
printf '%s\n' "${arr[RANDOM % $#]}"
}
Example Usage:
$ array=(red green blue yellow brown)
$ random_array_element "${array[@]}"
yellow
# Multiple arguments can also be passed.
$ random_array_element 1 2 3 4 5 6 7
3
Each time the printf
is called, the next array element is printed. When the print hits the last array element it starts from the first element again.
This works the same as above, this is just a different use case.
Alternative to seq
.
# Loop from 0-100 (no variable support).
for i in {0..100}; do
printf '%s\n' "$i"
done
Alternative to seq
.
# Loop from 0-VAR.
VAR=50
for ((i=0;i<=VAR;i++)); do
printf '%s\n' "$i"
done
arr=(apples oranges tomatoes)
# Just elements.
for element in "${arr[@]}"; do
printf '%s\n' "$element"
done
arr=(apples oranges tomatoes)
# Elements and index.
for i in "${!arr[@]}"; do
printf '%s\n' "${arr[i]}"
done
# Alternative method.
for ((i=0;i<${#arr[@]};i++)); do
printf '%s\n' "${arr[i]}"
done
while read -r line; do
printf '%s\n' "$line"
done < "file"
Don’t use ls
.
# Greedy example.
for file in *; do
printf '%s\n' "$file"
done
# PNG files in dir.
for file in ~/Pictures/*.png; do
printf '%s\n' "$file"
done
# Iterate over directories.
for dir in ~/Downloads/*/; do
printf '%s\n' "$dir"
done
# Brace Expansion.
for file in /path/to/parentdir/{file1,file2,subdir/file3}; do
printf '%s\n' "$file"
done
# Iterate recursively.
shopt -s globstar
for file in ~/Pictures/**/*; do
printf '%s\n' "$file"
done
shopt -u globstar
CAVEAT: bash
does not handle binary data properly in versions < 4.4
.
Alternative to the cat
command.
file_data="$(<"file")"
Alternative to the cat
command.
# Bash <4 (discarding empty lines).
IFS=$'\n' read -d "" -ra file_data < "file"
# Bash <4 (preserving empty lines).
while read -r line; do
file_data+=("$line")
done < "file"
# Bash 4+
mapfile -t file_data < "file"
Alternative to the head
command.
CAVEAT: Requires bash
4+
Example Function:
Example Usage:
$ head 2 ~/.bashrc
# Prompt
PS1='➜ '
$ head 1 ~/.bashrc
# Prompt
Alternative to the tail
command.
CAVEAT: Requires bash
4+
Example Function:
Example Usage:
$ tail 2 ~/.bashrc
# Enable tmux.
# [[ -z "$TMUX" ]] && exec tmux
$ tail 1 ~/.bashrc
# [[ -z "$TMUX" ]] && exec tmux
Alternative to wc -l
.
Example Function (bash 4):
Example Function (bash 3):
This method uses less memory than the mapfile
method and works in bash
3 but it is slower for bigger files.
lines_loop() {
# Usage: lines_loop "file"
count=0
while IFS= read -r _; do
((count++))
done < "$1"
printf '%s\n' "$count"
}
Example Usage:
$ lines ~/.bashrc
48
$ lines_loop ~/.bashrc
48
This works by passing the output of the glob to the function and then counting the number of arguments.
Example Function:
Example Usage:
# Count all files in dir.
$ count ~/Downloads/*
232
# Count all dirs in dir.
$ count ~/Downloads/*/
45
# Count all jpg files in dir.
$ count ~/Pictures/*.jpg
64
Alternative to touch
.
# Shortest.
>file
# Longer alternatives:
:>file
echo -n >file
printf '' >file
Example Function:
extract() {
# Usage: extract file "opening marker" "closing marker"
while IFS=$'\n' read -r line; do
[[ $extract && $line != "$3" ]] &&
printf '%s\n' "$line"
[[ $line == "$2" ]] && extract=1
[[ $line == "$3" ]] && extract=
done < "$1"
}
Example Usage:
# Extract code blocks from MarkDown file.
$ extract ~/projects/pure-bash/README.md '```sh' '```'
# Output here...
Alternative to the dirname
command.
Example Function:
dirname() {
# Usage: dirname "path"
local tmp=${1:-.}
[[ $tmp != *[!/]* ]] && {
printf '/\n'
return
}
tmp=${tmp%%"${tmp
---
## *[!/]}"}
[[ $tmp != */* ]] && {
printf '.\n'
return
}
tmp=${tmp%/*}
tmp=${tmp%%"${tmp
---
## *[!/]}"}
printf '%s\n' "${tmp:-/}"
}
Example Usage:
$ dirname ~/Pictures/Wallpapers/1.jpg
/home/black/Pictures/Wallpapers
$ dirname ~/Pictures/Downloads/
/home/black/Pictures
Alternative to the basename
command.
Example Function:
basename() {
# Usage: basename "path" ["suffix"]
local tmp
tmp=${1%"${1
---
## *[!/]}"}
tmp=${tmp
---
## */}
tmp=${tmp%"${2/"$tmp"}"}
printf '%s\n' "${tmp:-/}"
}
Example Usage:
$ basename ~/Pictures/Wallpapers/1.jpg
1.jpg
$ basename ~/Pictures/Wallpapers/1.jpg .jpg
1
$ basename ~/Pictures/Downloads/
Downloads
$ hello_world="value"
# Create the variable name.
$ var="world"
$ ref="hello_$var"
# Print the value of the variable name stored in 'hello_$var'.
$ printf '%s\n' "${!ref}"
value
Alternatively, on bash
4.3+:
$ hello_world="value"
$ var="world"
# Declare a nameref.
$ declare -n ref=hello_$var
$ printf '%s\n' "$ref"
value
$ var="world"
$ declare "hello_$var=value"
$ printf '%s\n' "$hello_world"
value
Contrary to popular belief, there is no issue in utilizing raw escape sequences. Using tput
abstracts the same ANSI sequences as if printed manually. Worse still, tput
is not actually portable. There are a number of tput
variants each with different commands and syntaxes (try tput setaf 3
on a FreeBSD system). Raw sequences are fine.
NOTE: Sequences requiring RGB values only work in True-Color Terminal Emulators.
| Sequence | What does it do? | Value |
|---|---|---|
\e[38;5;<NUM>m |
Set text foreground color. | 0-255 |
\e[48;5;<NUM>m |
Set text background color. | 0-255 |
\e[38;2;<R>;<G>;<B>m |
Set text foreground color to RGB color. | R , G , B |
\e[48;2;<R>;<G>;<B>m |
Set text background color to RGB color. | R , G , B |
NOTE: Prepend 2 to any code below to turn it’s effect off (examples: 21=bold text off, 22=faint text off, 23=italic text off).
| Sequence | What does it do? |
|---|---|
\e[m |
Reset text formatting and colors. |
\e[1m |
Bold text. |
\e[2m |
Faint text. |
\e[3m |
Italic text. |
\e[4m |
Underline text. |
\e[5m |
Blinking text. |
\e[7m |
Highlighted text. |
\e[8m |
Hidden text. |
\e[9m |
Strike-through text. |
| Sequence | What does it do? | Value |
|---|---|---|
\e[<LINE>;<COLUMN>H |
Move cursor to absolute position. | line , column |
\e[H |
Move cursor to home position (0,0 ). |
|
\e[<NUM>A |
Move cursor up N lines. | num |
\e[<NUM>B |
Move cursor down N lines. | num |
\e[<NUM>C |
Move cursor right N columns. | num |
\e[<NUM>D |
Move cursor left N columns. | num |
\e[s |
Save cursor position. | |
\e[u |
Restore cursor position. |
| Sequence | What does it do? |
|---|---|
\e[K |
Erase from cursor position to end of line. |
\e[1K |
Erase from cursor position to start of line. |
\e[2K |
Erase the entire current line. |
\e[J |
Erase from the current line to the bottom of the screen. |
\e[1J |
Erase from the current line to the top of the screen. |
\e[2J |
Clear the screen. |
\e[2J\e[H |
Clear the screen and move cursor to 0,0 . |
| Parameter | What does it do? |
|---|---|
${!VAR} |
Access a variable based on the value of VAR . |
${!VAR*} |
Expand to IFS separated list of variable names starting with VAR . |
${!VAR@} |
Expand to IFS separated list of variable names starting with VAR . If double-quoted, each variable name expands to a separate word. |
| Parameter | What does it do? |
|---|---|
${VAR#PATTERN} |
Remove shortest match of pattern from start of string. |
| `${VAR |
| Remove longest match of pattern from start of string. | |
${VAR%PATTERN}` | Remove shortest match of pattern from end of string. | | `${VAR%%PATTERN}| Remove longest match of pattern from end of string. | |
${VAR/PATTERN/REPLACE}` | Replace first match with string. | `${VAR//PATTERN/REPLACE}| Replace all matches with string. |
${VAR/PATTERN}` | Remove first match. | `${VAR//PATTERN}` | Remove all matches.| Parameter | What does it do? |
|---|---|
${#VAR} |
Length of var in characters. |
${#ARR[@]} |
Length of array in elements. |
| Parameter | What does it do? |
|---|---|
${VAR:OFFSET} |
Remove first N chars from variable. |
${VAR:OFFSET:LENGTH} |
Get substring from N character to N character. ( ${VAR:10:10} : Get sub-string from char 10 to char 20 ) |
${VAR:: OFFSET} |
Get first N chars from variable. |
${VAR:: -OFFSET} |
Remove last N chars from variable. |
${VAR: -OFFSET} |
Get last N chars from variable. |
${VAR:OFFSET:-OFFSET} |
Cut first N chars and last N chars. |
| Parameter | What does it do? | CAVEAT |
|---|---|---|
${VAR^} |
Uppercase first character. | bash 4+ |
${VAR^^} |
Uppercase all characters. | bash 4+ |
${VAR,} |
Lowercase first character. | bash 4+ |
${VAR,,} |
Lowercase all characters. | bash 4+ |
${VAR~} |
Reverse case of first character. | bash 4+ |
${VAR~~} |
Reverse case of all characters. | bash 4+ |
| Parameter | What does it do? |
|---|---|
${VAR:-STRING} |
If VAR is empty or unset, use STRING as its value. |
${VAR-STRING} |
If VAR is unset, use STRING as its value. |
${VAR:=STRING} |
If VAR is empty or unset, set the value of VAR to STRING . |
${VAR=STRING} |
If VAR is unset, set the value of VAR to STRING . |
${VAR:+STRING} |
If VAR is not empty, use STRING as its value. |
${VAR+STRING} |
If VAR is set, use STRING as its value. |
${VAR:?STRING} |
Display an error if empty or unset. |
${VAR?STRING} |
Display an error if unset. |
# Syntax: {<START>..<END>}
# Print numbers 1-100.
echo {1..100}
# Print range of floats.
echo 1.{1..9}
# Print chars a-z.
echo {a..z}
echo {A..Z}
# Nesting.
echo {A..Z}{0..9}
# Print zero-padded numbers.
# CAVEAT: bash 4+
echo {01..100}
# Change increment amount.
# Syntax: {<START>..<END>..<INCREMENT>}
# CAVEAT: bash 4+
echo {1..10..2} # Increment by 2.
echo {apples,oranges,pears,grapes}
# Example Usage:
# Remove dirs Movies, Music and ISOS from ~/Downloads/.
rm -rf ~/Downloads/{Movies,Music,ISOS}
| Expression | Value | What does it do? |
|---|---|---|
-a |
file |
If file exists. |
-b |
file |
If file exists and is a block special file. |
-c |
file |
If file exists and is a character special file. |
-d |
file |
If file exists and is a directory. |
-e |
file |
If file exists. |
-f |
file |
If file exists and is a regular file. |
-g |
file |
If file exists and its set-group-id bit is set. |
-h |
file |
If file exists and is a symbolic link. |
-k |
file |
If file exists and its sticky-bit is set |
-p |
file |
If file exists and is a named pipe (FIFO). |
-r |
file |
If file exists and is readable. |
-s |
file |
If file exists and its size is greater than zero. |
-t |
fd |
If file descriptor is open and refers to a terminal. |
-u |
file |
If file exists and its set-user-id bit is set. |
-w |
file |
If file exists and is writable. |
-x |
file |
If file exists and is executable. |
-G |
file |
If file exists and is owned by the effective group ID. |
-L |
file |
If file exists and is a symbolic link. |
-N |
file |
If file exists and has been modified since last read. |
-O |
file |
If file exists and is owned by the effective user ID. |
-S |
file |
If file exists and is a socket. |
| Expression | What does it do? |
|---|---|
file -ef file2 |
If both files refer to the same inode and device numbers. |
file -nt file2 |
If file is newer than file2 (uses modification time) or file exists and file2 does not. |
file -ot file2 |
If file is older than file2 (uses modification time) or file2 exists and file does not. |
| Expression | Value | What does it do? |
|---|---|---|
-o |
opt |
If shell option is enabled. |
-v |
var |
If variable has a value assigned. |
-R |
var |
If variable is a name reference. |
-z |
var |
If the length of string is zero. |
-n |
var |
If the length of string is non-zero. |
| Expression | What does it do? |
|---|---|
var = var2 |
Equal to. |
var == var2 |
Equal to (synonym for = ). |
var != var2 |
Not equal to. |
var < var2 |
Less than (in ASCII alphabetical order.) |
var > var2 |
Greater than (in ASCII alphabetical order.) |
| Operators | What does it do? |
|---|---|
= |
Initialize or change the value of a variable. |
| Operators | What does it do? |
|---|---|
+ |
Addition |
- |
Subtraction |
* |
Multiplication |
/ |
Division |
** |
Exponentiation |
% |
Modulo |
+= |
Plus-Equal (Increment a variable.) |
-= |
Minus-Equal (Decrement a variable.) |
*= |
Times-Equal (Multiply a variable.) |
/= |
Slash-Equal (Divide a variable.) |
%= |
Mod-Equal (Remainder of dividing a variable.) |
| Operators | What does it do? |
|---|---|
<< |
Bitwise Left Shift |
<<= |
Left-Shift-Equal |
>> |
Bitwise Right Shift |
>>= |
Right-Shift-Equal |
& |
Bitwise AND |
&= |
Bitwise AND-Equal |
\| |
Bitwise OR |
\|= |
Bitwise OR-Equal |
~ |
Bitwise NOT |
^ |
Bitwise XOR |
^= |
Bitwise XOR-Equal |
| Operators | What does it do? |
|---|---|
! |
NOT |
&& |
AND |
\|\| |
OR |
| Operators | What does it do? | Example |
|---|---|---|
, |
Comma Separator | ((a=1,b=2,c=3)) |
# Simple math
((var=1+2))
# Decrement/Increment variable
((var++))
((var--))
((var+=1))
((var-=1))
# Using variables
((var=var2*arr[2]))
# Set the value of var to var2 if var2 is greater than var.
# var: variable to set.
# var2>var: Condition to test.
# ?var2: If the test succeeds.
# :var: If the test fails.
((var=var2>var?var2:var))
Traps allow a script to execute code on various signals. In pxltrm (a pixel art editor written in bash) traps are used to redraw the user interface on window resize. Another use case is cleaning up temporary files on script exit.
Traps should be added near the start of scripts so any early errors are also caught.
NOTE: For a full list of signals, see trap -l
.
# Clear screen on script exit.
trap 'printf \\e[2J\\e[H\\e[m' EXIT
trap '' INT
# Call a function on window resize.
trap 'code_here' SIGWINCH
trap 'code_here' DEBUG
trap 'code_here' RETURN
If unicode is not required, it can be disabled for a performance increase. Results may vary however there have been noticeable improvements in neofetch and other programs.
# Disable unicode.
LC_ALL=C
LANG=C
Use #!/usr/bin/env bash
instead of #!/bin/bash
.
PATH
to find the bash
binary./bin/
which can cause issues.NOTE: There are times when one may have a good reason for using #!/bin/bash
or another direct path to the binary.
# Right:
#!/usr/bin/env bash
# Less right:
#!/bin/bash
Use $()
instead of ` `
.
# Right.
var="$(command)"
# Wrong.
var=`command`
# $() can easily be nested whereas `` cannot.
var="$(command "$(command)")"
Do not use the function
keyword, it reduces compatibility with older versions of bash
.
# Right.
do_something() {
# ...
}
# Wrong.
function do_something() {
# ...
}
bash
binary"$BASH"
bash
process# As a string.
"$BASH_VERSION"
# As an array.
"${BASH_VERSINFO[@]}"
"$EDITOR" "$file"
# NOTE: This variable may be empty, set a fallback value.
"${EDITOR:-vi}" "$file"
# Current function.
"${FUNCNAME[0]}"
# Parent function.
"${FUNCNAME[1]}"
# So on and so forth.
"${FUNCNAME[2]}"
"${FUNCNAME[3]}"
# All functions including parents.
"${FUNCNAME[@]}"
"$HOSTNAME"
# NOTE: This variable may be empty.
# Optionally set a fallback to the hostname command.
"${HOSTNAME:-$(hostname)}"
"$HOSTTYPE"
This can be used to add conditional support for different Operating Systems without needing to call uname
.
"$OSTYPE"
This is an alternative to the pwd
built-in.
"$PWD"
"$SECONDS"
Each time $RANDOM
is used, a different integer between 0
and 32767
is returned. This variable should not be used for anything related to security (this includes encryption keys etc).
"$RANDOM"
This is handy when writing scripts in pure bash and stty
/tput
can’t be called.
Example Function:
get_term_size() {
# Usage: get_term_size
# (:;:) is a micro sleep to ensure the variables are
# exported immediately.
shopt -s checkwinsize; (:;:)
printf '%s\n' "$LINES $COLUMNS"
}
Example Usage:
# Output: LINES COLUMNS
$ get_term_size
15 55
CAVEAT: This does not work in some terminal emulators.
Example Function:
get_window_size() {
# Usage: get_window_size
printf '%b' "${TMUX:+\\ePtmux;\\e}\\e[14t${TMUX:+\\e\\\\}"
IFS=';t' read -d t -t 0.05 -sra term_size
printf '%s\n' "${term_size[1]}x${term_size[2]}"
}
Example Usage:
# Output: WIDTHxHEIGHT
$ get_window_size
1200x800
# Output (fail):
$ get_window_size
x
This is useful when creating a TUI in pure bash.
Example Function:
get_cursor_pos() {
# Usage: get_cursor_pos
IFS='[;' read -p $'\e[6n' -d R -rs _ y x _
printf '%s\n' "$x $y"
}
Example Usage:
# Output: X Y
$ get_cursor_pos
1 8
Example Function:
hex_to_rgb() {
# Usage: hex_to_rgb "#FFFFFF"
# hex_to_rgb "000000"
: "${1/\#}"
((r=16#${_:0:2},g=16#${_:2:2},b=16#${_:4:2}))
printf '%s\n' "$r $g $b"
}
Example Usage:
$ hex_to_rgb "#FFFFFF"
255 255 255
Example Function:
Example Usage:
$ rgb_to_hex "255" "255" "255"
#FFFFFF
for
loop syntax# Tiny C Style.
for((;i++<10;)){ echo "$i";}
# Undocumented method.
for i in {1..10};{ echo "$i";}
# Expansion.
for i in {1..10}; do echo "$i"; done
# C Style.
for((i=0;i<=10;i++)); do echo "$i"; done
# Normal method
while :; do echo hi; done
# Shorter
for((;;)){ echo hi;}
# Normal method
f(){ echo hi;}
# Using a subshell
f()(echo hi)
# Using arithmetic
# This can be used to assign integer values.
# Example: f a=1
# f a++
f()(($1))
# Using tests, loops etc.
# NOTE: ‘while’, ‘until’, ‘case’, ‘(())’, ‘[[]]’ can also be used.
f()if true; then echo "$1"; fi
f()for i in "$@"; do echo "$i"; done
if
syntax# One line
# Note: The 3rd statement may run when the 1st is true
[[ $var == hello ]] && echo hi || echo bye
[[ $var == hello ]] && { echo hi; echo there; } || echo bye
# Multi line (no else, single statement)
# Note: The exit status may not be the same as with an if statement
[[ $var == hello ]] &&
echo hi
# Multi line (no else)
[[ $var == hello ]] && {
echo hi
# ...
}
case
statement to set variableThe :
built-in can be used to avoid repeating variable=
in a case statement. The $_
variable stores the last argument of the last command. :
always succeeds so it can be used to store the variable value.
# Modified snippet from Neofetch.
case "$OSTYPE" in
"darwin"*)
: "MacOS"
;;
"linux"*)
: "Linux"
;;
*"bsd"* | "dragonfly" | "bitrig")
: "BSD"
;;
"cygwin" | "msys" | "win32")
: "Windows"
;;
*)
printf '%s\n' "Unknown OS detected, aborting..." >&2
exit 1
;;
esac
# Finally, set the variable.
os="$_"
read
as an alternative to the sleep
commandSurprisingly, sleep
is an external command and not a bash
built-in.
CAVEAT: Requires bash
4+
Example Function:
Example Usage:
read_sleep 1
read_sleep 0.1
read_sleep 30
For performance-critical situations, where it is not economic to open and close an excessive number of file descriptors, the allocation of a file descriptor may be done only once for all invocations of read
:
(See the generic original implementation at https://blog.dhampir.no/content/sleeping-without-a-subprocess-in-bash-and-how-to-sleep-forever)
exec {sleep_fd}<> <(:)
while some_quick_test; do
# equivalent of sleep 0.001
read -t 0.001 -u $sleep_fd
done
# There are 3 ways to do this and either one can be used.
type -p executable_name &>/dev/null
hash executable_name &>/dev/null
command -v executable_name &>/dev/null
# As a test.
if type -p executable_name &>/dev/null; then
# Program is in PATH.
fi
# Inverse.
if ! type -p executable_name &>/dev/null; then
# Program is not in PATH.
fi
# Example (Exit early if program is not installed).
if ! type -p convert &>/dev/null; then
printf '%s\n' "error: convert is not installed, exiting..."
exit 1
fi
strftime
Bash’s printf
has a built-in method of getting the date which can be used in place of the date
command.
CAVEAT: Requires bash
4+
Example Function:
Example Usage:
# Using above function.
$ date "%a %d %b - %l:%M %p"
Fri 15 Jun - 10:00 AM
# Using printf directly.
$ printf '%(%a %d %b - %l:%M %p)T\n' "-1"
Fri 15 Jun - 10:00 AM
# Assigning a variable using printf.
$ printf -v date '%(%a %d %b - %l:%M %p)T\n' '-1'
$ printf '%s\n' "$date"
Fri 15 Jun - 10:00 AM
CAVEAT: Requires bash
4.4+
$ : \\u
# Expand the parameter as if it were a prompt string.
$ printf '%s\n' "${_@P}"
black
CAVEAT: The generated value is not cryptographically secure.
Example Function:
uuid() {
# Usage: uuid
C="89ab"
for ((N=0;N<16;++N)); do
B="$((RANDOM%256))"
case "$N" in
6) printf '4%x' "$((B%16))" ;;
8) printf '%c%x' "${C:$RANDOM%${#C}:1}" "$((B%16))" ;;
3|5|7|9)
printf '%02x-' "$B"
;;
*)
printf '%02x' "$B"
;;
esac
done
printf '\n'
}
Example Usage:
$ uuid
d5b6c731-1310-4c24-9fe3-55d556d44374
This is a simple way of drawing progress bars without needing a for loop in the function itself.
Example Function:
bar() {
# Usage: bar 1 10
# ^----- Elapsed Percentage (0-100).
# ^-- Total length in chars.
((elapsed=$1*$2/100))
# Create the bar with spaces.
printf -v prog "%${elapsed}s"
printf -v total "%$(($2-elapsed))s"
printf '%s\r' "[${prog// /-}${total}]"
}
Example Usage:
for ((i=0;i<=100;i++)); do
# Pure bash micro sleeps (for the example).
(:;:) && (:;:) && (:;:) && (:;:) && (:;:)
# Print the bar.
bar "$i" "10"
done
printf '\n'
get_functions() {
# Usage: get_functions
IFS=$'\n' read -d "" -ra functions < <(declare -F)
printf '%s\n' "${functions[@]//declare -f }"
}
# alias
ls
# command
# shellcheck disable=SC1001
\ls
# function
ls
# command
command ls
This will run the given command and keep it running, even after the terminal or SSH connection is terminated. All output is ignored.
bkr() {
(nohup "$@" &>/dev/null &)
}
bkr ./some_script.sh # some_script.sh is now running in the background
CAVEAT: Requires bash
4+
This uses local namerefs to avoid using var=$(some_func)
style command substitution for function output capture.


The project Administrator (usually the person who created the project in the first place) can invite other Code Co-op users to the collaboration.
If you are the administrator, you invite a person to the project by selecting Project > Invite menu item. The invite dialog has more options in the version Pro than in the version Lite of Code Co-op. Select the next page depenging on what version you are using.


[§667-36] Sale of property separately. If the mortgaged property consists of more than one real property, each property may be sold separately to satisfy the mortgage debt. [L 1998, c 122, pt of §1]


Evangelion Episode Generator Create your own Evangelion title! Please note this is a complete beta that probably breaks and lacks options. Please fill this Title of your show Episode number Name of the episode Generate


title = "Edit Profile"
url = "/account/profile"
layout = "_main-layout"
is_hidden = 0
[session]
security = "user"
redirect = "auth/login"
[account]
paramCode = "code"
forceSecure = 0
requirePassword = 0
==
Update your player profile
Edit Profile
To change these details, please confirm your current password.


Color Coordinates vs. Metallic Glass Molar Fraction. Plots of CIELAB L*, a*, and b* coordinates vs. the metallic glass molar fraction x. Roughly linear dependencies are revealed, suggesting that the overall color of the composite follows the rule of mixtures, which implies that the microstructures of the composites are visually unresolved.


Black Forest [bd52], forest, in Tenka, peasants: 101
Last updated Turn #135
Black Forest [bd52], forest, in Tenka, peasants: 101
------------------------------------------------------------------------
5: Pleasure Sloop [v5n], ship, 30 hulls, 1 rowing port, 90 sails,
5: 7% damaged, arrived from Ocean [be52], owner:
5: Dorothy [v1b], Pen, with one peasant, 94 sailors
6: Pleasure Sloop [v5n], ship, 30 hulls, 1 rowing port, 90 sails,
6: 7% damaged, departed for Ocean [bd51].
Routes leaving Black Forest:
North, forest, to Black Forest [bc52], 8 days
Garrison [fk3t], garrison, uncontrolled, with six peasants
East, forest, to Black Forest [bd53], 8 days
Garrison [ba9m], garrison, uncontrolled, with two soldiers
South, to Ocean [be52], Crystal Sea, 2 days
West, to Ocean [bd51], Crystal Sea, 2 days
Inner locations:
Graveyard [ad0d], graveyard, 1 day
Seen here:
Stack of centaurs [bi0z], centaurs, number: 42
Pantoff [m5h], refugee, "Incursos coalition"
Alexeiev [d2t], refugee
Stack of centaurs [fg4k], centaurs, number: 27
Stack of centaurs [go8m], centaurs, number: 7
Mob [bi8n], angry peasants, number: 30, on guard


@* * Copyright 2018 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @( id: String, label: String, example: String ="", legendClass: String ="", errorKey: String ="", dayErrorKey: String ="", monthErrorKey: String ="", yearErrorKey: String = "", valueDay: Field, valueMonth: Field, valueYear: Field, secondaryLabel: Option[String] = None, hint: Option[String] = None )(implicit messages: Messages)


This island is flat with sand dunes and date palms. It is the most northerly of the southern group and is due south of Sal.
Be aware that this island can be poorly charted in some publications and subject to abnormal magnetic variations.
Position 16° 10'36"N, 22° 55'20"W (Sal Rei anchorage)
Clearance is possible at Porto de Sal Rei.
The Port office is at the head of the old dock.
The port of Sal Rei is on the western side of the island.
Anchor east of the small island of Ile de Sal Rei, close to the beach to avoid the worst of the swell. The dinghy can be left at either the fishermen's quay or on the beach. This anchorage is very exposed and rolly and not safe in a southerly.
The island is full of tourists in the season.
Updated June 2012.