Console Tools, Shells & Tasks
CakePHP features not only a web framework but also a console framework for
creating console applications. Console applications are ideal for handling a
variety of background tasks such as maintenance, and completing work outside of
the request-response cycle. CakePHP console applications allow you to reuse your
application classes from the command line.
CakePHP comes with a number of console applications out of the box. Some of
these applications are used in concert with other CakePHP features (like i18n),
and others are for general use to get you working faster.
The CakePHP Console
This section provides an introduction into CakePHP at the command-line. Console
tools are ideal for use in cron jobs, or command line based utilities that don’t
need to be accessible from a web browser.
PHP provides a CLI client that makes interfacing with your file system and
applications much smoother. The CakePHP console provides a framework for
creating shell scripts. The Console uses a dispatcher-type setup to load a shell
or task, and provide its parameters.
Note
A command-line (CLI) build of PHP must be available on the system
if you plan to use the Console.
Before we get into specifics, let’s make sure you can run the CakePHP console.
First, you’ll need to bring up a system shell. The examples shown in this
section will be in bash, but the CakePHP Console is Windows-compatible as well.
This example assumes that the user is currently logged into a bash prompt and is
currently at the root of a CakePHP application.
A CakePHP application contains src/Shell and src/Shell/Task directories
that contain all of its shells and tasks. It also comes with an executable in
the bin directory:
$ cd /path/to/app
$ bin/cake
Note
For Windows, the command needs to be bin\cake
(note the backslash).
Running the Console with no arguments produces this help message:
Welcome to CakePHP v3.5.0 Console
---------------------------------------------------------------
App : App
Path: /Users/markstory/Sites/cakephp-app/src/
---------------------------------------------------------------
Current Paths:
-app: src
-root: /Users/markstory/Sites/cakephp-app
-core: /Users/markstory/Sites/cakephp-app/vendor/cakephp/cakephp
Changing Paths:
Your working path should be the same as your application path. To change your path use the '-app' param.
Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp
Available Shells:
- version
- help
- cache
- completion
- i18n
- orm_cache
- plugin
- routes
- server
- bug
- console
- event
- orm
- bake
- bake.bake
- migrations
- migrations.migrations
To run a command, type `cake shell_name [args|options]`
To get help on a specific command, type `cake shell_name --help`
The first information printed relates to paths. This is helpful if you’re
running the console from different parts of the filesystem.
You could then run the any of the listed shells by using its name:
# run server shell
bin/cake server
# run migrations shell
bin/cake migrations -h
# run bake (with plugin prefix)
bin/cake bake.bake -h
Plugin shells can be invoked without a plugin prefix if the shell’s name does
not overlap with an application or framework shell. In the case that two plugins
provide a shell with the same name, the first loaded plugin will get the short
alias. You can always use the plugin.shell
format to unambiguously reference
a shell.
-
class
Cake\Console\
Shell
Creating a Shell
Let’s create a shell for use in the Console. For this example, we’ll create a
simple Hello world shell. In your application’s src/Shell directory create
HelloShell.php. Put the following code inside it:
namespace App\Shell;
use Cake\Console\Shell;
class HelloShell extends Shell
{
public function main()
{
$this->out('Hello world.');
}
}
The conventions for shell classes are that the class name should match the file
name, with the suffix of Shell. In our shell we created a main()
method.
This method is called when a shell is called with no additional commands. We’ll
add some more commands in a bit, but for now let’s just run our shell. From your
application directory, run:
You should see the following output:
As mentioned before, the main()
method in shells is a special method called
whenever there are no other commands or arguments given to a shell. Since our
main method wasn’t very interesting let’s add another command that does
something:
namespace App\Shell;
use Cake\Console\Shell;
class HelloShell extends Shell
{
public function main()
{
$this->out('Hello world.');
}
public function heyThere($name = 'Anonymous')
{
$this->out('Hey there ' . $name);
}
}
After saving this file, you should be able to run the following command and see
your name printed out:
bin/cake hello hey_there your-name
Any public method not prefixed by an _
is allowed to be called from the
command line. As you can see, methods invoked from the command line are
transformed from the underscored shell argument to the correct camel-cased
method name in the class.
In our heyThere()
method we can see that positional arguments are provided
to our heyThere()
function. Positional arguments are also available in the
args
property.
You can access switches or options on shell applications, which are available at
$this->params
, but we’ll cover that in a bit.
When using a main()
method you won’t be able to use the positional
arguments. This is because the first positional argument or option is
interpreted as the command name. If you want to use arguments, you should use
method names other than main
.
Shell Tasks
There will be times when building more advanced console applications, you’ll
want to compose functionality into re-usable classes that can be shared across
many shells. Tasks allow you to extract commands into classes. For example the
bake
command is made almost entirely of tasks. You define a tasks for a
shell using the $tasks
property:
class UserShell extends Shell
{
public $tasks = ['Template'];
}
You can use tasks from plugins using the standard plugin syntax.
Tasks are stored in Shell/Task/
in files named after their classes. So if
we were to create a new ‘FileGenerator’ task, you would create
src/Shell/Task/FileGeneratorTask.php.
Each task must at least implement a main()
method. The ShellDispatcher,
will call this method when the task is invoked. A task class looks like:
namespace App\Shell\Task;
use Cake\Console\Shell;
class FileGeneratorTask extends Shell
{
public function main()
{
}
}
A shell can also access its tasks as properties, which makes tasks great for
making re-usable chunks of functionality similar to
Components:
// Found in src/Shell/SeaShell.php
class SeaShell extends Shell
{
// Found in src/Shell/Task/SoundTask.php
public $tasks = ['Sound'];
public function main()
{
$this->Sound->main();
}
}
You can also access tasks directly from the command line:
Note
In order to access tasks directly from the command line, the task
must be included in the shell class’ $tasks property.
Also, the task name must be added as a sub-command to the Shell’s OptionParser:
public function getOptionParser()
{
$parser = parent::getOptionParser();
$parser->addSubcommand('sound', [
// Provide help text for the command list
'help' => 'Execute The Sound Task.',
// Link the option parsers together.
'parser' => $this->Sound->getOptionParser(),
]);
return $parser;
}
Loading Tasks On The Fly with TaskRegistry
You can load tasks on the fly using the Task registry object. You can load tasks
that were not declared in $tasks this way:
$project = $this->Tasks->load('Project');
Would load and return a ProjectTask instance. You can load tasks from plugins
using:
$progressBar = $this->Tasks->load('ProgressBar.ProgressBar');
Using Models in Your Shells
You’ll often need access to your application’s business logic in shell
utilities; CakePHP makes that super easy. You can load models in shells, just as
you would in a controller using loadModel()
. The loaded models are set as
properties attached to your shell:
namespace App\Shell;
use Cake\Console\Shell;
class UserShell extends Shell
{
public function initialize()
{
parent::initialize();
$this->loadModel('Users');
}
public function show()
{
if (empty($this->args[0])) {
// Use error() before CakePHP 3.2
return $this->abort('Please enter a username.');
}
$user = $this->Users->findByUsername($this->args[0])->first();
$this->out(print_r($user, true));
}
}
The above shell, will fetch a user by username and display the information
stored in the database.
Shell Helpers
If you have complex output generation logic, you can use
Shell Helpers to encapsulate this logic in a re-usable way.
Invoking Other Shells from Your Shell
-
Cake\Console\Shell::
dispatchShell
($args)
There are still many cases where you will want to invoke one shell from another though.
Shell::dispatchShell()
gives you the ability to call other shells by providing the
argv
for the sub shell. You can provide arguments and options either
as var args or as a string:
// As a string
$this->dispatchShell('schema create Blog --plugin Blog');
// As an array
$this->dispatchShell('schema', 'create', 'Blog', '--plugin', 'Blog');
The above shows how you can call the schema shell to create the schema for a plugin
from inside your plugin’s shell.
Creating Files
-
Cake\Console\Shell::
createFile
($path, $contents)
Many Shell applications help automate development or deployment tasks. Creating
files is often important in these use cases. CakePHP provides an easy way to
create a file at a given path:
$this->createFile('bower.json', $stuff);
If the Shell is interactive, a warning will be generated, and the user asked if
they want to overwrite the file if it already exists. If the shell’s
interactive property is false
, no question will be asked and the file will
simply be overwritten.
Console Output
The Shell
class provides a few methods for outputting content:
// Write to stdout
$this->out('Normal message');
// Write to stderr
$this->err('Error message');
// Write to stderr and raise a stop exception
$this->abort('Fatal error');
// Before CakePHP 3.2. Write to stderr and exit()
$this->error('Fatal error');
It also provides two convenience methods regarding the output level:
// Would only appear when verbose output is enabled (-v)
$this->verbose('Verbose message');
// Would appear at all levels.
$this->quiet('Quiet message');
Shell also includes methods for clearing output, creating blank lines, or
drawing a line of dashes:
// Output 2 newlines
$this->out($this->nl(2));
// Clear the user's screen
$this->clear();
// Draw a horizontal line
$this->hr();
Lastly, you can update the current line of text on the screen using
_io->overwrite()
:
$this->out('Counting down');
$this->out('10', 0);
for ($i = 9; $i > 0; $i--) {
sleep(1);
$this->_io->overwrite($i, 0, 2);
}
It is important to remember, that you cannot overwrite text
once a new line has been output.
Console Output Levels
Shells often need different levels of verbosity. When running as cron jobs,
most output is un-necessary. And there are times when you are not interested in
everything that a shell has to say. You can use output levels to flag output
appropriately. The user of the shell, can then decide what level of detail
they are interested in by setting the correct flag when calling the shell.
Cake\Console\Shell::out()
supports 3 types of output by default.
QUIET
- Only absolutely important information should be marked for quiet
output.
NORMAL
- The default level, and normal usage.
VERBOSE
- Mark messages that may be too noisy for everyday use, but
helpful for debugging as VERBOSE
.
You can mark output as follows:
// Would appear at all levels.
$this->out('Quiet message', 1, Shell::QUIET);
$this->quiet('Quiet message');
// Would not appear when quiet output is toggled.
$this->out('normal message', 1, Shell::NORMAL);
$this->out('loud message', 1, Shell::VERBOSE);
$this->verbose('Verbose output');
// Would only appear when verbose output is enabled.
$this->out('extra message', 1, Shell::VERBOSE);
$this->verbose('Verbose output');
You can control the output level of shells, by using the --quiet
and
--verbose
options. These options are added by default, and allow you to
consistently control output levels inside your CakePHP shells.
The --quiet
and --verbose
options also control how logging data is
output to stdout/stderr. Normally info and higher log messages are output to
stdout/stderr. When --verbose
is used, debug logs will be output to stdout.
When --quiet
is used, only warning and higher log messages will be output to
stderr.
Styling Output
Styling output is done by including tags - just like HTML - in your output.
ConsoleOutput will replace these tags with the correct ansi code sequence, or
remove the tags if you are on a console that doesn’t support ansi codes. There
are several built-in styles, and you can create more. The built-in ones are
success
Success messages. Green text.
error
Error messages. Red text.
warning
Warning messages. Yellow text.
info
Informational messages. Cyan text.
comment
Additional text. Blue text.
question
Text that is a question, added automatically by shell.
You can create additional styles using $this->stdout->styles()
. To declare a
new output style you could do:
$this->_io->styles('flashy', ['text' => 'magenta', 'blink' => true]);
This would then allow you to use a <flashy>
tag in your shell output, and if
ansi colours are enabled, the following would be rendered as blinking magenta
text $this->out('<flashy>Whoooa</flashy> Something went wrong');
. When
defining styles you can use the following colours for the text
and
background
attributes:
- black
- blue
- cyan
- green
- magenta
- red
- white
- yellow
You can also use the following options as boolean switches, setting them to a
truthy value enables them.
- blink
- bold
- reverse
- underline
Adding a style makes it available on all instances of ConsoleOutput as well,
so you don’t have to redeclare styles for both stdout and stderr objects.
Turning Off Colouring
Although colouring is pretty awesome, there may be times when you want to turn it off,
or force it on:
$this->_io->outputAs(ConsoleOutput::RAW);
The above will put the output object into raw output mode. In raw output mode,
no styling is done at all. There are three modes you can use.
ConsoleOutput::COLOR
- Output with color escape codes in place.
ConsoleOutput::PLAIN
- Plain text output, known style tags will be
stripped from the output.
ConsoleOutput::RAW
- Raw output, no styling or formatting will be done.
This is a good mode to use if you are outputting XML or, want to debug why
your styling isn’t working.
By default on *nix systems ConsoleOutput objects default to colour output.
On Windows systems, plain output is the default unless the ANSICON
environment variable is present.
Stopping Shell Execution
When your shell commands have reached a condition where you want execution to
stop, you can use abort()
to raise a StopException
that will halt the
process:
$user = $this->Users->get($this->args[0]);
if (!$user) {
// Halt with an error message and error code.
$this->abort('User cannot be found', 128);
}
New in version 3.2: The abort() method was added in 3.2. In prior versions you can use
error()
to output a message and stop execution.
Status and Error Codes
Command-line tools should return 0 to indicate success, or a non-zero value to
indicate an error condition. Since PHP methods usually return true
or
false
, the Cake Shell dispatch
function helps to bridge these semantics
by converting your null
and true
return values to 0, and all other
values to 1.
The Cake Shell dispatch
function also catches the StopException
and
uses its exception code value as the shell’s exit code. As described above, you
can use the abort()
method to print a message and exit with a specific
code, or raise the StopException
directly as shown in the example:
namespace App\Shell\Task;
use Cake\Console\Shell;
class ErroneousShell extends Shell
{
public function main()
{
return true;
}
public function itFails()
{
return false;
}
public function itFailsSpecifically()
{
throw new StopException("", 2);
}
}
The example above will return the following exit codes when executed on a
command-line:
$ bin/cake erroneousshell ; echo $?
0
$ bin/cake erroneousshell itFails ; echo $?
1
$ bin/cake erroneousshell itFailsSpecifically ; echo $?
2
Tip
Avoid exit codes 64 - 78, as they have specific meanings described by
sysexits.h
.
Avoid exit codes above 127, as these are used to indicate process exit
by signal, such as SIGKILL or SIGSEGV.
Note
You can read more about conventional exit codes in the sysexit manual page
on most Unix systems (man sysexits
), or the System Error Codes
help
page in Windows.
Hook Methods
-
Cake\Console\Shell::
initialize
()
Initializes the Shell, acts as constructor for subclasses and allows
configuration of tasks prior to shell execution.
-
Cake\Console\Shell::
startup
()
Starts up the Shell and displays the welcome message. Allows for checking
and configuring prior to command or main execution.
Tip
Override the startup()
method if you want to remove the welcome
information, or otherwise modify the pre-command flow.
Configuring Options and Generating Help
-
class
Cake\Console\
ConsoleOptionParser
ConsoleOptionParser
provides a command line option and
argument parser.
OptionParsers allow you to accomplish two goals at the same time. First, they
allow you to define the options and arguments for your commands. This allows
you to separate basic input validation and your console commands. Secondly, it
allows you to provide documentation, that is used to generate a well formatted
help file.
The console framework in CakePHP gets your shell’s option parser by calling
$this->getOptionParser()
. Overriding this method allows you to configure the
OptionParser to define the expected inputs of your shell. You can also configure
subcommand option parsers, which allow you to have different option parsers for
subcommands and tasks. The ConsoleOptionParser implements a fluent interface and
includes methods for setting multiple options/arguments at once:
public function getOptionParser()
{
$parser = parent::getOptionParser();
// Configure parser
return $parser;
}
Configuring an Option Parser with the Fluent Interface
All of the methods that configure an option parser can be chained, allowing you
to define an entire option parser in one series of method calls:
public function getOptionParser()
{
$parser = parent::getOptionParser();
$parser->addArgument('type', [
'help' => 'Either a full path or type of class.'
])->addArgument('className', [
'help' => 'A CakePHP core class name (e.g: Component, HtmlHelper).'
])->addOption('method', [
'short' => 'm',
'help' => __('The specific method you want help on.')
])->setDescription(__('Lookup doc block comments for classes in CakePHP.'));
return $parser;
}
The methods that allow chaining are:
- addArgument()
- addArguments()
- addOption()
- addOptions()
- addSubcommand()
- addSubcommands()
- setCommand()
- setDescription()
- setEpilog()
Set the Description
-
Cake\Console\ConsoleOptionParser::
setDescription
($text)
The description displays above the argument and option information. By passing
in either an array or a string, you can set the value of the description:
// Set multiple lines at once
$parser->setDescription(['line one', 'line two']);
// Prior to 3.4
$parser->description(['line one', 'line two']);
// Read the current value
$parser->getDescription();
The src/Shell/ConsoleShell.php is a good example of the description()
method in action:
/**
* Display help for this console.
*
* @return ConsoleOptionParser
*/
public function getOptionParser()
{
$parser = new ConsoleOptionParser('console');
$parser->setDescription(
'This shell provides a REPL that you can use to interact ' .
'with your application in an interactive fashion. You can use ' .
'it to run adhoc queries with your models, or experiment ' .
'and explore the features of CakePHP and your application.' .
"\n\n" .
'You will need to have psysh installed for this Shell to work.'
);
return $parser;
}
The console’s description
output can be seen by executing the following
command:
$ bin/cake console --help
Welcome to CakePHP v3.0.13 Console
---------------------------------------------------------------
App : src
Path: /home/user/cakeblog/src/
---------------------------------------------------------------
This shell provides a REPL that you can use to interact with your
application in an interactive fashion. You can use it to run adhoc
queries with your models, or experiment and explore the features of
CakePHP and your application.
You will need to have psysh installed for this Shell to work.
Usage:
cake console [-h] [-v] [-q]
Options:
--help, -h Display this help.
--verbose, -v Enable verbose output.
--quiet, -q Enable quiet output.
Set a help alias
-
Cake\Console\ConsoleOptionParser::
setHelpAlias
($alias)
If you want to change the command name, you can use the setHelpAlias()
method:
$parser->setHelpAlias('my-shell');
This will change the usage output to my-shell
instead of the default cake
value:
Usage:
my-shell console [-h] [-v] [-q]
New in version 3.5.0: The setHelpAlias
method was added in 3.5.0
Set the Epilog
-
Cake\Console\ConsoleOptionParser::
setEpilog
($text)
Gets or sets the epilog for the option parser. The epilog is displayed after the
argument and option information. By passing in either an array or a string, you
can set the value of the epilog. Calling with no arguments will return the
current value:
// Set multiple lines at once
$parser->setEpilog(['line one', 'line two']);
// Prior to 3.4
$parser->epilog(['line one', 'line two']);
// Read the current value
$parser->getEpilog();
To illustrate the epilog()
method in action lets add a call to the
getOptionParser()
method used above in the src/Shell/ConsoleShell.php:
/**
* Display help for this console.
*
* @return ConsoleOptionParser
*/
public function getOptionParser()
{
$parser = new ConsoleOptionParser('console');
$parser->setDescription(
'This shell provides a REPL that you can use to interact ' .
'with your application in an interactive fashion. You can use ' .
'it to run adhoc queries with your models, or experiment ' .
'and explore the features of CakePHP and your application.' .
"\n\n" .
'You will need to have psysh installed for this Shell to work.'
);
$parser->setEpilog('Thank you for baking with CakePHP!');
return $parser;
}
The text added with the setEpilog()
method can be seen in the output from
the following console command:
$ bin/cake console --help
Welcome to CakePHP v3.0.13 Console
---------------------------------------------------------------
App : src
Path: /home/user/cakeblog/src/
---------------------------------------------------------------
This shell provides a REPL that you can use to interact with your
application in an interactive fashion. You can use it to run adhoc
queries with your models, or experiment and explore the features of
CakePHP and your application.
You will need to have psysh installed for this Shell to work.
Usage:
cake console [-h] [-v] [-q]
Options:
--help, -h Display this help.
--verbose, -v Enable verbose output.
--quiet, -q Enable quiet output.
Thank you for baking with CakePHP!
Adding Arguments
-
Cake\Console\ConsoleOptionParser::
addArgument
($name, $params = [])
Positional arguments are frequently used in command line tools,
and ConsoleOptionParser
allows you to define positional
arguments as well as make them required. You can add arguments
one at a time with $parser->addArgument();
or multiple at once
with $parser->addArguments();
:
$parser->addArgument('model', ['help' => 'The model to bake']);
You can use the following options when creating an argument:
help
The help text to display for this argument.
required
Whether this parameter is required.
index
The index for the arg, if left undefined the argument will be put
onto the end of the arguments. If you define the same index twice the
first option will be overwritten.
choices
An array of valid choices for this argument. If left empty all
values are valid. An exception will be raised when parse() encounters an
invalid value.
Arguments that have been marked as required will throw an exception when
parsing the command if they have been omitted.
-
Cake\Console\ConsoleOptionParser::
addArguments
(array $args)
If you have an array with multiple arguments you can use
$parser->addArguments()
to add multiple arguments at once.
$parser->addArguments([
'node' => ['help' => 'The node to create', 'required' => true],
'parent' => ['help' => 'The parent node', 'required' => true]
]);
As with all the builder methods on ConsoleOptionParser, addArguments
can be used as part of a fluent method chain.
Validating Arguments
When creating positional arguments, you can use the required
flag, to
indicate that an argument must be present when a shell is called.
Additionally you can use choices
to force an argument to be from a list of
valid choices:
$parser->addArgument('type', [
'help' => 'The type of node to interact with.',
'required' => true,
'choices' => ['aro', 'aco']
]);
The above will create an argument that is required and has validation on the
input. If the argument is either missing, or has an incorrect value an exception
will be raised and the shell will be stopped.
Adding Options
-
Cake\Console\ConsoleOptionParser::
addOption
($name, $options = [])
Options or flags are also frequently used in command line tools.
ConsoleOptionParser
supports creating options with both verbose and short
aliases, supplying defaults and creating boolean switches. Options are created
with either $parser->addOption()
or $parser->addOptions()
.
$parser->addOption('connection', [
'short' => 'c',
'help' => 'connection',
'default' => 'default',
]);
The above would allow you to use either cake myshell --connection=other
,
cake myshell --connection other
, or cake myshell -c other
when invoking the shell. You can also create boolean switches, these switches do
not consume values, and their presence just enables them in the parsed
parameters.
$parser->addOption('no-commit', ['boolean' => true]);
With this option, when calling a shell like
cake myshell --no-commit something
the no-commit param would have a value of
true
, and ‘something’ would be a treated as a positional argument.
The built-in --help
, --verbose
, and --quiet
options use this
feature.
When creating options you can use the following options to define the behavior
of the option:
short
- The single letter variant for this option, leave undefined for
- none.
help
- Help text for this option. Used when generating help for the
- option.
default
- The default value for this option. If not defined the default
- will be
true
.
boolean
- The option uses no value, it’s just a boolean switch.
Defaults to false
.
choices
- An array of valid choices for this option. If left empty all
values are valid. An exception will be raised when parse() encounters an
invalid value.
-
Cake\Console\ConsoleOptionParser::
addOptions
(array $options)
If you have an array with multiple options you can use $parser->addOptions()
to add multiple options at once.
$parser->addOptions([
'node' => ['short' => 'n', 'help' => 'The node to create'],
'parent' => ['short' => 'p', 'help' => 'The parent node']
]);
As with all the builder methods on ConsoleOptionParser, addOptions can be used
as part of a fluent method chain.
Option values are stored in the $this->params
array. You can also use the
convenience method $this->param()
to avoid errors when trying to access
non-present options.
Validating Options
Options can be provided with a set of choices much like positional arguments
can be. When an option has defined choices, those are the only valid choices
for an option. All other values will raise an InvalidArgumentException
:
$parser->addOption('accept', [
'help' => 'What version to accept.',
'choices' => ['working', 'theirs', 'mine']
]);
Using Boolean Options
Options can be defined as boolean options, which are useful when you need to
create some flag options. Like options with defaults, boolean options always
include themselves into the parsed parameters. When the flags are present they
are set to true
, when they are absent they are set to false
:
$parser->addOption('verbose', [
'help' => 'Enable verbose output.',
'boolean' => true
]);
The following option would result in $this->params['verbose']
always being
available. This lets you omit empty()
or isset()
checks for boolean
flags:
if ($this->params['verbose']) {
// Do something.
}
Since the boolean options are always defined as true
or false
you can
omit additional check methods when using the array access. The
$this->param()
method makes these checks unnecessary for all cases.
Adding Subcommands
-
Cake\Console\ConsoleOptionParser::
addSubcommand
($name, $options = [])
Console applications are often made of subcommands, and these subcommands may
require special option parsing and have their own help. A perfect example of
this is bake
. Bake is made of many separate tasks that all have their own
help and options. ConsoleOptionParser
allows you to define subcommands and
provide command specific option parsers so the shell knows how to parse commands
for its tasks:
$parser->addSubcommand('model', [
'help' => 'Bake a model',
'parser' => $this->Model->getOptionParser()
]);
The above is an example of how you could provide help and a specialized option
parser for a shell’s task. By calling the Task’s getOptionParser()
we don’t
have to duplicate the option parser generation, or mix concerns in our shell.
Adding subcommands in this way has two advantages. First, it lets your shell
document its subcommands in the generated help. It also gives easy access to the
subcommand help. With the above subcommand created you could call
cake myshell --help
and see the list of subcommands, and also run
cake myshell model --help
to view the help for just the model task.
Note
Once your Shell defines subcommands, all subcommands must be explicitly
defined.
When defining a subcommand you can use the following options:
help
- Help text for the subcommand.
parser
- A ConsoleOptionParser for the subcommand. This allows you to
create method specific option parsers. When help is generated for a
subcommand, if a parser is present it will be used. You can also supply the
parser as an array that is compatible with
Cake\Console\ConsoleOptionParser::buildFromArray()
Adding subcommands can be done as part of a fluent method chain.
Changed in version 3.5.0: When adding multi-word subcommands you can now invoke those commands using
snake_case
in addition to the camelBacked form.
Building a ConsoleOptionParser from an Array
-
Cake\Console\ConsoleOptionParser::
buildFromArray
($spec)
As previously mentioned, when creating subcommand option parsers, you can define
the parser spec as an array for that method. This can help make building
subcommand parsers easier, as everything is an array:
$parser->addSubcommand('check', [
'help' => __('Check the permissions between an ACO and ARO.'),
'parser' => [
'description' => [
__("Use this command to grant ACL permissions. Once executed, the "),
__("ARO specified (and its children, if any) will have ALLOW access "),
__("to the specified ACO action (and the ACO's children, if any).")
],
'arguments' => [
'aro' => ['help' => __('ARO to check.'), 'required' => true],
'aco' => ['help' => __('ACO to check.'), 'required' => true],
'action' => ['help' => __('Action to check')]
]
]
]);
Inside the parser spec, you can define keys for arguments
, options
,
description
and epilog
. You cannot define subcommands
inside an
array style builder. The values for arguments, and options, should follow the
format that Cake\Console\ConsoleOptionParser::addArguments()
and
Cake\Console\ConsoleOptionParser::addOptions()
use. You can also
use buildFromArray on its own, to build an option parser:
public function getOptionParser()
{
return ConsoleOptionParser::buildFromArray([
'description' => [
__("Use this command to grant ACL permissions. Once executed, the "),
__("ARO specified (and its children, if any) will have ALLOW access "),
__("to the specified ACO action (and the ACO's children, if any).")
],
'arguments' => [
'aro' => ['help' => __('ARO to check.'), 'required' => true],
'aco' => ['help' => __('ACO to check.'), 'required' => true],
'action' => ['help' => __('Action to check')]
]
]);
}
Merging ConsoleOptionParsers
-
Cake\Console\ConsoleOptionParser::
merge
($spec)
When building a group command, you maybe want to combine several parsers for
this:
$parser->merge($anotherParser);
Note that the order of arguments for each parser must be the same, and that
options must also be compatible for it work. So do not use keys for different
things.
Getting Help from Shells
With the addition of ConsoleOptionParser getting help from shells is done in a
consistent and uniform way. By using the --help
or -h
option you
can view the help for any core shell, and any shell that implements a
ConsoleOptionParser:
cake bake --help
cake bake -h
Would both generate the help for bake. If the shell supports subcommands you can
get help for those in a similar fashion:
cake bake model --help
cake bake model -h
This would get you the help specific to bake’s model task.
Getting Help as XML
When building automated tools or development tools that need to interact with
CakePHP shells, it’s nice to have help available in a machine parse-able format.
The ConsoleOptionParser can provide help in xml by setting an additional
argument:
cake bake --help xml
cake bake -h xml
The above would return an XML document with the generated help, options,
arguments and subcommands for the selected shell. A sample XML document would
look like:
<?xml version="1.0"?>
<shell>
<command>bake fixture</command>
<description>Generate fixtures for use with the test suite. You can use
`bake fixture all` to bake all fixtures.</description>
<epilog>
Omitting all arguments and options will enter into an interactive
mode.
</epilog>
<subcommands/>
<options>
<option name="--help" short="-h" boolean="1">
<default/>
<choices/>
</option>
<option name="--verbose" short="-v" boolean="1">
<default/>
<choices/>
</option>
<option name="--quiet" short="-q" boolean="1">
<default/>
<choices/>
</option>
<option name="--count" short="-n" boolean="">
<default>10</default>
<choices/>
</option>
<option name="--connection" short="-c" boolean="">
<default>default</default>
<choices/>
</option>
<option name="--plugin" short="-p" boolean="">
<default/>
<choices/>
</option>
<option name="--records" short="-r" boolean="1">
<default/>
<choices/>
</option>
</options>
<arguments>
<argument name="name" help="Name of the fixture to bake.
Can use Plugin.name to bake plugin fixtures." required="">
<choices/>
</argument>
</arguments>
</shell>
Renaming Commands
By default CakePHP will automatically discover all the commands in your
application and its plugins. You may want to reduce the number of exposed
commands, when building standalone console applications. You can use your
Application’s console()
hook to limit which commands are exposed and rename
the commands that are exposed:
namespace App;
use App\Shell\UserShell;
use App\Shell\VersionShell;
use Cake\Http\BaseApplication;
class Application extends BaseApplication
{
public function console($commands)
{
// Add by classname
$commands->add('user', UserShell::class);
// Add instance
$commands->add('version', new VersionShell());
return $commands;
}
}
In the above example, the only commands available would be help
, version
and user
.
New in version 3.5.0: The console
hook was added.
Routing in Shells / CLI
In command-line interface (CLI), specifically your shells and tasks,
env('HTTP_HOST')
and other webbrowser specific environment variables are not
set.
If you generate reports or send emails that make use of Router::url()
those
will contain the default host http://localhost/
and thus resulting in
invalid URLs. In this case you need to specify the domain manually.
You can do that using the Configure value App.fullBaseUrl
from your
bootstrap or config, for example.
For sending emails, you should provide Email class with the host you want to
send the email with:
use Cake\Mailer\Email;
$email = new Email();
// Prior to 3.4 use domain()
$email->setDomain('www.example.org');
This asserts that the generated message IDs are valid and fit to the domain the
emails are sent from.


