What’s an Object Walk?
The object walk is a key concept in Git - this is the process that underpins
operations like object transfer and fsck. Beginning from a given commit, the
list of objects is found by walking parent relationships between commits (commit
X based on commit W) and containment relationships between objects (tree Y is
contained within commit X, and blob Z is located within tree Y, giving our
working tree for commit X something like y/z.txt
).
A related concept is the revision walk, which is focused on commit objects and
their parent relationships and does not delve into other object types. The
revision walk is used for operations like git log
.
Related Reading
-
Documentation/user-manual.txt
under "Hacking Git" contains some coverage of the revision walker in its various incarnations. -
revision.h
-
Git for Computer Scientists gives a good overview of the types of objects in Git and what your object walk is really describing.
Setting Up
Create a new branch from master
.
git checkout -b revwalk origin/master
We’ll put our fiddling into a new command. For fun, let’s name it git walken
.
Open up a new file builtin/walken.c
and set up the command handler:
/*
* "git walken"
*
* Part of the "My First Object Walk" tutorial.
*/
#include "builtin.h"
int cmd_walken(int argc, const char **argv, const char *prefix)
{
trace_printf(_("cmd_walken incoming...\n"));
return 0;
}
|
Note
|
trace_printf() differs from printf() in that it can be turned on or
off at runtime. For the purposes of this tutorial, we will write walken as
though it is intended for use as a "plumbing" command: that is, a command which
is used primarily in scripts, rather than interactively by humans (a "porcelain"
command). So we will send our debug output to trace_printf() instead. When
running, enable trace output by setting the environment variable GIT_TRACE . |
Add usage text and -h
handling, like all subcommands should consistently do
(our test suite will notice and complain if you fail to do so).
int cmd_walken(int argc, const char **argv, const char *prefix)
{
const char * const walken_usage[] = {
N_("git walken"),
NULL,
}
struct option options[] = {
OPT_END()
};
argc = parse_options(argc, argv, prefix, options, walken_usage, 0);
...
}
Also add the relevant line in builtin.h
near cmd_whatchanged()
:
int cmd_walken(int argc, const char **argv, const char *prefix);
Include the command in git.c
in commands[]
near the entry for whatchanged
,
maintaining alphabetical ordering:
{ "walken", cmd_walken, RUN_SETUP },
Add it to the Makefile
near the line for builtin/worktree.o
:
BUILTIN_OBJS += builtin/walken.o
Build and test out your command, without forgetting to ensure the DEVELOPER
flag is set, and with GIT_TRACE
enabled so the debug output can be seen:
$ echo DEVELOPER=1 >>config.mak
$ make
$ GIT_TRACE=1 ./bin-wrappers/git walken
|
Note
|
For a more exhaustive overview of the new command process, take a look at
Documentation/MyFirstContribution.txt . |
|
Note
|
A reference implementation can be found at https://github.com/nasamuffin/git/tree/revwalk. |
struct rev_cmdline_info
The definition of struct rev_cmdline_info
can be found in revision.h
.
This struct is contained within the rev_info
struct and is used to reflect
parameters provided by the user over the CLI.
nr
represents the number of rev_cmdline_entry
present in the array.
alloc
is used by the ALLOC_GROW
macro. Check cache.h
- this variable is
used to track the allocated size of the list.
Per entry, we find:
item
is the object provided upon which to base the object walk. Items in Git
can be blobs, trees, commits, or tags. (See Documentation/gittutorial-2.txt
.)
name
is the object ID (OID) of the object - a hex string you may be familiar
with from using Git to organize your source in the past. Check the tutorial
mentioned above towards the top for a discussion of where the OID can come
from.
whence
indicates some information about what to do with the parents of the
specified object. We’ll explore this flag more later on; take a look at
Documentation/revisions.txt
to get an idea of what could set the whence
value.
flags
are used to hint the beginning of the revision walk and are the first
block under the #include`s in `revision.h
. The most likely ones to be set in
the rev_cmdline_info
are UNINTERESTING
and BOTTOM
, but these same flags
can be used during the walk, as well.
struct rev_info
This one is quite a bit longer, and many fields are only used during the walk
by revision.c
- not configuration options. Most of the configurable flags in
struct rev_info
have a mirror in Documentation/rev-list-options.txt
. It’s a
good idea to take some time and read through that document.
Basic Commit Walk
First, let’s see if we can replicate the output of git log --oneline
. We’ll
refer back to the implementation frequently to discover norms when performing
an object walk of our own.
To do so, we’ll first find all the commits, in order, which preceded the current commit. We’ll extract the name and subject of the commit from each.
Ideally, we will also be able to find out which ones are currently at the tip of various branches.
Setting Up
Preparing for your object walk has some distinct stages.
-
Perform default setup for this mode, and others which may be invoked.
-
Check configuration files for relevant settings.
-
Set up the
rev_info
struct. -
Tweak the initialized
rev_info
to suit the current walk. -
Prepare the
rev_info
for the walk. -
Iterate over the objects, processing each one.
Default Setups
Before examining configuration files which may modify command behavior, set up
default state for switches or options your command may have. If your command
utilizes other Git components, ask them to set up their default states as well.
For instance, git log
takes advantage of grep
and diff
functionality, so
its init_log_defaults()
sets its own state (decoration_style
) and asks
grep
and diff
to initialize themselves by calling each of their
initialization functions.
For our first example within git walken
, we don’t intend to use any other
components within Git, and we don’t have any configuration to do. However, we
may want to add some later, so for now, we can add an empty placeholder. Create
a new function in builtin/walken.c
:
static void init_walken_defaults(void)
{
/*
* We don't actually need the same components `git log` does; leave this
* empty for now.
*/
}
Make sure to add a line invoking it inside of cmd_walken()
.
int cmd_walken(int argc, const char **argv, const char *prefix)
{
init_walken_defaults();
}
Configuring From .gitconfig
Next, we should have a look at any relevant configuration settings (i.e.,
settings readable and settable from git config
). This is done by providing a
callback to git_config()
; within that callback, you can also invoke methods
from other components you may need that need to intercept these options. Your
callback will be invoked once per each configuration value which Git knows about
(global, local, worktree, etc.).
Similarly to the default values, we don’t have anything to do here yet
ourselves; however, we should call git_default_config()
if we aren’t calling
any other existing config callbacks.
Add a new function to builtin/walken.c
:
static int git_walken_config(const char *var, const char *value, void *cb)
{
/*
* For now, we don't have any custom configuration, so fall back to
* the default config.
*/
return git_default_config(var, value, cb);
}
Make sure to invoke git_config()
with it in your cmd_walken()
:
int cmd_walken(int argc, const char **argv, const char *prefix)
{
...
git_config(git_walken_config, NULL);
...
}
Setting Up rev_info
Now that we’ve gathered external configuration and options, it’s time to
initialize the rev_info
object which we will use to perform the walk. This is
typically done by calling repo_init_revisions()
with the repository you intend
to target, as well as the prefix
argument of cmd_walken
and your rev_info
struct.
Add the struct rev_info
and the repo_init_revisions()
call:
int cmd_walken(int argc, const char **argv, const char *prefix)
{
/* This can go wherever you like in your declarations.*/
struct rev_info rev;
...
/* This should go after the git_config() call. */
repo_init_revisions(the_repository, &rev, prefix);
...
}
Tweaking rev_info
For the Walk
We’re getting close, but we’re still not quite ready to go. Now that rev
is
initialized, we can modify it to fit our needs. This is usually done within a
helper for clarity, so let’s add one:
static void final_rev_info_setup(struct rev_info *rev)
{
/*
* We want to mimic the appearance of `git log --oneline`, so let's
* force oneline format.
*/
get_commit_format("oneline", rev);
/* Start our object walk at HEAD. */
add_head_to_pending(rev);
}
|
Note
|
Instead of using the shorthand
Using a |
Then let’s invoke final_rev_info_setup()
after the call to
repo_init_revisions()
:
int cmd_walken(int argc, const char **argv, const char *prefix)
{
...
final_rev_info_setup(&rev);
...
}
Later, we may wish to add more arguments to final_rev_info_setup()
. But for
now, this is all we need.
Preparing rev_info
For the Walk
Now that rev
is all initialized and configured, we’ve got one more setup step
before we get rolling. We can do this in a helper, which will both prepare the
rev_info
for the walk, and perform the walk itself. Let’s start the helper
with the call to prepare_revision_walk()
, which can return an error without
dying on its own:
static void walken_commit_walk(struct rev_info *rev)
{
if (prepare_revision_walk(rev))
die(_("revision walk setup failed"));
}
|
Note
|
die() prints to stderr and exits the program. Since it will print to
stderr it’s likely to be seen by a human, so we will localize it. |
Performing the Walk!
Finally! We are ready to begin the walk itself. Now we can see that rev_info
can also be used as an iterator; we move to the next item in the walk by using
get_revision()
repeatedly. Add the listed variable declarations at the top and
the walk loop below the prepare_revision_walk()
call within your
walken_commit_walk()
:
static void walken_commit_walk(struct rev_info *rev)
{
struct commit *commit;
struct strbuf prettybuf = STRBUF_INIT;
...
while ((commit = get_revision(rev))) {
strbuf_reset(&prettybuf);
pp_commit_easy(CMIT_FMT_ONELINE, commit, &prettybuf);
puts(prettybuf.buf);
}
strbuf_release(&prettybuf);
}
|
Note
|
puts() prints a char* to stdout . Since this is the part of the
command we expect to be machine-parsed, we’re sending it directly to stdout. |
Give it a shot.
$ make
$ ./bin-wrappers/git walken
You should see all of the subject lines of all the commits in
your tree’s history, in order, ending with the initial commit, "Initial revision
of "git", the information manager from hell". Congratulations! You’ve written
your first revision walk. You can play with printing some additional fields
from each commit if you’re curious; have a look at the functions available in
commit.h
.
Adding a Filter
Next, let’s try to filter the commits we see based on their author. This is
equivalent to running git log --author=<pattern>
. We can add a filter by
modifying rev_info.grep_filter
, which is a struct grep_opt
.
First some setup. Add init_grep_defaults()
to init_walken_defaults()
and add
grep_config()
to git_walken_config()
:
static void init_walken_defaults(void)
{
init_grep_defaults(the_repository);
}
...
static int git_walken_config(const char *var, const char *value, void *cb)
{
grep_config(var, value, cb);
return git_default_config(var, value, cb);
}
Next, we can modify the grep_filter
. This is done with convenience functions
found in grep.h
. For fun, we’re filtering to only commits from folks using a
gmail.com
email address - a not-very-precise guess at who may be working on
Git as a hobby. Since we’re checking the author, which is a specific line in the
header, we’ll use the append_header_grep_pattern()
helper. We can use
the enum grep_header_field
to indicate which part of the commit header we want
to search.
In final_rev_info_setup()
, add your filter line:
static void final_rev_info_setup(int argc, const char **argv,
const char *prefix, struct rev_info *rev)
{
...
append_header_grep_pattern(&rev->grep_filter, GREP_HEADER_AUTHOR,
"gmail");
compile_grep_patterns(&rev->grep_filter);
...
}
append_header_grep_pattern()
adds your new "gmail" pattern to rev_info
, but
it won’t work unless we compile it with compile_grep_patterns()
.
|
Note
|
If you are using setup_revisions() (for example, if you are passing a
setup_revision_opt instead of using add_head_to_pending() ), you don’t need
to call compile_grep_patterns() because setup_revisions() calls it for you. |
|
Note
|
We could add the same filter via the append_grep_pattern() helper if we
wanted to, but append_header_grep_pattern() adds the enum grep_context and
enum grep_pat_token for us. |
Changing the Order
There are a few ways that we can change the order of the commits during a
revision walk. Firstly, we can use the enum rev_sort_order
to choose from some
typical orderings.
topo_order
is the same as git log --topo-order
: we avoid showing a parent
before all of its children have been shown, and we avoid mixing commits which
are in different lines of history. (git help log
's section on --topo-order
has a very nice diagram to illustrate this.)
Let’s see what happens when we run with REV_SORT_BY_COMMIT_DATE
as opposed to
REV_SORT_BY_AUTHOR_DATE
. Add the following:
static void final_rev_info_setup(int argc, const char **argv,
const char *prefix, struct rev_info *rev)
{
...
rev->topo_order = 1;
rev->sort_order = REV_SORT_BY_COMMIT_DATE;
...
}
Let’s output this into a file so we can easily diff it with the walk sorted by author date.
$ make
$ ./bin-wrappers/git walken > commit-date.txt
Then, let’s sort by author date and run it again.
static void final_rev_info_setup(int argc, const char **argv,
const char *prefix, struct rev_info *rev)
{
...
rev->topo_order = 1;
rev->sort_order = REV_SORT_BY_AUTHOR_DATE;
...
}
$ make
$ ./bin-wrappers/git walken > author-date.txt
Finally, compare the two. This is a little less helpful without object names or dates, but hopefully we get the idea.
$ diff -u commit-date.txt author-date.txt
This display indicates that commits can be reordered after they’re written, for
example with git rebase
.
Let’s try one more reordering of commits. rev_info
exposes a reverse
flag.
Set that flag somewhere inside of final_rev_info_setup()
:
static void final_rev_info_setup(int argc, const char **argv, const char *prefix,
struct rev_info *rev)
{
...
rev->reverse = 1;
...
}
Run your walk again and note the difference in order.
Basic Object Walk
So far we’ve been walking only commits. But Git has more types of objects than that! Let’s see if we can walk all objects, and find out some information about each one.
We can base our work on an example. git pack-objects
prepares all kinds of
objects for packing into a bitmap or packfile. The work we are interested in
resides in builtins/pack-objects.c:get_object_list()
; examination of that
function shows that the all-object walk is being performed by
traverse_commit_list()
or traverse_commit_list_filtered()
. Those two
functions reside in list-objects.c
; examining the source shows that, despite
the name, these functions traverse all kinds of objects. Let’s have a look at
the arguments to traverse_commit_list_filtered()
, which are a superset of the
arguments to the unfiltered version.
-
struct list_objects_filter_options *filter_options
: This is a struct which stores a filter-spec as outlined inDocumentation/rev-list-options.txt
. -
struct rev_info *revs
: This is therev_info
used for the walk. -
show_commit_fn show_commit
: A callback which will be used to handle each individual commit object. -
show_object_fn show_object
: A callback which will be used to handle each non-commit object (so each blob, tree, or tag). -
void *show_data
: A context buffer which is passed in turn toshow_commit
andshow_object
. -
struct oidset *omitted
: A linked-list of object IDs which the provided filter caused to be omitted.
It looks like this traverse_commit_list_filtered()
uses callbacks we provide
instead of needing us to call it repeatedly ourselves. Cool! Let’s add the
callbacks first.
For the sake of this tutorial, we’ll simply keep track of how many of each kind
of object we find. At file scope in builtin/walken.c
add the following
tracking variables:
static int commit_count;
static int tag_count;
static int blob_count;
static int tree_count;
Commits are handled by a different callback than other objects; let’s do that one first:
static void walken_show_commit(struct commit *cmt, void *buf)
{
commit_count++;
}
The cmt
argument is fairly self-explanatory. But it’s worth mentioning that
the buf
argument is actually the context buffer that we can provide to the
traversal calls - show_data
, which we mentioned a moment ago.
Since we have the struct commit
object, we can look at all the same parts that
we looked at in our earlier commit-only walk. For the sake of this tutorial,
though, we’ll just increment the commit counter and move on.
The callback for non-commits is a little different, as we’ll need to check which kind of object we’re dealing with:
static void walken_show_object(struct object *obj, const char *str, void *buf)
{
switch (obj->type) {
case OBJ_TREE:
tree_count++;
break;
case OBJ_BLOB:
blob_count++;
break;
case OBJ_TAG:
tag_count++;
break;
case OBJ_COMMIT:
BUG("unexpected commit object in walken_show_object\n");
default:
BUG("unexpected object type %s in walken_show_object\n",
type_name(obj->type));
}
}
Again, obj
is fairly self-explanatory, and we can guess that buf
is the same
context pointer that walken_show_commit()
receives: the show_data
argument
to traverse_commit_list()
and traverse_commit_list_filtered()
. Finally,
str
contains the name of the object, which ends up being something like
foo.txt
(blob), bar/baz
(tree), or v1.2.3
(tag).
To help assure us that we aren’t double-counting commits, we’ll include some
complaining if a commit object is routed through our non-commit callback; we’ll
also complain if we see an invalid object type. Since those two cases should be
unreachable, and would only change in the event of a semantic change to the Git
codebase, we complain by using BUG()
- which is a signal to a developer that
the change they made caused unintended consequences, and the rest of the
codebase needs to be updated to understand that change. BUG()
is not intended
to be seen by the public, so it is not localized.
Our main object walk implementation is substantially different from our commit walk implementation, so let’s make a new function to perform the object walk. We can perform setup which is applicable to all objects here, too, to keep separate from setup which is applicable to commit-only walks.
We’ll start by enabling all types of objects in the struct rev_info
. We’ll
also turn on tree_blobs_in_commit_order
, which means that we will walk a
commit’s tree and everything it points to immediately after we find each commit,
as opposed to waiting for the end and walking through all trees after the commit
history has been discovered. With the appropriate settings configured, we are
ready to call prepare_revision_walk()
.
static void walken_object_walk(struct rev_info *rev)
{
rev->tree_objects = 1;
rev->blob_objects = 1;
rev->tag_objects = 1;
rev->tree_blobs_in_commit_order = 1;
if (prepare_revision_walk(rev))
die(_("revision walk setup failed"));
commit_count = 0;
tag_count = 0;
blob_count = 0;
tree_count = 0;
Let’s start by calling just the unfiltered walk and reporting our counts.
Complete your implementation of walken_object_walk()
:
traverse_commit_list(rev, walken_show_commit, walken_show_object, NULL);
printf("commits %d\nblobs %d\ntags %d\ntrees %d\n", commit_count,
blob_count, tag_count, tree_count);
}
|
Note
|
This output is intended to be machine-parsed. Therefore, we are not
sending it to trace_printf() , and we are not localizing it - we need scripts
to be able to count on the formatting to be exactly the way it is shown here.
If we were intending this output to be read by humans, we would need to localize
it with _() . |
Finally, we’ll ask cmd_walken()
to use the object walk instead. Discussing
command line options is out of scope for this tutorial, so we’ll just hardcode
a branch we can change at compile time. Where you call final_rev_info_setup()
and walken_commit_walk()
, instead branch like so:
if (1) {
add_head_to_pending(&rev);
walken_object_walk(&rev);
} else {
final_rev_info_setup(argc, argv, prefix, &rev);
walken_commit_walk(&rev);
}
|
Note
|
For simplicity, we’ve avoided all the filters and sorts we applied in
final_rev_info_setup() and simply added HEAD to our pending queue. If you
want, you can certainly use the filters we added before by moving
final_rev_info_setup() out of the conditional and removing the call to
add_head_to_pending() . |
Now we can try to run our command! It should take noticeably longer than the commit walk, but an examination of the output will give you an idea why. Your output should look similar to this example, but with different counts:
Object walk completed. Found 55733 commits, 100274 blobs, 0 tags, and 104210 trees.
This makes sense. We have more trees than commits because the Git project has
lots of subdirectories which can change, plus at least one tree per commit. We
have no tags because we started on a commit (HEAD
) and while tags can point to
commits, commits can’t point to tags.
|
Note
|
You will have different counts when you run this yourself! The number of objects grows along with the Git project. |
Adding a Filter
There are a handful of filters that we can apply to the object walk laid out in
Documentation/rev-list-options.txt
. These filters are typically useful for
operations such as creating packfiles or performing a partial clone. They are
defined in list-objects-filter-options.h
. For the purposes of this tutorial we
will use the "tree:1" filter, which causes the walk to omit all trees and blobs
which are not directly referenced by commits reachable from the commit in
pending
when the walk begins. (pending
is the list of objects which need to
be traversed during a walk; you can imagine a breadth-first tree traversal to
help understand. In our case, that means we omit trees and blobs not directly
referenced by HEAD
or HEAD
's history, because we begin the walk with only
HEAD
in the pending
list.)
First, we’ll need to #include "list-objects-filter-options.h
" and set up the
struct list_objects_filter_options
at the top of the function.
static void walken_object_walk(struct rev_info *rev)
{
struct list_objects_filter_options filter_options = {};
...
For now, we are not going to track the omitted objects, so we’ll replace those
parameters with NULL
. For the sake of simplicity, we’ll add a simple
build-time branch to use our filter or not. Replace the line calling
traverse_commit_list()
with the following, which will remind us which kind of
walk we’ve just performed:
if (0) {
/* Unfiltered: */
trace_printf(_("Unfiltered object walk.\n"));
traverse_commit_list(rev, walken_show_commit,
walken_show_object, NULL);
} else {
trace_printf(
_("Filtered object walk with filterspec 'tree:1'.\n"));
parse_list_objects_filter(&filter_options, "tree:1");
traverse_commit_list_filtered(&filter_options, rev,
walken_show_commit, walken_show_object, NULL, NULL);
}
struct list_objects_filter_options
is usually built directly from a command
line argument, so the module provides an easy way to build one from a string.
Even though we aren’t taking user input right now, we can still build one with
a hardcoded string using parse_list_objects_filter()
.
With the filter spec "tree:1", we are expecting to see only the root tree for
each commit; therefore, the tree object count should be less than or equal to
the number of commits. (For an example of why that’s true: git commit --revert
points to the same tree object as its grandparent.)
Counting Omitted Objects
We also have the capability to enumerate all objects which were omitted by a
filter, like with git log --filter=<spec> --filter-print-omitted
. Asking
traverse_commit_list_filtered()
to populate the omitted
list means that our
object walk does not perform any better than an unfiltered object walk; all
reachable objects are walked in order to populate the list.
First, add the struct oidset
and related items we will use to iterate it:
static void walken_object_walk(
...
struct oidset omitted;
struct oidset_iter oit;
struct object_id *oid = NULL;
int omitted_count = 0;
oidset_init(&omitted, 0);
...
Modify the call to traverse_commit_list_filtered()
to include your omitted
object:
...
traverse_commit_list_filtered(&filter_options, rev,
walken_show_commit, walken_show_object, NULL, &omitted);
...
Then, after your traversal, the oidset
traversal is pretty straightforward.
Count all the objects within and modify the print statement:
/* Count the omitted objects. */
oidset_iter_init(&omitted, &oit);
while ((oid = oidset_iter_next(&oit)))
omitted_count++;
printf("commits %d\nblobs %d\ntags %d\ntrees%d\nomitted %d\n",
commit_count, blob_count, tag_count, tree_count, omitted_count);
By running your walk with and without the filter, you should find that the total
object count in each case is identical. You can also time each invocation of
the walken
subcommand, with and without omitted
being passed in, to confirm
to yourself the runtime impact of tracking all omitted objects.
Changing the Order
Finally, let’s demonstrate that you can also reorder walks of all objects, not
just walks of commits. First, we’ll make our handlers chattier - modify
walken_show_commit()
and walken_show_object()
to print the object as they
go:
static void walken_show_commit(struct commit *cmt, void *buf)
{
trace_printf("commit: %s\n", oid_to_hex(&cmt->object.oid));
commit_count++;
}
static void walken_show_object(struct object *obj, const char *str, void *buf)
{
trace_printf("%s: %s\n", type_name(obj->type), oid_to_hex(&obj->oid));
...
}
|
Note
|
Since we will be examining this output directly as humans, we’ll use
trace_printf() here. Additionally, since this change introduces a significant
number of printed lines, using trace_printf() will allow us to easily silence
those lines without having to recompile. |
(Leave the counter increment logic in place.)
With only that change, run again (but save yourself some scrollback):
$ GIT_TRACE=1 ./bin-wrappers/git walken | head -n 10
Take a look at the top commit with git show
and the object ID you printed; it
should be the same as the output of git show HEAD
.
Next, let’s change a setting on our struct rev_info
within
walken_object_walk()
. Find where you’re changing the other settings on rev
,
such as rev->tree_objects
and rev->tree_blobs_in_commit_order
, and add the
reverse
setting at the bottom:
...
rev->tree_objects = 1;
rev->blob_objects = 1;
rev->tag_objects = 1;
rev->tree_blobs_in_commit_order = 1;
rev->reverse = 1;
...
Now, run again, but this time, let’s grab the last handful of objects instead of the first handful:
$ make
$ GIT_TRACE=1 ./bin-wrappers git walken | tail -n 10
The last commit object given should have the same OID as the one we saw at the
top before, and running git show <oid>
with that OID should give you again
the same results as git show HEAD
. Furthermore, if you run and examine the
first ten lines again (with head
instead of tail
like we did before applying
the reverse
setting), you should see that now the first commit printed is the
initial commit, e83c5163
.
Wrapping Up
Let’s review. In this tutorial, we:
-
Built a commit walk from the ground up
-
Enabled a grep filter for that commit walk
-
Changed the sort order of that filtered commit walk
-
Built an object walk (tags, commits, trees, and blobs) from the ground up
-
Learned how to add a filter-spec to an object walk
-
Changed the display order of the filtered object walk


Methods summary
protected
SMSApi\Api\Response\StatusResponse
|
|
public
SMSApi\Proxy\Uri
|
|
public
|
#
setText( $text )
Set SMS text message.
Content of one message is normally 160 characters per single
SMS or 70 in case of using at least one special character
Parameters
Returns
$this
|
public
|
#
setEncoding( string $encoding )
Set the SMS encoding charset, default is UTF-8.
Set the SMS encoding charset, default is UTF-8.
Example:
windows-1250
iso-8859-2
Parameters
Returns
$this
|
public
|
#
setTo( string|array|integer $to )
Set mobile phone number of the recipients.
Set mobile phone number of the recipients.
Parameters
- $to
- Phone number recipient/s.
Returns
$this
|
public
|
#
setGroup( string $group )
Set name of the group from the phone book to which message should be sent.
Set name of the group from the phone book to which message should be sent.
Parameters
Returns
$this
|
public
|
#
setDateSent( mixed $date )
Set scheduled date sending message.
Set scheduled date sending message.
Setting a past date will result in sending message instantly.
Parameters
- $date
- set timestamp or ISO 8601 date format
Returns
$this
|
public
|
#
setIDx( string|array $idx )
Set optional custom value sent with SMS and sent back in CALLBACK.
Set optional custom value sent with SMS and sent back in CALLBACK.
Parameters
Returns
$this
|
public
|
#
setCheckIDx( boolean $check )
Set checking idx is unique.
Set checking idx is unique.
Prevents from sending more than one message with the same idx.
When this parameter is set and message with the same idx was
already sent error 53 is returned.
Parameters
Returns
$this
|
public
|
#
setPartner( string $partner )
Set affiliate code.
Parameters
Returns
$this
|
public
|
#
setDateExpire( integer $date )
Set expiration date.
Message expiration date (in unix timestamp) is a date after which message won't be
delivered if it wasn't delivered yet. The difference between date sent and expiration
date can't be less than 1 hour and more than 12 hours. Time will be set with
tolerance +/- 5 minutes.
Parameters
Returns
$this
|
public
|
#
setSender( string $sender )
Set name of the sender.
To send SMS as ECO use sender name ECO .
To send SMS as 2Way use sender name 2Way .
Only verified names are being accepted.
Parameters
- $sender
- sender name or eco or 2way
Returns
$this
|
public
|
#
setSingle( boolean $single )
Set protection from send multipart messages.
Set protection from send multipart messages.
If the message will contain more than 160 chars (single message) it won't be
sent and return error
Parameters
Returns
$this
|
public
|
#
setNoUnicode( boolean $noUnicode )
Set protection from sending messages containing special characters.
Set protection from sending messages containing special characters.
Parameters
- $noUnicode
- if true turn on protection
Returns
$this
|
public
|
#
setDataCoding( string $dataCoding )
Set SMS message data coding.
Set SMS message data coding.
This parameter allows to send WAP PUSH messages.
Example: bin
Parameters
Returns
$this
|
public
|
#
setFlash( boolean $flash )
Set SMS message in flash mode.
Set SMS message in flash mode.
Flash SMS are automatically presented on the mobile screen and
have to be saved to be default stored in inbox.
Parameters
Returns
$this
|
public
|
#
setNormalize( boolean $normalize )
Set normalize SMS text.
Removing dialectic characters from message.
Parameters
Returns
$this
|
public
|
#
setFast( boolean $fast )
Set higher priority of sending message.
Prohibited for bulk messages.
Set higher priority of sending message.
Prohibited for bulk messages.
Parameters
- $fast
- if true set higher priority otherwise normal priority
Returns
$this
|
public
|
#
SetParam( integer $i, string|string[] $text )
Set personalized parameters to bulk messages.
Set personalized parameters to bulk messages.
Parameters
Returns
$this
Throws
OutOfRangeException
|
public
|
#
setTemplate( $name )
Set template
Parameters
Returns
$this
|


Action QML Type
Action provides an abstract user interface action that can be bound to items More...
| Import Statement: | import QtQuick.Controls 1.4 |
Properties
- checkable : bool
- checked : bool
- enabled : bool
- exclusiveGroup : ExclusiveGroup
- iconName : string
- iconSource : url
- shortcut : keysequence
- text : string
- tooltip : string
Signals
Methods
- void trigger(QObject *source)
Detailed Description
In applications many common commands can be invoked via menus, toolbar buttons, and keyboard shortcuts. Since the user expects each command to be performed in the same way, regardless of the user interface used, it is useful to represent each command as an action.
An action can be bound to a menu item and a toolbar button, and it will automatically keep them in sync. For example, in a word processor, if the user presses a Bold toolbar button, the Bold menu item will automatically be checked.
QtQuick Controls supports actions in Button, ToolButton, and MenuItem.
... Action { id: copyAction text: "&Copy" shortcut: StandardKey.Copy iconName: "edit-copy" enabled: (!!activeFocusItem && !!activeFocusItem["copy"]) onTriggered: activeFocusItem.copy() } Action { id: cutAction text: "Cu&t" shortcut: StandardKey.Cut iconName: "edit-cut" enabled: (!!activeFocusItem && !!activeFocusItem["cut"]) onTriggered: activeFocusItem.cut() } Action { id: pasteAction text: "&Paste" shortcut: StandardKey.Paste iconName: "edit-paste" enabled: (!!activeFocusItem && !!activeFocusItem["paste"]) onTriggered: activeFocusItem.paste() } toolBar: ToolBar { RowLayout { anchors.fill: parent anchors.margins: spacing Label { text: UI.label } Item { Layout.fillWidth: true } CheckBox { id: enabler text: "Enabled" checked: true } } } menuBar: MenuBar { Menu { title: "&File" MenuItem { text: "E&xit" shortcut: StandardKey.Quit onTriggered: Qt.quit() } } Menu { title: "&Edit" visible: tabView.currentIndex == 2 MenuItem { action: cutAction } MenuItem { action: copyAction } MenuItem { action: pasteAction } } Menu { title: "&Help" MenuItem { text: "About..." onTriggered: aboutDialog.open() } } } ...
Property Documentation
Whether the menu item can be checked, or toggled. Defaults to false
.
See also checked and exclusiveGroup.
If the action is checkable, this property reflects its checked state. Defaults to false
. Its value is also false while checkable is false.
See also toggled and exclusiveGroup.
exclusiveGroup : ExclusiveGroup |
If an action is checkable, an ExclusiveGroup can be attached to it. All the actions sharing the same exclusive group become mutually exclusive selectable, meaning that only the last checked action will actually be checked.
Defaults to null
, meaning no exclusive behavior is to be expected.
Sets the icon name for the action. This will pick the icon with the given name from the current theme.
Defaults to an empty string.
Note: This property requires QApplication.
iconSource : url |
Sets the icon file or resource url for the action. Defaults to an empty URL.
Shortcut bound to the action. The keysequence can be a string or a standard key.
Defaults to an empty string.
Action { id: copyAction text: qsTr("&Copy") shortcut: StandardKey.Copy }
Text for the action. This text will show as the button text, or as title in a menu item.
Mnemonics are supported by prefixing the shortcut letter with &. For instance, "\&Open"
will bind the Alt-O
shortcut to the "Open"
menu item. Note that not all platforms support mnemonics.
Defaults to an empty string.
Tooltip to be shown when hovering the control bound to this action. Not all controls support tooltips on all platforms, especially MenuItem.
Defaults to an empty string.


The economics and finance program at Centre integrates the theory of finance with a broad background in economics within a liberal arts educational philosophy.
| Faculty Names | Pictures |
|---|---|
| David Anderson | |
| Bruce K. Johnson | |
| Maria Apostolova-Mihaylova | |
| Ravi Radhakrishnan | |
| Brian Rogers |


What channel is Aston Villa vs Liverpool on? TV and live stream information
Liverpool proved their title credentials in their comeback over Tottenham last week - but can they follow it up against Aston Villa?
by Aaron Flanagan, https://www.mirror.co.uk/authors/aaron-flanagan/Liverpool showed title-winning credentials as they bounced back from their first slip-up of the season last week.
Following a draw at Manchester United - the first time the Reds dropped points in the league - they came from a goal down to beat Tottenham at Anfield.
Now they must carry on in the same vein with a trip to Aston Villa, who are warming nicely to life back in the Premier League.
Villa’s only Premier League defeat in their past four outings has come to Manchester City and they booked their place in the Carabao Cup quarter finals, where they will also play Liverpool , in midweek.
Here is all you need to know ahead of the Premier League game…
When is the game?
The game will take place on Saturday 2nd November at 15:00 GMT.
Where is the game being played?
The game will be played at Villa Park in Birmingham, Villa's home ground.
What TV channel is the game on?
Due to the Saturday 3pm blackout, the match will not be shown in the UK.
It did not get selected to be moved for TV coverage.
Can you live stream the game?
Due to the lack of TV coverage, there is no available live stream for this match.
Betting odds
- Aston Villa: 7/1
- Draw: 17/4
- Liverpool: 4/11
Odds courtesy of thepools.com


StateConsumptionDetails(hashOfTransactionId: SecureHash, type: ConsumedStateType)
Contains information about the consuming transaction for a particular state.


Totally. Totally does.

Only your imagination my friend. Go forth!


-
Requests for Startups
www.ycombinator.com
You shouldn't start a company just because it's on this list. 1. It’s mostly here to help stimulate you to think about ideas.
-
More Video | TechCrunch
techcrunch.com
More Video | Disrupt SF 2014 - San Francisco - September 8 - 10, 2014
-
Peter Thiel: the billionaire tech entrepreneur on a mission to cheat death ...
www.telegraph.co.uk
The co-founder of PayPal and likely the most successful venture capitalist in Silicon Valley is on a mission to change the world through technology – ...
-
How to Start a Startup
startupclass.samaltman.com
CS183B is a class we’re teaching at Stanford. It’s designed to be a sort of one-class business course for people who want to start startups.
-
San Diego’s School District Now Has a Military-Grade Armored Truck | VICE ...
news.vice.com
The same federal program gave military equipment to the Ferguson, Missouri police and other cities around the country.
-
On ‘Dark Talent’, MOOCs, Universities, and Startups: An Interview with the ...
a16z.com
We’re bringing together a great group of computer science professors from around the U.S. for talks and discussion as part of our second annual ...
-
Y Combinator-Backed Clara Labs Getting Funding From Sequoia Capital | ...
techcrunch.com
Y Combinator-backed virtual assistant startup Clara Labs might be getting an infusion of cash, rumored to be in the $3-4 million range from Sequoia ...
-
Facebook Is Partnering With Stripe to Power "Buy" Button
recode.net
Stripe adds Facebook to its list of impressive partnership deals.
-
GetFeedback: Mobile-First Operator Snags $2.3 Million From Salesforce ...
www.forbes.com
While online surveys have been around for a while, it looks like the space is poised for some big changes. And GetFeedback is leading the charge. It ...
-
NASA TV
www.nasa.gov
NASA Television provides live coverage of launches, spacewalks and other mission events, as well as the latest news briefings, video files, and the ...
-
Shirzad Chamine: How to Defeat Your Internal Saboteurs | Stanford Graduate ...
www.gsb.stanford.edu
An author and executive coach trainer explains how a more positive outlook can help you reach your true potential.
-
Digital Business Technologies Dominate Gartner 2014 Emerging Technologies ...
www.forbes.com
By Hung LeHong and Jackie Fenn Gartner, Inc. Imagine this: As you leave for work in the morning, your house automatically turns down the heat and ...
-
Dreamforce '14 - Connect to your customers in a whole new way - October ...
www.salesforce.com
Learn everything you need to know about Dreamforce from this year's highlights, sessions, and registration. DF14 promises to be even more informative ...
-
Zenefits’ Leader Is Rattling an Industry, So Why Is He Stressed Out? - ...
www.nytimes.com
Parker Conrad’s start-up, Zenefits, is thought to be one of the fastest-growing companies in recent Silicon Valley history, and his investors and ...
-
Picturing the Future of Messaging: Twilio MMS Now Available on all US ...
www.twilio.com
Today, we're happy to announce newly expanded Twilio messaging capabilities. For the first time ever, you can now send and receive MMS on all US ...
-
Alibaba Now Public as It Raises $21 Billion in Biggest Tech IPO
recode.net
The Chinese e-commerce company just raised $21.8 billion and is worth more than Amazon.
-
Apple Shows Love for HTML5 with iOS 8 | Blog | Sencha
www.sencha.com
September 16, 2014 | Ross Gerbasi
-
Apple - Privacy
www.apple.com
At Apple, we respect your privacy and protect it with strong encryption, plus strict policies that govern how all data is handled.
-
Racism Masked as Sarcasm: An Open Letter to ValleyWag
raprehab.com
Racism comes in many forms. Sometimes it's blatant and in-your-face, other times, it's nuanced and cloaked in sarcasm, like ValleyWag's latest ...
-
Are VC Investors Prepared to Manage Public Company Scale in Private ...
medium.com
Now I understand why a company like Uber invites firms like Fidelity, BlackRock, and Goldman Sachs to the table.
-
You think you’ve got bills? Government could have fined Yahoo trillions of ...
www.washingtonpost.com
Proposed Justice Department fines could have bankrupted the company within a few months.
-
Development Channel » Unlocking the Potential of Women Entrepreneurs
blogs.cfr.org
This post is from Isobel Coleman, Council on Foreign Relations (CFR) senior fellow and director of the Civil Society, Markets, ...
-
Y Combinator Will Teach A Class On Startups At Stanford This Fall | ...
techcrunch.com
Startup accelerator Y Combinator is an undeniably helpful resource for entrepreneurs looking for mentorship through the tough process of building a ...
-
Burn Baby Burn – AVC
avc.com
Andy sent me a WSJ piece with Bill Gurley yesterday. I don’t like to link to paid content so here’s a good Business Insider summary of the article ...
-
Out of the Spotlight, Bitcoin Gains Legitimacy | WIRED
www.wired.com
Mainstream perception of bitcoin, much like the crypto-currency itself, has been volatile. Starting last fall and gaining steam throughout the ...
-
Can Patrick Soon-Shiong, The World's Richest Doctor, Fix Health Care?
www.forbes.com
Dr. Patrick Soon-Shiong is using a multibilliondollar war chest and massive amounts of data to fix health care and cure disease. His biggest enemy ...


Scholar's Copyright Addendum Engine
Note: Creative Commons is updating this tool and its author addendum offerings. More information may be found here https://creativecommons.org/about/program-areas/legal-tools-licenses/author-addenda/, including the latest draft of CC's author addendum, which is now open for comment.
The Scholar's Copyright Addendum Engine will help you generate a PDF form that you can attach to a journal publisher's copyright agreement to ensure that you retain certain rights.
Description
Each addendum gives you non-exclusive rights to create derivative works from your Article and to reproduce, distribute, publicly perform, and publicly display your article in connection with your teaching, conference presentations, lectures, other scholarly works, and professional activities. However, they differ with respect to how soon you can make the final published version available and whether you can authorize others to re-use your work in various ways. Below is a summary of the available options.
Creative Commons / SPARC Addendum
- Access - Reuse:
- You retain sufficient rights to grant to the reading public a Creative Commons Attribution Non Commercial license or similar license that allows the public to re-use or re-post your article so long as you are given credit as the author and so long as the reader's use is non-commercial. (This is a joint offering from Creative Commons and SPARC and represents a new version of the former SPARC Addendum.)
Other Options From Creative Commons
- Immediate Access:
- You retain sufficient rights to post a copy of the published version of your article (usually in pdf form) online immediately to a site that does not charge for access to the article. (This is similar in many ways to the MIT Copyright Amendment below)
- Delayed Access:
- You also have the right immediately to post your final version of the article, as edited after peer review, to a site that does not charge for access to the article, but you must arrange not to make the published version of your article available to the public until six months after the date of publication.
Additional Options from MIT
- MIT Copyright Amendment:
- Developed at MIT, this amendment is a tool authors can use to retain rights when assigning copyright to a publisher. It will enable authors to continue using their publications in their academic work at MIT, to deposit them into the MIT Libraries' DSpace repository, and to deposit any NIH-funded manuscripts on the National Library of Medicine's PubMed Central database. More information is available from the MIT Libraries.
Instructions for Use
(note these will be updated with the launch of the new addendum and engine)
- Enter the information requested and select the option of your choice from the menu below.
- Save the PDF addendum that is generated.
- Print the addendum, and sign and date it.
- Sign and date the publisher's agreement. Immediately below your signature on the publisher's form, write: "Subject to attached Addendum." This is very important because you want to make clear that your signature is a sign that you accept the publisher's agreement only if the publisher accepts you Addendum.
- Make a copy of all three documents (the publisher's form, your Addendum, and your cover letter) for your records.
- Staple the three original documents together.
- Mail the three original documents to the publisher.


Cluster Interface v2.0
Statistics Server Interface v2.0
Babylon5
|
Babylon5 Admin
Babylon5 CFAdmin
Stayme
|
Stayme Admin
Stayme CFAdmin
CFServer2
|
CFServer2 Admin
CFServer2 CFAdmin


This "special" web page allows you to click anywhere on the page and find out what that page's html elements are.
Let's play peek-a-boo.
What a cute walrus!
click the peek-a-boo button again to hide her


As issues move through your workflow they'll appear in the appropriate tabs on this page. Seems it's all quiet now.


Hare Krishna!
ISKCON Columbus would like to invite you and your loved ones to join us for the Sunday love feast on
05/07 starting at 11.00 AM.
Sponsored by
Sri Kalpana & Yedu Chandra Pillarigunta family
To sponsor a Sunday feast, please contact Premvilas das<EMAIL_ADDRESS>or Rama
Tirtha das (ramatirtha.rns@gmail.com).
Feast Schedule
- 11:00 AM - 11:30 AM: Bhajans
- 11:30 AM - 12:30 PM: "Pastimes of Mother Sita, Rukmini and Jahnava Devi" by HG Sundara
Mukunda das.
- 12:30 PM - 01:00 PM: Aarti & Kirtan
- 01:00 PM - 01:10 PM: Sri Narsimha Prayers.
- 01:10 PM - 01:20 PM: Announcements
- 01:20 PM: Prasadam (Vegetarian meal offered to the Lord.
Parking
Free street parking on W.8th Avenue on weekends.


This is a sound.
"specified with controls, audioControl bar present"
Audio element not supported by your browser.


Interface for caching
Located in /template/Cache.php (line 8)
| Class | Description |
|---|---|
| CacheFile | Class to cache files |
Constructor
Cache the current value.
Get the cached file.
Is the cache available?
Documentation generated on Wed, 10 Mar 2010 08:31:18 -0800 by phpDocumentor 1.4.3


{{>includes/help}}
Payment unsuccessful
There has been a problem.
No money has been taken from your account.
The online service has been unable to process your payment at this time.
What happens next?- Try again
- Make a payment by calling 0345 345 900
- Alternatively please check other ways to pay


Sign-out
Total Number of Users
Total Number of Sold Cars
Total Number of Unsold Cars
20
3
3
View More
View More
View More


{{#yaml}}{{{footer}}}{{^footer}}{{#package}}{{name}}{{/package}} is a part of . Learn more at ropensci.org.{{/footer}}{{/yaml}}
Developed by {{#package}}{{{authors}}}{{/package}}. Site built by pkgdown & rotemplate.


The FileToVector, FileToMatrix, and FileToHashMap objects read data contained in a file.
The DataFile keyword specifies the file to be read. The data must be delimited by either spaces or tabs (but NOT commas), and can consist of any mixture of numbers (with or without units), strings, objects, arrays, maps, and lambda functions. An entry that contains spaces must be enclosed by single quotes.
An entry can be given in expression format or it can take advantage of rules that allow a somewhat simpler format. The following table gives some examples of valid data entries:
Data File Entries
|
Entry |
Rule |
Examples |
|
Comment |
Records that begin with a # symbol are ignored. |
# This is a comment |
|
Number |
Numbers are entered in expression format. |
1.0
1.0[m]
'1.0 [m]' |
|
Time Stamp |
Time stamps can be entered as either: 'YYYY-MM-DD HH:MM:SS.SSS' or YYYY-MM-DDTHH:MM:SS.SSS See Table 4‑14 for more details. |
'0000-01-02 06:24:00.0'
0000-01-02T06:24:00.0 |
|
Object |
Object names can be entered with or without square brackets
|
[Server1]
Server1 |
|
Array |
Arrays are entered in expression format. They must be enclosed by single quotes.
|
'{1,2,3}'
'{1, 2, 3}' |
|
String |
Any entry that cannot be interpreted as a valid number, object, or array is treated as a string.
|
'"Quick red fox"'
'Quick red fox'
Quick_red_fox |
When JaamSim is executed from the API, the DataFile input can be replaced by a call to the setValue method for this object, which populates the data directly.
The data read from the file is made available to the model through an output named Value. The two objects differ in the type of data returned by this output:
· FileToVector: the Value output returns a single array combining all the records in the file.
· FileToMatrix: the Value output returns an array of arrays, with one internal array for each record that was read.
· FileToHashMap: the Value output returns a map with the first entry in each line of the file treated as the key and with the corresponding value consisting of the remaining entries collected as an array.
The data file is first read when the simulation is started. It is re-read and the Value output updated whenever the object receives an entity.


Home
Indigenous Australians
Monash is committed to fostering a society that respects Aboriginal and Torres Strait Islander peoples, cultures and knowledges, and works towards addressing the legacies of the past.
Monash is committed to fostering a society that respects Aboriginal and Torres Strait Islander peoples, cultures and knowledges, and works towards addressing the legacies of the past.


This package allows to use the hybrid Multinomial-Dirichlet-Model of Ecological Inference for estimating inner Cells of RxC-Tables. This was already implemented in the eiPack-package. eiwild-package now has the possibility to use individual level data to support the aggregate level data and using different Hyperpriori-Distributions.
| Version: | 0.6.7 |
| Depends: | R (≥ 2.15) |
| Imports: | gtools, coda, lattice |
| Published: | 2014-03-06 |
| Author: | Thomas Schlesinger |
| Maintainer: | Thomas Schlesinger <tho.schlesinger at gmail.com> |
| License: | GPL-3 |
| URL: | http://CRAN.R-project.org/package=eiwild |
| NeedsCompilation: | yes |
| Materials: | NEWS |
| CRAN checks: | eiwild results |
| Reference manual: | eiwild.pdf |
| Package source: | eiwild_0.6.7.tar.gz |
| Windows binaries: | r-devel: eiwild_0.6.7.zip, r-release: eiwild_0.6.7.zip, r-oldrel: eiwild_0.6.7.zip |
| OS X binaries: | r-release: eiwild_0.6.7.tgz, r-oldrel: eiwild_0.6.7.tgz |
| Old sources: | eiwild archive |
Please use the canonical form https://CRAN.R-project.org/package=eiwild to link to this page.


Konnect247
Confirmation Number: {{conf}}
✔ Thanks, {{Name}}
Your Booking in Konnect is Confrimed
✔ Daisy Veroni is expecting you on {{Arrival}}
✔ Your payment will be handled by Daisy veroni.
✔ You can cancel for FREE until before two days of Reservation.
Your Reservation{{Nights}} nights, 1 room
Check-in{{Arrival}}
Check-out{{Departure}}
PrepaymentYou'll be charged a prepayment of the first night after reservation.
Cancellation cost
- Until two day Before reservation in[Konnect]: $ 0
- Until one day Before reservation in[Konnect]: $ 25
Room Details:
This room has a shared bathroom, a wardrobe and some of them have a toilet.
Guest name {{Name}}
Number of guests Max. of 2 Adults and Max. of 2 Children
Meal Plan No meal is included in this room rate.
The cancellation policy for group reservation is as under:
Booking cancelled within 60 days of confirmation retention will not be charged.
Booking cancelled after 60 days of confirmation one day retention will be charged for all the rooms confirmed.
The no of rooms cancelled two weeks prior to the conference full retention for the entire period of booking will be charged.
Thanks and Regards,
Reservation Agent


1.CUSTOMER QUOTE MANAGER:
The Customer Quote Manager allows users to view, edit, create and sort Customer Quotes and invoices.
This subsystem will allow employees to create a final quotation for a customer.
Users can enter product details, alter prices, add a discount as well as print quotations or invoices
Customer Quote Line Items prices are chosen from Supplier Quote prices.


--- creation_epoch:<PHONE_NUMBER> lastmod_epoch:<PHONE_NUMBER> categories: ['Computer Problems'] title: MySQL, -p, and no space between password --- So for the mysql command line utilities (ex: mysqldump) you can specify the password on the command-line with -pPASSWORD or --password=PASSWORD. You cannot have a space in between like "-p PASSWORD".
I was wondering why and found the following bug report that explains it. In short the password value is optional since -p alone means prompt the user for the password. Most other utilities use something like "-p -" to indicate prompt from STDIN for the password. MySQL does not.
One shouldn't pass the password on the command-line anyway. You're better off putting it in a mysql.ini and securing the file instead if you need it for automation.


Widowmaker equips herself with whatever it takes to eliminate her targets, including mines that dispense poisonous gas, a visor that grants her squad infra-sight, and a powerful sniper rifle that can fire in fully-automatic mode.
Widowmaker’s versatile sniper rifle is ideal for scope-aimed shots at distant targets. Should targets close to medium range, the rifle can also be fired in fully-automatic mode.
Widowmaker launches a grappling hook towards the location she’s aiming at – when the hook connects with a scalable surface, she’s quickly drawn towards it, allowing her to expand her view of the battlefield and evade or flank targets.
Widowmaker adheres a swiftly-arming venom mine to nearly any surface. When a target wanders within range of the mine’s motion trigger, it explodes, delivering poison gas to any enemies in the vicinity.
Widowmaker’s recon visor allows her to see the heat signatures of her targets through walls and objects for a moderate amount of time. This enhanced vision is shared with her allies.


Tags appear simply as a tag name — no delimiters, no nothing.
| This SweetXML... | ...is equivalent to this XML. |
|---|---|
| tag another-tag | <tag/> <another-tag/> |
Indentation determines nesting.
| rivers mississippi poudre north-fork lakes superior calhoun | <rivers> <mississippi/> <poudre> <north-fork/> </poudre> </rivers> <lakes> <superior/> <calhoun/> </lakes> |
SweetXML requires consistent indentation. Be careful of tabs! If different lines are indented with different mixtures of tabs and spaces, SweetXML will give a parse error. If your text editor allows it, it is best to avoid confusion by using soft tabs (i.e. no actual tab characters, only spaces).
Each tag appear on a line by itself. There is currently no syntax that allows multiple tags on the same line. Exploration of this feature is in the roadmap.
Attributes follow a tag on the same line, in the form name="value"
(either double or single quotes work):
| pet type="budgie" name="Pegasus" pet type='dog' name='Goulash' | <pet type="budgie" name="Pegasus"/> <pet type="dog" name="Goulash"/> |
If the attribute value contains only letters, numbers, dashes, periods, and underscores, then the quotes are optional:
| pet type=cat name=Luke status=very_clumsy pet type=cat name="Mr. Man" | <pet type="cat" name="Luke" status="very_clumsy"/> <pet type="cat" name="Mr. Man"/> |
Note that the attribute value "Mr. Man"
requires quotes because it contains a space.
You can split a tag across multiple lines with a vertical bar:
| pet | type="cat" | name="Luke" | color="black" | size="large" | likable="very" | clumsy="very" | <pet type="cat" name="Luke" color="black" size="large" likable="very" clumsy="very" /> |
Note that the attribute value "Mr. Man"
requires quotes because it contains a space.
Text appears in quotes on a line by itself.
| name "Pogo Possum" | <name>Pogo Possum</name> |
Quoted text can span multiple lines. White space (including line breaks) is preserved if and only if it is inside quotes.
| name "Pogo" "Possum" description "Inhabitant of Okefenokee Swamp, and star of the comic strip of the same name." | <name>PogoPossum</name> <description>Inhabitant of Okefenokee Swamp, and star of the comic strip of the same name.</description> |
Quotes inside quoted text can be escaped using the usual XML entities. (Entities have exactly the same syntax in SweetXML.)
| name: "Hayao "Ghibli" Miyazaki" remark: 'We're making a mystery here, so make it mysterious.' | <name>Hayao "Ghibli" Miyazaki</name> <remark>We're making a mystery here, so make it mysterious.</remark> |
Note that you can often avoid the need for escaping by using single instead of double quotes or vice versa.
| name: 'Hayao "Ghibli" Miyazaki' remark: "We're making a mystery here, so make it mysterious." | <name>Hayao "Ghibli" Miyazaki</name> <remark>We're making a mystery here, so make it mysterious.</remark> |
Text nested inside a tag may appear on the same line as the tag when preceded by a colon.
| name: "Pogo Possum" | <name>Pogo Possum</name> |
When text appears after a colon, the quotes are optional if the text contains only letters, numbers, dashes, periods, and underscores.
| name: "Pogo Possum" species: opossum | <name>Pogo Possum</name> <species>opossum</species> |
Note that quotes are optional only when the text follow a colon. If text appears on a line by itself, quotes are always required. Without quotes, SweetXML will see a tag, not text.
| marco "polo" marco polo | <marco>polo</marco> <marco> <polo/> </marco> |
A #
character makes the remainder of the line a comment.
| # here follows a name name : "Harold J. Smooter" # not a real name | <!--here follows a name--> <name>Harold J. Smooter <!--not a real name--> </name> |
Entities have exactly the same syntax as in XML.
| &foo; | &foo; |
Because the colon is already used for inline text, namespaces use a slash:
| document | xmlns/xsi="..." | xsi/schemaLocation="..." | <document xmlns:xsi="..." xsi:schemaLocation="..."> |
SweetXML documents have no place to specify a version number or encoding. Consideration of this feature is in the roadmap.
SweetXML is not particularly concerned with features of XML other than the document body itself. It does not address validation and transformation in any special way.
You can specify a DOCTYPE at the beginning of your document, using exactly the same syntax as XML. Line breaks and indentation in the DOCTYPE are not significant.
| <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> hibernate-configuration session-factory ... | <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> ... |
This is the complete syntax of SweetXML.
Check out the examples to see how it all fits together.