HELLO!
Hi! Thanks for visiting my website. Here’s a picture of me with a rat in Central Park. If you’ve read my fantasy series, The Underland Chronicles, you will have a clue as to why I chose this photo. If not, you may want to click around and find out a little more about my books. Or visit the Scholastic website for cool games and info!


Visualization¶
-
imagemks.visualization.
make_boundary_image
(L, A, thickness=1, color=(255, 255, 85))¶ Marks borders of segmentation on the original image so that borders can be evaluated. Similar to skimage.segmentation.mark_boundaries. This function allows specifying a border thickness. This makes borders visible in high resolution images.
- Parameters
L ((M,N) array of dtype long) – The labeled image that is a segmentation of A.
A ((M,N) or (M,N,3) array of any numerical dtype) – The original image. Grayscale and color are supported. thickness : Thickness of the borders in pixels. Default is 1. color : Tuple of 3 uint8 RGB values.
- Returns
marked_image – The original image with marked borders, 3 color channels.
- Return type
ndarray


The link-state routing algorithm is also known as Dijkstra's algorithm. It computes the least-cost path from one node, the source, to all other nodes in the network. It does this by having each node broadcast link-state packets to all other nodes in the network, where each link-state packet contians the identities and costs of its attached links. The algorithm is iterative and has the property that after the kth iteration of the algorithm, the least-cost paths are known to k destination nodes. Of all the least-cost paths to all destination nodes, \ these k paths will have the k smallest costs.
We are going to compute the least-cost paths from u to all possible destinations using the network pictured below.
Starting with u, we see that the nodes connected to u are:
We have now completed our first step, the initialization. Now let us move to the first iteration. We must look for the nodes that have not been added to the N' column of step 0. If you look at the table, you will see only a u. Our choices are any other node in the network; but because x has the least-cost path, it will the node added to set N'.
Now starting with ux, we see that the nodes connected to x are:
We have completed the first iteration. Now let us move to the second iteration. We must look for the nodes that have not been added to the N' column of step 1. If you look at the table, you will see a ux. Our choices are therefore v, w, y, and z; but because v and y have the same least-cost path value, we will arbitrarily choose y and it will be added to set N'.
Now starting with uxy, we see that the nodes connected to y are:
We have completed the second iteration. Now let us move to the third iteration. We must look for the nodes that have not been added to the N' column of step 2. If you look at the table, you will see a uxy. Our choices are therefore v, w, and z; but because we chose y first and v has the least-cost value, we will now choose v and it will be added to set N'.
Now starting with uxyv, we see that the node connected to v is:
We have completed the third iteration. Now let us move to the fourth iteration. We must look for the nodes that have not been added to the N' column of step 3. If you look at the table, you will see a uxyv. Our choices are therefore w and z; but because w has the least-cost path value, we will choose w and it will be added to set N'.
Now starting with uxyvw, we see that the node connected to w is:
We have now found the least-cost path from the source node u to the destination node z with a least-cost value of 4. We do not need to perform any additional iterations.


@*
* Copyright 2021 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.
*@
@import utils.ERSUtil
@import config.ApplicationConfig
@import utils.CountryCodes
@import uk.gov.hmrc.play.views.html.helpers.{FormWithCSRF, Input, ErrorSummary}
@this(form: FormWithCSRF, input: Input, errorSummary: ErrorSummary)
@(requestObject: RequestObject, groupSchemeActivity: String, index: Int, trusteeDetails: Form[models.TrusteeDetails])(implicit request: Request[AnyRef], flash: Flash, messages: Messages, countryCodes: CountryCodes, ersUtil: ERSUtil, appConfig: ApplicationConfig)
@import views.html.helpers.error_overview
@import views.html.templates._
@schemeId = @{requestObject.getSchemeId}
@scripts = {
}
@ers_main(title = messages("ers.add_trustee.page_title"), scripts) {
@reference(requestObject.getPageTitle)


AWAKENINGS A film review by Laurie Mann Copyright 1991 Laurie Mann
It should be an interesting Academy Award ceremonies this year, when the lead performers in the movies of Rob Reiner and Penny Marshall (ex-spouses who, apparently, do not get along well) will probably win the top awards--Kathy Bates for Misery and Robert DeNiro for AWAKENINGS.
AWAKENINGS is an extraordinary movie. It has some parallels to RAIN MAN and CHARLY, but it's much stronger. Penny Marshall excels at setting a mood, she makes you understand what it's like to be a child in the late 1920s in the first ten minutes of the film. The action jumps ahead forty years, to a dismal, depressing psychiatric hospital in New York, where Dr. Sayer (Robin Williams) reluctantly takes a job as as researcher. He's used to working with earthworms but, sadly, the long-time catatonics he comes into contact with aren't much better off.
Dr. Sayer believes he sees flickers of life behind the catatonic masks of his patients. While some can bearly move, they have some reflexes, and a few seem to respond a little to their surroundings. One patient, Lucy, catches her glasses, and walks along the pattern on the floor, only stopping when the pattern ends. Another patient, Leonard, exhibits brain activity when his name is spoken during an EEG. Sayer tries to stimulate these patients, to prove that they comprehend what's happening to them, and has mixed results.
Dr. Sayer finds out that a drug, L-dopa, has made improvements in the lives of Parkinson's patients, and he gets permission to try it on a patient. He chooses Leonard (Robert DeNiro), and Leonard, gradually, comes out of a thirty year sleep.
The relationship between Leonard and Sayer is remarkable. Sayer is a very caring man, but he's painfully shy and inhibited. Leonard has been forced inward by neurological damage, but he's determined to do whatever he can, to experience everything he's missed. Sayer helps Leonard cope with the missing years, and Leonard helps Sayer learn as much as he can about the drug.
The most unbelievable part of the movie was the mass drug-testing of the entire catatonic ward. Maybe that's the way it "really" happened, but the ward staff was incredibly stretched caring "just" for catatonics. They were hopelessly overworked once fifteen neurologically-damaged yet awake people populated their ward. These scenes have the feel of Cocoon, and were out-of-place with the rest of the movie.
There are many wonderful performances in this movie. The actress who played Leonard's devoted mother gave co-dependency a whole new meaning. She's not evil, and she's happy that Leonard is better, but she has trouble coping with a fifty-year-old adolescent. Julie Kavner did a nice turn as Sayer's supportive nurse, Elinor. And Alice Drummond as the gentle, confused Lucy, was also quite good.
The performances of Williams and DeNiro are extraordinary, Williams for the subtleness, and DeNiro for the range. When performers are mismatched (Cruise and Hoffman in RAIN MAN and Redford and Streep in OUT OF AFRICA spring instantly to mind), the movie suffers. But these performers work perfectly together.
Penny Marshall is one of the most important directors of the day. Even with a weak script (JUMPING JACK FLASH), she consistently gets good performances from her performers, and all her movies have lovely details. The homes of the characters in Marshall movies look like places where people live. And her vision of New York isn't quite as grand as Woody Allen's---again, it's a "lived in" place.
This movie is at least an 8, and maybe a 9. It's a superb film, and I hope you all go see it.
Laurie Mann **<EMAIL_ADDRESS>**<EMAIL_ADDRESS>NeXT mail<EMAIL_ADDRESS>.
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


Whilst reading through the proceedings from this year’s CHI conference, this paper [1] caught my eye especially - due to my interests in both musically-oriented computing and jazz.
In terms of a concept, the reflexive looper (or RLR as it’s referred to in the paper) would definitely benefit me as a musician, as it directly tackles two of the main issues I encounter when practising alone - the absence of adaptive interaction between musician and a loop pedal, and the “stylistic mismatch” between musician and “minus-one” recordings which omit the part you are playing.
The way it works is interesting, employing a wide host of machine learning techniques to isolate features from live performance - extracting attributes such as the pitch extremities and the variance of pitch over a set time window. Using this information, the RLR is able to dynamically and interactively simulate the other two members of a jazz trio using one musician’s input (regardless of whether they’re playing bass, melody or chords) - which is highly impressive.
Unfortunately, while the RLR liberates the musician from “canned music”, it imposes the restriction of having to provide training data in the form of a chord chart beforehand, and requires MIDI information as well as a live audio stream. This significantly slows the process of self-accompaniment.
The implementation as demonstrated in the affiliated video capably shows how the RLR works, but not to a standard that I would be comfortable using myself as a musician. That said, this is a concept, which if embraced commercially, could evolve into a highly successful product. Indeed, commercial “band in a box” packages do exist, such as the Session Mode in the upcoming game Rocksmith 2014 [2], but an RLR provides a more portable interactive accompaniment solution without the specific need for a computer or games console.
References:
_[1] Reflexive loopers for solo musical improvisation, F. Pachet et al. (CHI 2013), _http://dl.acm.org/citation.cfm?id=2481303
[2] Session mode in Rocksmith 2014, Ubisoft (2013), http://rocksmith.ubi.com/rocksmith/en-GB/features/index.aspx


WITNESS LIST S/C on Emerging Technologies & Economic Dev. Committee March 21, 2005 - 3:00P SB 150 FOR: Taylor, Craig (San Antonio Grand Prix), San Antonio, TX Registering, but not testifying: On: Guthrie, Melissa (Comptroller of Public Accounts), Austin, TX


Problem 1. Make person
Write a function for creating persons.
Each person must have firstname, lastname, age and gender (true is female, false is male)
Generate an array with ten person with different names, ages and genders
You could use Chrome console (F12) or Firebug to see the results.


Sprint 4
Topic: Neuroplasticity Blog Others
Problem Solving
Have you ever experienced solving a complicated math problem and you couldn't figure it out? The only way you can solve the problem is by deciphering the sentence and solving it again with a different solutions.
Do you you have the same experience every time you write a function with JavaScript?
Does it feel like déjà vu all over again? In a manner of speaking, it does, and you're desperate to find the right answer.
Yesterday, I had phone conversation with my father on how difficult it was to solve the problem in JavaScript. I was feeling the stress and even ranting out my frustrations with coding. My father's only response to me was, "Think of JavaScript as a Math problem." Then it hit me, how right he was.
I've organised my thoughts and re-evaluated the problem in front of me. I've read the instructions over and over again and used different problem solving techniques like googling on the web; doing console.logs; and asking questions to my facilitator on how to solve the problem. In the end, I was able to solve it and learn to test and run my functions using JavaScript.
Problem-Solving Techniques
- There are different
problem-solving techniques which I found useful to utilise.
Here are some of the techniques:
- Pseudocode: Its a great method to uncover unclear decisions, hidden side effects and for defining all inputs, outputs,and interactions needed to effectively solve my problem.
- Trying something: Its best practice to try the functions and experiment on it so you will understand the context given to you. It will also help improve your skills and become a critical thinker.
- Rubber ducky method: Its a process the helps me understand line-by-line the code and also create conversation with an inanimate object before consoling with an actual person.
- Reading error messages: Every time an error appears in your screen. You can check the line of your code and omit on the changes until you get it right.
- Console.logging: It has been my best friend in doing rapid testing.
- Googling: "Hey Google!" Isn't it amazing how google searches anything on the net. Even asking for JavaScript references related to your problem can help guide you in solving the problem.
- Asking your peers for help: "Two heads are better than one." It's nice interact with your fellow peers especially trying to solve the same problem at your own pace of understanding.
- Asking coaches for help: Your mentor is your best friend to guide you in every step of the way to solve the problem. It's best practice to learn from people who have experience with the matter and guide you through it.
- Improving your process with reflection: It's a process that helps you reflect and grow your abilities to learn something new and also pour out your frustrations from time to time. It helps you balance mentally and physically as you progress on it.
I want to show you an example of how I filter only even numbers with JavaScript
1,2,3,4,5,6,7,8,9,10


SENECA ADMINISTRATIVE OFFICES AND HEADQUARTERS
CLICK FOR DIRECTIONS6925 Chabot Road
Oakland, CA 94618
Phone:<PHONE_NUMBER>
Fax:<PHONE_NUMBER>
SENECA CENTRAL COAST HEADQUARTERS
CLICK FOR DIRECTIONS124 River Road
Salinas, CA 93908
(831) 455-9965
1-800-4-KINSHIP
www.kinshipcenter.orgSENECA SO. CAL HEADQUARTERS
CLICK FOR DIRECTIONS1801 Park Court #H
Santa Ana, CA 92701
(714) 957-1004
SENECA FOSTER CARE
Toll Free:<PHONE_NUMBER>
Email<EMAIL_ADDRESS>SENECA HUMAN RESOURCES DEPARTMENT
CLICK FOR DIRECTIONS15942 Foothill Blvd.
San Leandro, CA 94578
Phone:<PHONE_NUMBER>
Toll Free:<PHONE_NUMBER>
Fax:<PHONE_NUMBER>
Email<EMAIL_ADDRESS>INSTITUTE FOR ADVANCED PRACTICE
CLICK FOR DIRECTIONS6925 Chabot Road
Oakland, CA 94618
Phone:<PHONE_NUMBER>
Email<EMAIL_ADDRESS>For more information on Seneca, please email us at info@senecacenter.org


| Booking Passenger Event Id | System.Guid |
| Booking Passenger Event Type | System.String |
| Booking Passenger Event Number | System.Int32 |
| Booking Passenger Id | System.Guid |
| Booking Flight Segment Id | System.Guid |
| Booking Passenger Ticket Id | System.Guid |
| Booking Passenger Seat Id | System.Guid |
| Booking Passenger Baggage Id | System.Guid |
| Remarks | System.String |
| User Id | System.Guid |
| Date Time | System.DateTime |


4; 12022 H.E.
Hello! Hope you’re doing well today. This is my first anime review; I don’t know the best format to follow. I think I’m the only person who will read this, so I’ll write it myself. If you’re not me, Godspeed. Shall we?
The first thing to get out of the way is the title of this show. The full title is Banished from the Hero’s Party, I Decided to Live a Quiet Life in the Countryside, which is rather long. To avoid writing it all out, I’ll refer to the show simply by Banished.
Let me tell you something from the beginning, I absolutely loved this show. I knew nothing of the show; I found it randomly on MyAnimeList. I didn’t even know what isekai meant and what the whole genre entails. I walked into the show with a very open mindset about a day or two before New Year’s Eve.
I have a weak spot for a slice-of-life style of shows. Something slower in plot progression, fewer notable battles or heroic encounters, but more of an introspective into our daily routine that life is made out of. It is incredibly calming and simply... welcoming! I would even dare to say wholesome.
Reading some reviews that people left, they criticize people for liking this genre for being too “naïve” and “simple-minded” to enjoy this isekai genre. In many ways, I can see their argument. It’s no Death Note, Neon Genesis Evangelion, or other on-the-surface-deep-thought-provoking plots with endless schemes and betrayals. Does it need to be that?
This is worth its own “opinion” post. Still, modern audiences are spoiled with the thought of feeling intelligent and profound by watching dark/tragic shows. Thinking the depth of meaning is equivalent to its respective “darkness.” The first example that comes to mind is Joker.
This fallacy leads people onto the path of pseudo-intelligence and trivialization of essential questions and topics down to bad-taste jokes and taking things too far.
Coming from that drifted-over discussion back to Banished. There is no secret to enjoying what it has to offer.  It can even be cheesy in some spots, and that’s what we’re here for. To enjoy the little magic that Banished holds close to its heart. The atmosphere is not the only thing it has to offer; a big question is being pondered. Let’s talk! I felt good after watching the show, which is a good sign.
Banished looks at the old question of “What is life?” and “What does it mean to be successful in life?” As Gideon was in the Hero’s Party with Ruti, battling hordes of demons, onto bringing the fight to the Demon Lord. Sounds pretty exciting, doesn’t it? It sounds very heroic and noble. What if he were instead to open an apothecary in a small village and just live a simple life?
Many would find the second route less exciting, less protagonistic, and less heroic. Would such a thought be proper? In their own right, they are. However, what is life but a series of events that can be viewed and understood from infinite angles and worldviews? What is a failure for one is a fulfilled and happy life for another. Then you might ask me, “Sandy, where is the truth then?”
I will say that is a good question. How do we live the perfect life? What is a perfect life? Again, is life about your career? Maybe stature? Your role in society? Love? Fulfilling your path/destiny? MONEY? It is indeed a great question. All I can give now in this short anime review is that it is life. What you do, how you live, just live. Instead of overthinking every step we take, let us live and put the dot right there.
This is quite a departure from any good review. We’ll keep it ongoing. Let’s talk about the characters and the show more specifically then! Mostly about Gideon, Rit, and Ruti.
Gideon had a fantastic caliber of humbleness and empathy towards those around him, which makes a notable difference for the best in your immediate surroundings. He had the skill that very few people in the world are fortunate to possess, and that’s to know who you are and be friends with yourself. Be content with life’s givings and takings by simply moving further. What’s done is done; let’s consider what we do next!
I like to entertain the possibility, a realm where we try to approach life more philosophically. We tend to expect a lot from everything we do, ranging from financial gains to love to anything else. It’s only human nature to expect an equal return for our troubles and efforts. Instead of wishing, we just do what we do now and have what comes at us. I feel it takes incredible discipline to be this much at peace with yourself.
Rit was in a similar situation to Gideon (Red), as they miraculously met again after departing from their previous adventures together. She also has expectations from her royal family, subordinates, and people. Are we then just prisoners of our destinies? By God giving everyone a path in life and a future with no way out, why are we given free will for?
Maybe we are given some path, some pre-determined set of events, emotions, feelings, people, places, etc., that we are meant to experience and live through in the time, we have in this world. Free will is given to make it more fun. One will still follow the general “flow” of their destiny, but how they can approach it entirely depends on them.
This is something I liked about the way they approach Ruti’s character. The literal Hero of the land. “Destined and Blessed by The Almighty to serve as a protector and fighter, devoid of anything that can impede such a crucial mission.” Should one follow and fulfill their path or try to pursue their own life if they feel it goes against what they’re required to do?
It is only my feeling that we have to live our own lives the way we would want to live them, of course, within the degree of freedom of our current situation. Life might be too short to care for, and you spend too much time on something that goes against your will. Banished teaches you to live your life and no one else’s.
Also, the opening song never fails to brighten up the mood for me.
That’s all! Thank you for reading. ◼


"There's method in my madness, there's no logic in your sadness, you don't gain a single thing from
miserly, take it from me"
- King~Lauren Aquilina
We as a group believe that the positivity exist in every thing and every where, and surprisingly we all
agreed that those words should be suffice to give you a highlight you can follow in your life:
"Glass half empty glass half full, well either way you won't be going thirsty, count your blessings not
your flows"
- King~Lauren Aquilina
Noor Ahmad
The queen of difficult situations, and Multifunction, but the main
thing
of me is that I'm an artist.
find me on LinkedIn
Ghofran Dayyat
Fresh graduate full of energy to learn everything new and keep up
with the needs of the labor market, passionate about new experiences and teamwork
find me on LinkedIn
Roya Alakayle
Lab technician interested in programming, hope to be able to
combine
the programming and the medical field technology to come up with revolution that would make a
difference.
find me on LinkedIn
Abedalaziz Alsalahat
Experienced Junior Software Engineer with a demonstrated
history of working in the computer software industry.
find me on LinkedIn
Qais Ata
Good experience in working with Non-profit organizations, very
interested in technologies, programming and Computer services.
find me on LinkedIn
Monther Alkhwaldeh
Open and honest person who doesn’t believe in misleading
other people and tries to be fair in everything I do.
find me on LinkedIn


Instructional Design Guide for New Virtual Designers
Stepping into the world of virtual instructional design can be a pretty steep learning curve. There are clients to meet, theories to learn, materials to create and objectives to deliver. When this is a whole new world for you, it can be difficult to know where to start!
At The Virtual Training Team, we work with instructional designers at all different stages in their careers- from those taking their first steps into Learning & Development to those who have been living and breathing virtual training for years.
We asked around and have put together an instructional design guide for new virtual designers. If you’re looking for some handy tips on how to be an instructional designer, or how to impress your clients (and your boss!) no matter your previous experience, we’ve got you covered!
1. Get to know your client
When you’re getting started on a new project, it can be tempting to dive right into design. After all, you’re an instructional designer, right? Yes, but making time to get to know your client and identify their needs and objectives can make your job a whole lot easier.
If it’s possible for you to sit in on client meetings, do! If not, speak to the people who are responsible for this. It’s important to get a sense of what your client wants to achieve and the style of delivery they prefer before you can get started on your training course design.
2. Know your learning outcomes
Once you’ve got a grip on who your client is and what they’re looking to achieve, it’s time to get down to specific learning outcomes. Ask yourself “What do the learners need to get out of this?”.
Every single piece of information you include in your materials should relate to these learning outcomes. Keep them in mind as you research, design and finalise every step of the project.
Remember, as an instructional designer, a workshop is not about you or the information you want to deliver. It’s all about the learner and the outcomes they need to achieve.
Find out more about VTT’s 6 Principles for Virtual Design.
3. Plan ahead- everything takes longer
If you’re taking the step from designing face-to-face training to virtual training, you may think you already have a handle on project timelines. Think again.
Designing for virtual delivery typically takes longer than designing for in-person training. You need to consider how activities will work in a virtual environment, how you will keep learners’ attention and build in contingencies for the multitude of issues that can arise in virtual learning.
When planning a new project, make sure you build in more time than you think you’ll need. You’ll thank yourself for it later!
4. Get to know the basics
When stepping into the world of instructional design, there’s a lot of learning on the job. As you move through projects, you’ll discover planning and delivery methods that will naturally become a part of your design process.
However, familiarising yourself with the fundamentals of instructional design will really help you to hit the ground running! There are plenty of instructional design courses and training materials available online to introduce you to key design approaches.
One of our personal favourites? An adaptation of the ADDIE model called LLAMA- read more about it here.
5. Bring your design flair
You’ve met with your client, determined objectives, planned out your schedule, done your research and considered your approach. Now, it’s time to get creative!
Keep it simple
Instructional design is all about learning transfer- not decoration. Keep your slides simple, use white space to avoid overcrowding and make sure learners’ focus is kept firmly on the content.
Consistency is key
Too many variations in font, colour, image style and even layout can increase cognitive load and distract learners from the content. Pick a theme and ensure you remain consistent throughout.
Animation
Though the days of PowerPoint slides that whizzed, banged and bounced their way onto our screens are (largely and thankfully!) behind us, that doesn’t mean you can’t use animation to enhance learning transfer. Consider revealing information point by point to reduce cognitive load or using a slide transition that makes the relation between two objects clear. Animation can be a powerful tool in keeping learners engaged and focused on the content in front of them.
Make it relevant
In your quest for creativity, make sure you keep it relevant! Consider the colours you’re using, take time to find appropriate images and infographics that enhance your content and don’t be afraid to simplify rather than decorate. It’s important to consider the aesthetic appeal of your slides, but the focus should always be on appropriate, relevant materials that help learners to achieve their outcomes.
For more tips, check out our blog post on 5 Best Practices for Virtual Workshop Design.
6. Draw on your existing skills
Moving into a new career can be daunting, but tapping into your existing skills can ease the transition. Even if you’re totally new to instructional design, you may find you already know more than you think.
If you’ve ever helped your siblings out with their homework or explained a complex topic to a colleague, you probably have some understanding of what it takes to deliver learning transfer. Those skills in understanding your audience, structuring an explanation and careful consideration of language are all relevant!
Think about your experiences, professional or personal, that led you to virtual learning design. You’ll probably find more than a few transferable skills!
So there you have it- an instructional design guide to get you started on your way to virtual greatness!
If you’re interested in learning more about virtual learning design, check out our Train the Trainer programme which includes a 3 hour Design Masterclass!


Data Access Objects (DAO) are instances that are responsible for interaction with persistent storage in large applications. They define more or less complicated creation, retrieval, update and deletion schemes, rooted in the business logic of a particular application. The technology through which the persistent storage is accessed is isolated from the application business logic.
Since we cannot define the business logic in this general package, and since the access technology differs too, we cannot define much at this high level. {@link org.ppwcode.vernacular.persistence.dao.Dao} is an empty interface that is used mainly as a documentation aid, to flag a type as a DAO. In projects, interfaces should be defined that extend {@link org.ppwcode.vernacular.persistence.dao.Dao, with methods that have a technology independent contract that describes interaction with persistent storage. The actual implementation of these DAO methods will differ and depend on the persistence technology used. In this library, classes are offered that offer common support for the implementation of DAO classes in a given persistence technology (e.g., JDBC, Hibernate, JDO, EJB, RMI, JPA, ...), which actual implementations can extend.
DAO implementations are almost always stateful, because of the underlying persistence technology. Instances should always be dealt with as if they are stateful.
DAO implementations should be JavaBeans, with a default constructor. Further dependencies should be filled out using setters to allow IoC. The technology dependent super classes provide this architecture. DAO methods should be allowed to throw a {@link org.ppwcode.vernacular.persistence_III.PersistenceConfigurationError} if the dependencies are not fulfilled when the DAO method is called.
{@link org.ppwcode.vernacular.persistence.dao.Dao} subtypes may dependent on the fact that the objects in persistent storage are {@link org.ppwcode.vernacular.persistence.PersistentBean PersistentBeans}, although this will not always be necessary.
{@link org.ppwcode.vernacular.persistence.dao.AsyncCrudDao} gathers standard CRUD functionality for {@link org.ppwcode.vernacular.persistence.PersistentBean} generically.


1,847 projects for "sqlalchemy"
Database Abstraction Library
Simple wrapper for sqlalchemy.
Graphene SQLAlchemy integration
Convert to/from timezone aware datetimes when storing in a DBMS
Extension to paginate.Page that supports SQLAlchemy queries
sqlalchemy-audit provides an easy way to set up revision tracking for your data.
Feed data from SQLAlchemy into a transmogrifier pipeline
Turn SQLAlchemy DB Model into a graph
UNKNOWN
A library to filter SQLAlchemy queries.
Python wrapper for the CircleCI API
SQLAlchemy-Nav provides SQLAlchemy Mixins for creating navigation bars compatible with Bootstrap
Automatically generates pretty repr of a SQLAlchemy model.
Compare two database schemas using sqlalchemy.
Provides natural equivalence support for SQLAlchemy declarative models.
A broadway extension wrapping Flask-SQLAlchemy
Simple JSON-Based CRUD Query Language for SQLAlchemy
Create Views and Materialized Views with SqlAlchemy
Use SQLAlchemy with CherryPy
SAP Sybase SQL Anywhere dialect for SQLAlchemy
Supported by


| Jump to DART Documentation Main Index |
The COSMIC project provides data from a series of satellites. There are two forms of the data that are used by DART: GPS Radio Occultation data and Electron Density. The programs in this directory extract the data from the distribution files and put them into DART observation sequence (obs_seq) file format.
The COSMIC satellites measure the phase delay caused by deviation of the straight-line path of the GPS satellite signal as it passes through the Earth's atmosphere when the GPS and COSMIC satellites rise and set relative to each other. This deviation results from changes in the angle of refraction of light as it passes through regions of varying density of atmosphere. These changes are a result of variations in the temperature, pressure, and moisture content. Vertical profiles of temperature and moisture can be derived as the signal passes through more and more atmosphere until it is obscured by the earth's horizon. There are thousands of observations each day distributed around the globe, including in areas which previously were poorly observed. These data are converted with the convert_cosmic_gps_cdf.f90 program and create DART observations of GPSRO_REFRACTIVITY.
The COSMIC satellites also provide ionospheric profiles of electron density. The accuracy is generally about 10-4 ∼ 10-5 cm-3. These data are converted with the convert_cosmic_ionosphere.f90 program and create DART observations tagged as COSMIC_ELECTRON_DENSITY.
Data from the COSMIC Program are available by signing up on the data access web page. We prefer delivery in netCDF file format.
The files we use as input to these conversion programs are
the Level 2 data, Atmospheric Profiles (filenames include
the string 'atmPrf').
Each vertical profile is stored in a separate netCDF file,
and there are between 1000-3000 profiles/day, so converting a day's
worth of observations used to involve downloading many individual files.
There are now daily tar files available which makes it simpler
to download the raw data all in a single file and then untar it to
get the individual profiles.
The scripts in the shell_scripts directory can
now download profiles from any of the available
satellites that return GPS RO data to the CDAAC web site. See the
gpsro_to_obsseq.csh or
convert_many_gpsro.csh script for where to
specify the satellites to be included.
The files we have used as input to these conversion programs are from
the COSMIC 2013 Mission and have a data type of 'ionPrf'.
The file naming convention and file format are described by COSMIC
here
and there can be more than 1000 profiles/day. Like the GPS radio
occultation data, the profiles are now available in a single daily
tar file which can be downloaded then be unpacked into the individual files.
COSMIC has instructions on ways to download the data at
http://cdaac-www.cosmic.ucar.edu/cdaac/tar/rest.html
The data are distributed in
netCDF
file format. DART requires all observations to be in a proprietary
format often called DART "obs_seq" format.
The files in this directory (a combination
of C shell scripts and a Fortran source executable)
do this data conversion.
The shell_scripts directory contains several example scripts, including one
which downloads the raw data files a day at a time (download_script.csh),
and one which executes the conversion program (convert_script.csh).
These scripts make 6 hour files by default, but have options for other times.
Each profile is stored in a separate netcdf file and there are usually
between 1000-3000 files/day, so the download process can be
lengthy. You probably want to download as a separate preprocess step
and do not use the script options to automatically delete the input files.
Keep the files around until you are sure you are satisified with the
output files and then delete them by hand.
The conversion executable convert_cosmic_gps_cdf,
reads the namelist
&convert_cosmic_gps_nml
from the file input.nml.
The namelist lets you select from one of two different forward
operators. The 'local' forward operator computes the expected
observation value at a single point: the requested height at the
tangent point of the ray between satellites. The 'non-local' operator
computes values along the ray-path and does an integration to get
the expected value. The length of the integration segments and
height at which to end the integration are given in the namelist.
In some experiments the difference between the two types of
operators was negligible. This choice is made at the time of
the conversion, and the type of operator is stored in the observation,
so at runtime the corresponding forward operator will be used to
compute the expected observation value.
The namelist also lets you specify at what heights you want
observations to be extracted. The raw data is very dense in
the vertical; using all values would not results in a set of
independent observations. The current source code no longer
does an intermediate interpolation; the original profiles
appear to be smooth enough that this is not needed. The requested
vertical output heights are interpolated directly from the full profile.
Each profile is interpolated to a set of desired levels that are specified at run time.
During the conversion process, each profile is checked for negative values of
electron density above the minimum desired level. If negative values are found,
the entire profile is discarded. If an observation sequence file already exists,
the converter will simply add the new observations to it. Multiple profiles may
be converted in a single execution, so it is easy to consolidate all the profiles
for a single day into a single observation sequence file, for example.
convert_cosmic_ionosphere
reads the namelist
&convert_cosmic_ionosphere_nml
from the file input.nml.
The original observation times are preserved in the conversion process. If it is
desired to subset the observation sequence file such that observations too far away
from desired assimilation times are rejected, a separate post-processing step
using the obs_sequence_tool is required.
A script will be necessary to take a start date, an end date, an assimilation
time step, and a desired time 'window' - and strip out the unwanted observations from
a series of observation sequence files.
There are multiple ways of specifying the observation error variance at run
time. They are implemented in a routine named
electron_density_error() and are selected by the namelist
variable observation_error_method.
| 'constant' | a scalar value for all observations | |
| 'scaled' | the electron density is multiplied by a scalar value | |
| 'lookup' | a lookup table is read | |
| 'scaled_lookup' | the lookup table value is multiplied by a scalar value and the electron density value |
I-Te Lee: " ... the original idea for error of ionospheric observation is 1%. Thus, I put the code as "oerr = 0.01_r8 * obsval". Liu et. al and Yue et al investigated the Abel inversion error of COSMIC ionosphere profile, both of them figure out the large error would appear at the lower altitude and push model toward wrong direction at the lower ionosphere while assimilating these profiles. On the other hand, the Abel inversion error depends on the ionospheric electron density structure, which is a function of local time, altitude and geomagnetic latitude. To simplify the procedure to define observation error of profiles, Xinan Yue help me to estimate an error matrix and saved in the file which named 'f3coerr.nc'. ... The number in the matrix is error percentage (%), which calculated by OSSE. Here are two reference papers. In the end, the observation error consists of instrumentation error (10%) and Abel error."
- X. Yue, W.S. Schreiner, J. Lei, S.V. Sokolovskiy, C. Rocken, D.C. Hunt, and Y.-H. Kuo (2010),
Error analysis of Abel retrieved electron density profiles from radio occultation measurements.
Annales Geophysicae: Atmospheres, Hydrospheres and Space Sciences. 28 No. 1, pp 217-222, doi:10.5194/angeo-28-217-2010- J.Y. Liu, C.Y. Lin, C.H. Lin, H.F. Tsai, S.C. Solomon, Y.Y. Sun, I.T. Lee, W.S. Schreiner, and Y.H. Kuo (2010),
Artificial plasma cave in the low-latitude ionosphere results from the radio occultation inversion of the FORMOSAT-3/COSMIC}, Journal of Geophysical Research: Space Physics. 115 No. A7, pp 2156-2202, doi:10.1029/2009JA015079
It is possible to create observation sequence files for perfect model experiments that have realistic observation sampling patterns and observation error variances that do not have any actual electron densities. The COSMIC data files are read, but the electron density information is not written. Keep in mind that some methods of specifying the observation error variance require knowledge of the observation value. If the observation value is bad or the entire profile is bad, no observation locations are created for the profile.
This namelist is read from the file input.nml. Namelists start with an ampersand '&' and terminate with a slash '/'. Character strings that contain a '/' must be enclosed in quotes to prevent them from prematurely terminating the namelist.
&convert_cosmic_gps_nml obs_levels = -1.0 use_original_kuo_error = .false. local_operator = .true. ray_ds = 5000.0 ray_htop = 15000.0 gpsro_netcdf_file = 'cosmic_gps_input.nc' gpsro_netcdf_filelist = '' gpsro_out_file = 'obs_seq.gpsro' /
| Item | Type | Description |
|---|---|---|
| obs_levels | integer(200) | A series of heights, in kilometers, where observations from this profile should be interpolated. (Note that the other distances and heights in the namelist are specified in meters.) The values should be listed in increasing height order. |
| use_original_kuo_error | logical | If .true. use the observation error variances for a refractivity observation that come from a Kuo paper and were implied to be used for the CONUS domain. If .false. use observation error variances similar to what is used in GSI. |
| local_operator | logical | If .true. compute the observation using a method which assumes all effects occur at the tangent point. If .false. integrate along the tangent line and do ray-path reconstruction. |
| ray_ds | real(r8) | For the non-local operator only, the delta stepsize, in meters, to use for the along-path integration in each direction out from the tangent point. |
| ray_htop | real(r8) | For the non-local operator only, stop the integration when one of the endpoints of the next integration step goes above this height. Specify in meters. |
| gpsro_netcdf_file | character(len=128) | The input filename when converting a single profile. Only one of the file or filelist items can have a valid value, so to use the single filename set the list name 'gpsro_netcdf_filelist' to the empty string (' '). |
| gpsro_netcdf_filelist | character(len=128) | To convert a series of profiles in a single execution create a text file which contains each input file, in ascii, one filename per line. Set this item to the name of that file, and set 'gpsro_netcdf_file' to the empty string (' '). |
| gpsro_out_file | character(len=128) | The output file to be created. To be compatible with earlier versions of this program, if this file already exists it will be read in and the new data will be appended to that file. |
A more useful example follows:
&convert_cosmic_gps_nml gpsro_netcdf_file = '' gpsro_netcdf_filelist = 'flist' gpsro_out_file = 'obs_seq.gpsro' local_operator = .true. use_original_kuo_error = .false. ray_ds = 5000.0 ray_htop = 13000.1 obs_levels = 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8, 5.0, 5.2, 5.4, 5.6, 5.8, 6.0, 6.2, 6.4, 6.6, 6.8, 7.0, 7.2, 7.4, 7.6, 7.8, 8.0, 8.2, 8.4, 8.6, 8.8, 9.0, 9.2, 9.4, 9.6, 9.8, 10.0, 10.2, 10.4, 10.6, 10.8, 11.0, 11.2, 11.4, 11.6, 11.8, 12.0, 12.2, 12.4, 12.6, 12.8, 13.0, 13.2, 13.4, 13.6, 13.8, 14.0, 14.2, 14.4, 14.6, 14.8, 15.0, 15.2, 15.4, 15.6, 15.8, 16.0, 16.2, 16.4, 16.6, 16.8, 17.0, 17.2, 17.4, 17.6, 17.8, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 50.0, 51.0, 52.0, 53.0, 54.0, 55.0, 56.0, 57.0, 58.0, 59.0, 60.0, /
&convert_cosmic_ionosphere_nml input_file = '' input_file_list = 'input_file_list.txt' output_file = 'obs_seq.out' observation_error_file = 'none' observation_error_method = 'scaled_lookup' locations_only = .false. obs_error_factor = 1.0 verbose = 0 obs_levels = -1.0 /
| Item | Type | Description |
|---|---|---|
| input_file | character(len=256) | The input filename when converting a single profile. Only one of the input_file or input_file_list items can have a valid value, so to use a single filename set input_file_list = '' |
| input_file_list | character(len=256) | To convert a series of profiles in a single execution create a text file which contains one filename per line. Set this item to the name of that file, and set input_file = '' |
| output_file | character(len=256) | The output file to be created. If this file already exists the new data will be added to that file. DART observation sequences are linked lists. When the list is traversed, the observations are in ascending time order. The order they appear in the file is completely irrelevant. |
| observation_error_file | character(len=256) | This specifies a lookup table. The table created by I-Te Lee and Xinan Yue is called f3coerr.nc. |
| observation_error_method | character(len=128) | There are multiple ways of specifying the observation error variance. This character string allows you to select the method. The selection is not case-sensitive. Allowable values are: 'constant', 'scaled', 'lookup', or 'scaled_lookup'. Anything else will result in an error. Look in the electron_density_error() routine for specifics. |
| locations_only | logical | If locations_only = .true. then the actual observation values are not written to the output observation sequence file. This is useful for designing an OSSE that has a realistic observation sampling pattern. Keep in mind that some methods of specifying the observation error variance require knowledge of the observation value. If the observation value is bad or the entire profile is bad, this profile is rejected - even if locations_only = .true. |
| obs_error_factor | real(r8) | This is the scalar that is used in several of the methods specifying the observation error variance. |
| verbose | integer | controls the amount of run-time output echoed to the screen. 0 is nearly silent, higher values write out more. The filenames of the profiles that are skipped are ALWAYS printed. |
| obs_levels | integer(200) | A series of heights, in kilometers, where observations from this profile should be interpolated. (Note that the other distances and heights in the namelist are specified in meters.) The values must be listed in increasing height order. |
A more useful example follows:
&convert_cosmic_ionosphere_nml input_file = '' input_file_list = 'file_list.txt' output_file = 'obs_seq.out' observation_error_file = 'f3coeff.dat' observation_error_method = 'scaled' locations_only = .false. obs_error_factor = 0.01 verbose = 1 obs_levels = 160.0, 170.0, 180.0, 190.0, 200.0, 210.0, 220.0, 230.0, 240.0, 250.0, 260.0, 270.0, 280.0, 290.0, 300.0, 310.0, 320.0, 330.0, 340.0, 350.0, 360.0, 370.0, 380.0, 390.0, 400.0, 410.0, 420.0, 430.0, 440.0, 450.0 /
If you are converting only a day or two of observations you can download the files by hand and call the converter programs from the command line. However if you are going convert many days/months/years of data you need an automated script, possibly submitted to a batch queue on a large machine. The following instructions describe shell scripts we provide as a guide in the shell_scripts directory. You will have to adapt them for your own system unless you are running on an NCAR superscomputer.
Making DART Observations from Radio Occultation atmPrf Profiles:
Description of the scripts provided to process the COSMIC and CHAMP GPS radio occultation data. Summary of workflow: 1) cd to the ../work directory and run ./quickbuild.csh to compile everything. 2) Edit ./gpsro_to_obsseq.csh once to set the directory where the DART code is installed, and your CDAAC web site user name and password. 3) Edit ./convert_many_gpsro.csh to set the days of data to download/convert/remove. 4) Run ./convert_many_gpsro.csh either on the command line or submit to a batch system. More details: 1) quickbuild.csh: Make sure your $DART/mkmf/mkmf.template is one that matches the platform and compiler for your system. It should be the same as how you have it set to build the other DART executables. Run quickbuild.csh and it should compile all the executables needed to do the GPS conversion into DART obs_sequence files. 2) gpsro_to_obsseq.csh: Edit gpsro_to_obsseq.csh once to set the DART_DIR to where you have downloaded the DART distribution. (There are a few additional options in this script, but the distribution version should be good for most users.) If you are downloading data from the CDAAC web site, set your web site user name and password. After this you should be able to ignore this script. 3) convert_many_gpsro.csh: A wrapper script that calls the converter script a day at a time. Set the days of data you want to download/convert/remove. See the comments at the top of this script for the various options to set. Rerun this script for all data you need. This script depends on the advance_time executable, which should automatically be built in the ../work directory, but you may have to copy or link to a version from this dir. you also need a minimal input.nml here: &utilities_nml / is all the contents it needs. It can be risky to use the automatic delete/cleanup option - if there are any errors in the script or conversion (file system full, bad file format, etc) and the script doesn't exit, it can delete the input files before the conversion has succeeded. But if you have file quota concerns this allows you to keep the total disk usage lower.
Making DART Observations from Ionospheric ionPrf Profiles:
0) run quickbuild.csh as described above 1) iono_to_obsseq.csh set the start and stop days. downloads from the CDAAC and untars into 100s of files per day. runs the converter to create a single obs_seq.ion.YYYYMMDD file per day. 2) split_obs_seq.csh split the daily files into X minute/hour files - set the window times at the top of the file before running.
Notes on already converted observations on the NCAR supercomputers
GPS Radio Occultation Data:
See /glade/p/image/Observations/GPS These are DART observation sequence files that contain radio-occultation measurements from the COSMIC (and other) satellites. Uses temperature/moisture bending of the signals as they pass through the atmosphere between GPS source satellites and low-earth-orbit receiving satellites to compute the delay in the arrival of data. the files also contain the bending angle data, but we are not using that currently. the subdirectories include: local -- original processed files, single obs at nadir local-cosmic2013 -- reprocessed by CDAAC in 2013 local-test2013 -- 2013 data, denser in vertical, diff errors local-complete2013 - all satellites available for that time, new errors (from lydia c), 2013 cosmic reprocessed data nonlocal -- original processed files, ray-path integrated rawdata -- netcdf data files downloaded from the CDAAC local: the ob is at a single location (the tangent point of the ray and earth) and the entire effect is assumed to be impacting the state at that point. non-local: computes the ob value by doing a line integral along the ray path to accumulate the total effect. (in our experiments we have compared both and did not see a large difference between the two methods, and so have mistly used the local version because it's faster to run.) some directories contain only the gps obs and must be merged (with the obs_sequence_tool) with the rest of the conventional obs before assimilation. some directories contain both the gps-only files and the obs merged with NCEP and ACARS data. if a directory exists but is empty, the files are likely archived on the HPSS. see the README files in the next level directory down for more info on where they might be. nsc jan 2016
See /glade/p/image/Observation/ionosphere These are COSMIC 'ionPrf' ionospheric profile observations. They are downloaded from the CDAAC website as daily tar files and unpacked into the 'raw' directory. They distribute these observations with one profile per netcdf file. Each profile has data at ~500-1000 different levels. Our converter has a fixed number of levels in the namelist and we interpolate between the two closest levels to get the data for that level. If you give the converter a list of input netcdf files it will convert all of them into a single output file. The 'daily' directory is a collection of all the profiles for that day. The 'convert' directory has the executables and scripting for breaking up the daily files into 10 minute files which are put in the '10min' directory. Change the 'split_obs_seq.csh' script to change the width of this window, or the names of the output files. The 'verify.csh' script prints out any missing files, which happens if there are no profiles in the given window. Our convention is to make a 0 length file for missing intervals and we expect the filter run script to look at the file size and loop if there is a file but with no contents. This will allow us to distinguish between a time where we haven't converted the observations and a time where there are no observations. In that case the script should add time to the next model advance request and loop to the next interval.
convert_cosmic_gps_cdf and convert_cosmic_ionosphere use the same set of modules.
assimilation_code/location/threed_sphere/location_mod.f90 assimilation_code/modules/assimilation/adaptive_inflate_mod.f90 assimilation_code/modules/assimilation/assim_model_mod.f90 assimilation_code/modules/io/dart_time_io_mod.f90 assimilation_code/modules/io/direct_netcdf_mod.f90 assimilation_code/modules/io/io_filenames_mod.f90 assimilation_code/modules/io/state_structure_mod.f90 assimilation_code/modules/io/state_vector_io_mod.f90 assimilation_code/modules/observations/obs_kind_mod.f90 assimilation_code/modules/observations/obs_sequence_mod.f90 assimilation_code/modules/utilities/distributed_state_mod.f90 assimilation_code/modules/utilities/ensemble_manager_mod.f90 assimilation_code/modules/utilities/netcdf_utilities_mod.f90 assimilation_code/modules/utilities/null_mpi_utilities_mod.f90 assimilation_code/modules/utilities/null_win_mod.f90 assimilation_code/modules/utilities/options_mod.f90 assimilation_code/modules/utilities/random_seq_mod.f90 assimilation_code/modules/utilities/sort_mod.f90 assimilation_code/modules/utilities/time_manager_mod.f90 assimilation_code/modules/utilities/types_mod.f90 assimilation_code/modules/utilities/utilities_mod.f90 models/template/model_mod.f90 models/utilities/default_model_mod.f90 observations/forward_operators/obs_def_mod.f90 observations/forward_operators/obs_def_utilities_mod.f90 observations/obs_converters/utilities/obs_utilities_mod.f90
Some COSMIC files seem to have internal times which differ from the times encoded in the filenames by as much as 2-3 minutes. If it is important to get all the observations within a particular time window files with filenames from a few minutes before and after the window should be converted. Times really outside the window can be excluded in a separate step using the obs_sequence_tool.
The converters have a parameter declaring the maximum number of desired levels as 200. If more than 200 levels are entered as input (to obs_levels), a rather uninformative run-time error is generated:
ERROR FROM: routine: check_namelist_read message: INVALID NAMELIST ENTRY: / in namelist convert_cosmic_ionosphere_nml
Your error may be different if obs_levels is not the last namelist item before the slash '/'
none
DART software - Copyright UCAR. This open source software is provided by UCAR, "as is", without charge, subject to all terms of use at http://www.image.ucar.edu/DAReS/DART/DART_download


Mark studied Chemical Physics as an undergraduate at the University of Bristol, followed by a PhD in Chemistry at the University of Cambridge under the supervision of Professor David Klenerman. He was awarded the 2002 Gregorio Weber International Prize in Biological Fluorescence for this work. Mark then spent 2 years as a postdoctoral fellow at Stanford University, working with Professor Richard Zare. He returned to the U.K. in 2002 to undertake a second postdoctoral position at the National Institute for Medical Research with Dr Justin Molloy, before moving to Oxford in 2005 as a Royal Society University Research Fellow. He was subsequently appointed as a University lecturer and fellow of Wadham college in 2006. He joined King’s in 2016 as part of its expansion of Chemistry.
In 2009 Mark was appointed to the steering committee of the British Biophysical Society. Patents arising from his work have also been licensed in the U.K. Mark has also been active in raising awareness of his group’s research beyond the lab, including video podcasting and participation in the 2014 “I’m a scientist get me out of here” competition. He was awarded the RSC Norman Heatley Award in 2015 in recognition of his work. He was made a Fellow of the RSC in the same year.


If person(1) was able to travel SUM1 km north in TIME1 hours in his car, and then travels south for TIME2 hours with a speed of SCORES2 kilometers per hour.
What was his(1) average velocity north?
The average velocity is the displacement vector divided by the time.
The displacement north is a vector and is equal to the distance person(1) travels north minus the distance he(1) travels south, because the vectors are in opposite directions.
The displacement south is TIME2 \text{h} \times SCORES2 \text{km/h} = TIME2 * SCORES2 \text{km}
.
Therefore the total displacement north is SUM1\text{km (north)} - SUM2\text{km (south)} = SUM \text{km (north)}
The total time is the sum of the times he(1) travels north and south and is equal to TIME1 + TIME2 = TIME1 + TIME2
Therefore the average velocity north is equal to SUM \div TIME1 + TIME2 = SUM / (TIME1 + TIME2)
If person(1) was able to travel SUM1 km north in TIME1 hours in his car, and then travels north for TIME2 hours with a speed of SCORES2 kilometers per hour.
What was his(1) average velocity north?
The average velocity is the displacement vector divided by the time.
The second displacement is TIME2 \text{h} \times SCORES2 \text{km/h} = TIME2 * SCORES2 \text{km}
.
Therefore the total displacement north is SUM1\text{km (north)} + SUM2\text{km (north)} = SUM \text{km (north)}
The total time is the sum of the times he(1) travels north and south and is equal to TIME1 + TIME2 = TIME1 + TIME2
Therefore the average velocity north is equal to SUM \div TIME1 + TIME2 = SUM / (TIME1 + TIME2)
If person(1) was able to travel SUM1 km north in TIME1 hours in his car, and then travels north for TIME2 hours with a speed of SCORES2 kilometers per hour.
What was his(1) average velocity north?
The average velocity is the displacement vector divided by the time.
The total displacement north is SUM1
and the total time is TIME1 \text{hours}
, therefore the average velocity north is equal to SUM \div TIME1 = SUM / TIME1