<?xml version="1.0" encoding="UTF-8"?>
<feed
  xmlns="http://www.w3.org/2005/Atom"
  xmlns:thr="http://purl.org/syndication/thread/1.0"
  xml:lang="en"
   >
  <title type="text">Where am I?</title>
  <subtitle type="text">Performance, scalability, databases, and whatever comes up.</subtitle>

  <updated>2013-02-09T01:13:19Z</updated>
  <generator uri="http://blogofile.com/">Blogofile</generator>

  <link rel="alternate" type="text/html" href="http://blakeley.com/blogofile" />
  <id>http://blakeley.com/blogofile/feed/atom/</id>
  <link rel="self" type="application/atom+xml" href="http://blakeley.com/blogofile/feed/atom/" />
  <entry>
    <author>
      <name></name>
      <uri>http://blakeley.com/blogofile</uri>
    </author>
    <title type="html"><![CDATA[External Variables (Code Review, Part II)]]></title>
    <link rel="alternate" type="text/html" href="http://blakeley.com/blogofile/2012/09/28/external-variables-(code-review,-part-ii)" />
    <id>http://blakeley.com/blogofile/2012/09/28/external-variables-(code-review,-part-ii)</id>
    <updated>2012-09-28T12:34:56Z</updated>
    <published>2012-09-28T12:34:56Z</published>
    <category scheme="http://blakeley.com/blogofile" term="XQuery" />
    <category scheme="http://blakeley.com/blogofile" term="MarkLogic" />
    <summary type="html"><![CDATA[External Variables (Code Review, Part II)]]></summary>
    <content type="html" xml:base="http://blakeley.com/blogofile/2012/09/28/external-variables-(code-review,-part-ii)"><![CDATA[<p>Remember when I talked about <a href="/blogofile/archives/518">XQuery Code Review</a>?
The other day I was forwarding that link to a client,
and noticed that I forgot to mention external variables.
I talked about <code>xdmp:eval</code> and <code>xdmp:value</code>
in the section titled <em>Look_for_injection_paths</em>,
and mentioned that it's usually better to use <code>xdmp:invoke</code> or <code>xdmp:unpath</code>,
which are less vulnerable to injection attacks.</p>
<p>But it can be convenient or even necessary to evaluate dynamic XQuery.
That's what <code>xdmp:eval</code> and <code>xdmp:value</code> are there for, after all.
I've even written tools like <a href="http://github.com/mblakele/presta">Presta</a>
to help you.</p>
<p>Used properly, dynamic queries can be made safe.
The trick is to <strong>never</strong> let user data directly into your dynamic queries.
Whenever you see <code>xdmp:eval</code> or <code>xdmp:value</code> in XQuery,
ask yourself "Where did this query comes from?"
If any part of it came from user input, flag it for a rewrite.</p>
<pre><code>(: WRONG - This code is vulnerable to an injection attack! :)
xdmp:eval(
  concat('doc("', xdmp:get-request-field('uri'), '")'))
</code></pre>
<p>Actually there are at least two bugs in this code.
There is a functional problem: what happens if the <code>uri</code> request field
is <code>fubar-"baz"</code>? You might not expect a uri to include a quote,
and maybe that will never legitimately happen in your application.
But if that request-field does arrive, <code>xdmp:value</code> will throw an error:</p>
<pre><code>XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error
</code></pre>
<p>That's because you haven't properly escaped the uri in the dynamic XQuery.
And you could escape it. You could even write a function to do that for you.
But if you miss any of the various characters that need escaping,
<code>XDMP-UNEXPECTED</code> will be there, waiting for you.</p>
<p>So far we've only talked about innocent mistakes. But what if someone out there
is actively hostile? Let's say it's me. If I know that your web service
expects a <code>uri</code> request-field, I might guess that your code looks something like
the code above, and try an injection attack.</p>
<p>After a little trial and error, I might find that sending
<code>uri=x"),cts:uris(),("</code> returns a list of all the documents in your database,
whether you want me to see them or not. Then I can send something like
<code>uri=x"),xdmp:document-delete("fubar</code>. If that document exists,
and security isn't tight... it's gone. Or maybe I will decide to try
<code>xdmp:forest-clear</code> instead.</p>
<p>In SQL we use bind variables to solve both of these problems.
Any user input binds to a variable inside the SQL,
and the database driver takes care of escaping for us.
We no longer have to worry about obscure syntax errors or injection attacks,
as long as we remember to use variable for all externally-supplied parameters.
In XQuery these are known as external variables.</p>
<pre><code>(: Always use external variables for user-supplied data. :)
xdmp:eval(
  'declare variable $URI as xs:string external ;
   doc($URI)',
  (xs:QName('URI'), xdmp:get-request-field('uri')))
</code></pre>
<p>The syntax is a little odd: that second parameter is a sequence of
alternating QName and value. Because XQuery doesn't support nested sequences,
this means you can't naively bind a sequence to a value.
Instead you can pass in XML or a map,
or use a convention like comma-separated values (CSV).</p>
<pre><code>(: Using XML to bind a sequence to an external variable. :)
xdmp:eval(
  'declare variable $URI-LIST as element(uri-list) external ;
   doc($URI-LIST/uri)',
  (xs:QName('URI-LIST'),
   element uri-list {
     for $uri in xdmp:get-request-field('uri')
     return element uri { $uri } }))
</code></pre>
<p>Even though these examples all use pure XQuery, this code review principle
also applies to XCC code. If you see a Java or .NET program using <code>AdHocQuery</code>,
check to make sure that all user input binds to variables.</p>
<p>Remember, the best time to fix a potential security problem
is <strong>before</strong> the code goes live.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://blakeley.com/blogofile</uri>
    </author>
    <title type="html"><![CDATA[AlbumMixer v1.13]]></title>
    <link rel="alternate" type="text/html" href="http://blakeley.com/blogofile/2012/06/13/albummixer-v1.13" />
    <id>http://blakeley.com/blogofile/2012/06/13/albummixer-v1.13</id>
    <updated>2012-06-13T13:26:52Z</updated>
    <published>2012-06-13T13:26:52Z</published>
    <category scheme="http://blakeley.com/blogofile" term="iOS" />
    <summary type="html"><![CDATA[AlbumMixer v1.13]]></summary>
    <content type="html" xml:base="http://blakeley.com/blogofile/2012/06/13/albummixer-v1.13"><![CDATA[<p><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=329552764">AlbumMixer v1.13</a>
fixes a minor bug where the player display would look odd
when tracks were missing some metadata.</p>
<p>If you see any problems with this release,
please use <code>Settings &gt; Report a Problem</code> from within the app.
I will also read comments posted here.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://blakeley.com/blogofile</uri>
    </author>
    <title type="html"><![CDATA[rsyslog and MarkLogic]]></title>
    <link rel="alternate" type="text/html" href="http://blakeley.com/blogofile/2012/05/17/rsyslog-and-marklogic" />
    <id>http://blakeley.com/blogofile/2012/05/17/rsyslog-and-marklogic</id>
    <updated>2012-05-17T18:00:01Z</updated>
    <published>2012-05-17T18:00:01Z</published>
    <category scheme="http://blakeley.com/blogofile" term="MarkLogic" />
    <category scheme="http://blakeley.com/blogofile" term="Linux" />
    <summary type="html"><![CDATA[rsyslog and MarkLogic]]></summary>
    <content type="html" xml:base="http://blakeley.com/blogofile/2012/05/17/rsyslog-and-marklogic"><![CDATA[<p>You probably know that MarkLogic Server logs important events
to the <code>ErrorLog.txt</code> file. By default it logs events at <code>INFO</code> or higher,
but many development and staging environments change the <code>file-log-level</code>
to <code>DEBUG</code>. These log levels are also available to the <code>xdmp:log</code> function,
and some of your XQuery code might use that for <code>printf</code>-style debugging.</p>
<p>You might even know that MarkLogic also sends important events
to the operating system. On linux this means <code>syslog</code>, and important events
are those at <code>NOTICE</code> and higher by default.</p>
<p>But are you monitoring these events?</p>
<p>How can you set up your MarkLogic deployment so that it will automatically
alert you to errors, warnings, or other important events?</p>
<p>Most linux deployments now use <code>rsyslog</code> as their system logging facility.
The <a href="http://www.rsyslog.com/doc/manual.html">full documentation</a> is available,
but this brief tutorial will show you how to set up email alerts for MarkLogic
using <code>rsyslog</code> version 4.2.6.</p>
<p>All configuration happens in <code>/etc/rsyslog.conf</code>.
Here is a sample of what we need for email alerts.
First, at the top of the file you should see several <code>ModLoad</code> declarations.
Check for <code>ommail</code> and add it if needed.</p>
<pre><code>$ModLoad ommail.so  # email support
</code></pre>
<p>Next, add a stanza for MarkLogic somewhere after the <code>ModLoad</code> declaration.</p>
<pre><code># MarkLogic
$template MarkLogicSubject,"Problem with MarkLogic on %hostname%"
$template MarkLogicBody,"rsyslog message from MarkLogic:\r\n[%timestamp%] %app-name% %pri-text%:%msg%"
$ActionMailSMTPServer 127.0.0.1
$ActionMailFrom your-address@your-domain
$ActionMailTo your-address@your-domain
$ActionMailSubject MarkLogicSubject
#$ActionExecOnlyOnceEveryInterval 3600
daemon.notice   :ommail:;MarkLogicBody
</code></pre>
<p>Be sure to replace both instances of <code>your-address@your-domain</code>
with an appropriate value. The ActionMailSMTPServer must be smart enough
to deliver email to that address. I used a default <code>sendmail</code> configuration
on the local host, but you might choose to connect to a different host.</p>
<p>Note that I have commented out the <code>ActionExecOnlyOnceEveryInterval</code> option.
The author of <code>rsyslog</code>, <a href="http://www.gerhards.net/rainer">Rainer Gerhards</a>,
recommends setting this value to a reasonably high number of seconds
so that your email inbox is not flooded with messages.
However, the <code>rsyslog</code> documentation states that excess messages
are discarded, and I did not want to loose any important messages.
What I would really like to do is buffer messages for N seconds at a time,
and merge them together in one email.
But while <code>rsyslog</code> has many features, and does offer buffering,
it does not seem to know how to combine consecutive messages
into a single email.</p>
<p>Getting back to what <code>rsyslog</code> <em>can</em> do,
you can customize the subject and body of the mail message.
With the configuration above, a restart of the server
might send you an email like this one:</p>
<pre><code>Subject: Problem with MarkLogic on myhostname.mydomain

rsyslog message from MarkLogic:
[May 17 23:58:36] MarkLogic daemon.notice&lt;29&gt;: Starting MarkLogic Server 5.0-3 i686 in /opt/MarkLogic with data in /var/opt/MarkLogic
</code></pre>
<p>When making any <code>rsyslog</code> changes, be sure to restart the service:</p>
<pre><code>sudo service rsyslog restart
</code></pre>
<p>At the same time, check your system log for any errors or typos.
This is usually <code>/var/log/messages</code> or <code>/var/log/syslog</code>.
The full documentation for <a href="http://www.rsyslog.com/doc/property_replacer.html">template substitution properties
</a> is online.
You can also read about a wealth of other options available in <code>rsyslog</code>.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://blakeley.com/blogofile</uri>
    </author>
    <title type="html"><![CDATA[AlbumMixer v1.12]]></title>
    <link rel="alternate" type="text/html" href="http://blakeley.com/blogofile/2012/05/16/albummixer-v1.12" />
    <id>http://blakeley.com/blogofile/2012/05/16/albummixer-v1.12</id>
    <updated>2012-05-16T10:40:00Z</updated>
    <published>2012-05-16T10:40:00Z</published>
    <category scheme="http://blakeley.com/blogofile" term="iOS" />
    <summary type="html"><![CDATA[AlbumMixer v1.12]]></summary>
    <content type="html" xml:base="http://blakeley.com/blogofile/2012/05/16/albummixer-v1.12"><![CDATA[<p><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=329552764">AlbumMixer v1.12</a>
fixes a minor bug where the player state would be wrong
when returning from background mode.</p>
<p>If you see any problems with this release,
please use <code>Settings &gt; Report a Problem</code> from within the app.
I will also read comments posted here.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://blakeley.com/blogofile</uri>
    </author>
    <title type="html"><![CDATA[AlbumMixer v1.11]]></title>
    <link rel="alternate" type="text/html" href="http://blakeley.com/blogofile/2012/03/30/albummixer-v1.11" />
    <id>http://blakeley.com/blogofile/2012/03/30/albummixer-v1.11</id>
    <updated>2012-03-30T12:34:56Z</updated>
    <published>2012-03-30T12:34:56Z</published>
    <category scheme="http://blakeley.com/blogofile" term="iOS" />
    <summary type="html"><![CDATA[AlbumMixer v1.11]]></summary>
    <content type="html" xml:base="http://blakeley.com/blogofile/2012/03/30/albummixer-v1.11"><![CDATA[<p>AlbumMixer v1.11 fixes some minor bugs,
and should be better behaved with iTunes Match.
If you see any problems with this release,
please use <code>Settings &gt; Report a Problem</code> from within the app.
I will also read comments posted here.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://blakeley.com/blogofile</uri>
    </author>
    <title type="html"><![CDATA[Directory Assistance]]></title>
    <link rel="alternate" type="text/html" href="http://blakeley.com/blogofile/2012/03/19/directory-assistance" />
    <id>http://blakeley.com/blogofile/2012/03/19/directory-assistance</id>
    <updated>2012-03-19T12:34:56Z</updated>
    <published>2012-03-19T12:34:56Z</published>
    <category scheme="http://blakeley.com/blogofile" term="MarkLogic" />
    <summary type="html"><![CDATA[Directory Assistance]]></summary>
    <content type="html" xml:base="http://blakeley.com/blogofile/2012/03/19/directory-assistance"><![CDATA[<p>For a long time now, MarkLogic Server has implemented two distinct features
that are both called "directories". This causes confusion, especially since one
of these features scales well and the other often causes scalability problems.
Let's try to distinguish between these two features,
and talk about why they both exist.</p>
<p>Directories were first introduced to accommodate WebDAV.
Since WebDAV clients treat the database as if it were a filesystem,
they expect document URIs with the solidus, or <code>/</code>,
to imply directory structure. That's one feature called "directories":
if you insert a document with the URI <code>/a/b/c.xml</code>, you can call
<code>xdmp:directory('/a/b/', '1')</code> to select that document -
and any other document with the same URI prefix. These URI prefixes
are indexed in much the same way that document URIs and collection URIs
are indexed, so queries are "searchable" and scale well.</p>
<p>This "implied directory structure" works with any database configuration.
You do not need <code>directory-creation=automatic</code>
to use the <code>cts:directory-query</code> and <code>xdmp:directory</code> functions.</p>
<script src="https://gist.github.com/2127471.js?file=gistfile1.xq"></script>

<p>This returns a query plan in XML:</p>
<script src="https://gist.github.com/2127484.js?file=gistfile1.xml"></script>

<p>But WebDAV clients expect more than just directory listings.
They also want to lock documents and directories.
It is easy to understand document locking: the idea here is that
a WebDAV-aware editor might lock a document, copy it to the local filesystem
for editing, and copy it back to the server when the editing session ends.
It may be less clear that a WebDAV client sometimes needs to lock directories,
but it does.</p>
<p>Directory locking is implemented using special directory fragments.
There are no documents associated with these properties,
so they are sometimes called "naked properties."
Here is an example.</p>
<script src="https://gist.github.com/2127498.js?file=gistfile1.xq"></script>

<p>Once this update has committed to the database,
we can query the directory fragment.</p>
<script src="https://gist.github.com/2127503.js?file=gistfile1.xq"></script>

<script src="https://gist.github.com/2127509.js?file=gistfile1.xml"></script>

<p>Once you have a directory fragment, you have something that the database
can lock for WebDAV clients. It's rare for anything else
to use this behavior, but <code>xdmp:lock-acquire</code> is available for custom
content management applications.</p>
<p>Earlier I mentioned that there are two kinds of "directories",
one that scales well and one that sometimes causes problems.
I wrote that queries based on directory URIs scale well,
so you might guess that directory fragments sometimes cause problems.
That's correct, and it results from a database feature called
"automatic directory creation".</p>
<p>When automatic directory creation is enabled - as it is by default -
the database will ensure that directory fragments exist for every
implied directory in the URI for every new or updated document.
The document URI <code>/a/b/c.xml</code> implies a directory fragment
for <code>/</code>, <code>/a/</code>, and <code>/a/b/</code>. So the database will ensure that these exist
whenever a request updates <code>/a/b/c.xml</code>.</p>
<p>So what happens when one request updates <code>/a/b/c.xml</code>
and another request updates <code>/a/b/d.xml</code>?</p>
<p>Both requests try to ensure that there are directory fragments
for <code>/</code>, <code>/a/</code>, and <code>/a/b/</code>. This causes lock contention.
The same problem shows up if another request is updating <code>/fubar.xml</code>,
because both queries look for the <code>/</code> directory fragment.
The situation gets worse as concurrency increases.
It gets even worse if "maintain directory last-modified" is enabled,
because the directory fragments have to be updated too.
But happily that feature is not enabled by default.</p>
<p>The solution to this problem is simple. In my experience
at least 80% of MarkLogic Server customers do not use WebDAV,
so they do not need automatic directory creation. Instead,
they can set directory creation to "manual".
Do this whenever you create a new database,
or script it using <code>admin:database-set-directory-creation</code>.</p>
<p><img alt="admin UI screen shot" src="/blogofile/images/0109.directory-assistance.admin-UI.png" title="setting directory creation in the admin UI" /></p>
<p>If you do use WebDAV, try to limit its scope. Perhaps you can get by
with a limited number of predefined WebDAV directories,
which you create manually using <code>xdmp:directory-create</code>
as part of your application deployment.
Or perhaps you only use WebDAV for your XQuery modules,
which only contains a few hundred or at most a few thousand documents.
In that case you can use automatic directory creation without a problem.</p>
<p>Generally speaking, really large databases don't use WebDAV anyway.
"Big content" databases, with hundreds of millions or billions of documents,
tend to be much to large for WebDAV to be useful.
For smaller databases where WebDAV is useful,
automatic directory creation is fine.</p>
<p>Sometimes it is useful to set "directory-creation" to "manual-enforced".
With this configuration you will see an <code>XDMP-PARENTDIR</code> error
whenever your code tries to insert a document
with an implied directory structure
that does not have corresponding directory fragments.
But this feature is rarely used.</p>
<p>To sum up, directory URIs are highly scalable and very useful,
and are always indexed. Your code can call <code>xdmp:directory</code>
with any database settings.
The default "automatic directory creation" feature creates directory fragments,
which can be a bottleneck for large databases.
Most applications are better off with "directory-creation" set to "manual".</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://blakeley.com/blogofile</uri>
    </author>
    <title type="html"><![CDATA[Let-free Style and Streaming]]></title>
    <link rel="alternate" type="text/html" href="http://blakeley.com/blogofile/2012/03/19/let-free-style-and-streaming" />
    <id>http://blakeley.com/blogofile/2012/03/19/let-free-style-and-streaming</id>
    <updated>2012-03-19T12:34:56Z</updated>
    <published>2012-03-19T12:34:56Z</published>
    <category scheme="http://blakeley.com/blogofile" term="XQuery" />
    <category scheme="http://blakeley.com/blogofile" term="MarkLogic" />
    <summary type="html"><![CDATA[Let-free Style and Streaming]]></summary>
    <content type="html" xml:base="http://blakeley.com/blogofile/2012/03/19/let-free-style-and-streaming"><![CDATA[<p>If you are familiar with Lisp or Scheme, you know that a function call can
replace a variable binding, and function calls can also replace most loops.
This is also true in XQuery.</p>
<script src="https://gist.github.com/2127325.js?file=gistfile1.xq"></script>

<script src="https://gist.github.com/2127351.js?file=gistfile1.txt"></script>

<p>In XQuery this leads to a style of coding that I call "let-free".
In this style, there are no FLWOR expressions.
Really this is "FLWOR-free", not "let-free",
but that's too much of a mouthful for me.</p>
<p>But why would you write let-free code?</p>
<p>The answer is scalability - you knew it would be, right?
This breaks out into concurrency and streaming.
Let's talk about concurrency first.
In the MarkLogic Server implementation of XQuery,
every <code>let</code> is evaluated in sequence. However, other expressions
are evaluated lazily with concurrency-friendly "future values".
So a performance-critical single-threaded request can sometimes
benefit from let-free style. You can see this technique in use
in some of my code:
the <a href="github.com/marklogic/semantic">semantic library</a>
or the <a href="github.com/mblakele/task-rebalancer">task-server forest rebalancer</a>.
Both of these projects try to benefit from multi-core CPUs.</p>
<p>The let-free style can also help with query scalability
by allowing the results to stream,
rather than buffering the entire result sequence.
If you need to export large result sets, for example,
this technique can help avoid <code>XDMP-EXPNTREECACHEFULL</code> errors.
Those errors result when your query's working set is too large
to fit in the expanded tree cache, a sort of scratch space for XML trees.
But streaming results don't have to fit into the cache.</p>
<p>For example, let's suppose you need to list every document URI in the database.
But you do not have the URI lexicon enabled,
and you cannot reindex to create it.</p>
<script src="https://gist.github.com/2127363.js?file=gistfile1.xq"></script>

<script src="https://gist.github.com/2127371.js?file=gistfile1.xq"></script>

<p>Note that nested evaluations cannot stream, either. So even a let-free query
may throw XDMP-EXPNTREECACHEFULL in cq or another development tool.
To test this query, use an http module instead.
This is ideal for web service implementations too.</p>
<p>In this example we used function mapping, a MarkLogic extension to XQuery 1.0.
If a function takes a single argument but is called using a sequence,
the evaluator simply maps the sequence to multiple function calls.
This is somewhat faster than a FLWOR, and it can stream.</p>
<p>Besides using function mapping, let-free style can use XPath steps.
However, this technique only works for sequences of nodes.</p>
<script src="https://gist.github.com/2127388.js?file=gistfile1.xq"></script>

<p>While these techniques are useful, they can make for code that is
hard to read and tricky to debug. Function mapping is especially prone to errors
that are difficult to diagnose. If a function signature specifies an argument
without a quantifier or with the <code>+</code> quantifier,
and the runtime argument is empty, the function will not be called at all.
This is surprising, since normally the function would be called
and would cause a strong typing error.</p>
<script src="https://gist.github.com/2127394.js?file=gistfile1.xq"></script>

<script src="https://gist.github.com/2127403.js?file=gistfile1.xq"></script>

<p>The first expression returns the empty sequence,
while the second throws the expected strong typing error <code>XDMP-AS</code>.
This behavior is annoying, but in some applications
the benefits of function mapping outweigh this drawback.
We can make debugging easier if we weaken the function signature
to <code>document-node()?</code> so that the function will be called
even when the argument is empty. If needed, we can include an explicit check
for empty input too.</p>
<p>Another let-free trick is to use module variables.
These act much like <code>let</code> bindings, but they can stream.</p>
<script src="https://gist.github.com/2127416.js?file=gistfile1.xq"></script>

<p>This example is a bit contrived, since the module variable doesn't add anything.
But if you find yourself struggling to refactor a <code>let</code> as a function call
or an XPath step, consider using a module variable.
Module variables are also excellent tools for avoiding repeated work,
since the right-hand expression is evaluated lazily and is never
evaluated more than once. If the evaluation does not use the module variable,
then the right-hand expression is never evaluated.
In contrast, the right-expression of a <code>let</code> is evaluated
even when the <code>return</code> does not use its value.</p>
<p>As always, do not optimize code unless there is a problem to solve.
There are also some situations where the let-free style isn't appropriate.
Aside from making your code harder to read and more difficult to debug,
let-free style simply doesn't work in situations where your FLWOR
would have an <code>order by</code> clause.
And after all, streaming won't work for that case anyway.
The evaluator can't sort the result set without buffering it first.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://blakeley.com/blogofile</uri>
    </author>
    <title type="html"><![CDATA[MrCombo v1.1]]></title>
    <link rel="alternate" type="text/html" href="http://blakeley.com/blogofile/2012/01/07/mrcombo-v1.1" />
    <id>http://blakeley.com/blogofile/2012/01/07/mrcombo-v1.1</id>
    <updated>2012-01-07T11:00:00Z</updated>
    <published>2012-01-07T11:00:00Z</published>
    <category scheme="http://blakeley.com/blogofile" term="iOS" />
    <summary type="html"><![CDATA[MrCombo v1.1]]></summary>
    <content type="html" xml:base="http://blakeley.com/blogofile/2012/01/07/mrcombo-v1.1"><![CDATA[<p>MrCombo v1.1 is now available in the iOS App Store.
As with v1.0, this app lets you build lists in a two-level hierarchy:
<code>combo &gt; group &gt; item</code>. Then MrCombo can shuffle your items to create a mix.
Sample data includes ordering a pizza, picking an outfit,
and picking a traditional shave with a double-edge (DE) razor.
These are samples: edit them, or create your own combinations.</p>
<p>New features in v1.1 include:</p>
<ul>
<li>Lock items in a mix, so you can have partly-random mixes.</li>
<li>Save a mix to your local history.</li>
<li>Attach a photo to a saved mix.</li>
<li>Share saved mixes via clipboard, email, or WordPress.</li>
<li>Bulk add several items at once into a group.</li>
<li>Import and export combos to the clipboard.</li>
<li>Import and export combos to Dropbox.</li>
</ul>
<p>For now MrCombo is free, but if I keep adding more features that may change.</p>
<p>You can <a href="/ios/mrcombo">read more about MrCombo</a>
or <a href="http://itunes.apple.com/us/app/mrcombo/id489265191">get MrCombo on iTunes</a>.</p>
<p>If you run into problems with MrCombo, you can reach me through the App Store
or post a comment right here.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://blakeley.com/blogofile</uri>
    </author>
    <title type="html"><![CDATA[Conditional Profiling for MarkLogic]]></title>
    <link rel="alternate" type="text/html" href="http://blakeley.com/blogofile/2011/12/14/conditional-profiling-for-marklogic" />
    <id>http://blakeley.com/blogofile/2011/12/14/conditional-profiling-for-marklogic</id>
    <updated>2011-12-14T15:16:17Z</updated>
    <published>2011-12-14T15:16:17Z</published>
    <category scheme="http://blakeley.com/blogofile" term="XQuery" />
    <category scheme="http://blakeley.com/blogofile" term="MarkLogic" />
    <summary type="html"><![CDATA[Conditional Profiling for MarkLogic]]></summary>
    <content type="html" xml:base="http://blakeley.com/blogofile/2011/12/14/conditional-profiling-for-marklogic"><![CDATA[<p>Today I pushed <a href="https://github.com/mblakele/cprof">cprof</a> to GitHub.
This XQuery library helps application developers
who need to retrofit existing applications with profiling capabilities.
Just replace all your existing calls to
<code>xdmp:eval</code>, <code>xdmp:invoke</code>, <code>xdmp:value</code>,
<code>xdmp:xslt-eval</code>, and <code>xdmp:xslt-eval</code> with corresponding <code>cprof:</code> calls.
Add a little logic around <code>cprof:enable</code> and <code>cprof:report</code>, and you are done.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://blakeley.com/blogofile</uri>
    </author>
    <title type="html"><![CDATA[MrCombo v1.0]]></title>
    <link rel="alternate" type="text/html" href="http://blakeley.com/blogofile/2011/12/13/mrcombo-v1.0" />
    <id>http://blakeley.com/blogofile/2011/12/13/mrcombo-v1.0</id>
    <updated>2011-12-13T14:15:16Z</updated>
    <published>2011-12-13T14:15:16Z</published>
    <category scheme="http://blakeley.com/blogofile" term="iOS" />
    <summary type="html"><![CDATA[MrCombo v1.0]]></summary>
    <content type="html" xml:base="http://blakeley.com/blogofile/2011/12/13/mrcombo-v1.0"><![CDATA[<p>I have submitted a new iOS application to Apple: MrCombo.
This app lets you build lists in a two-level hierarchy:
combo &gt; group &gt; item. Then you can shuffle the items to mix it up.
Sample data includes ordering a pizza and picking an outfit,
but you are meant to create your own combinations.</p>
<p>Yes, it's a bit silly. But I find it fun and useful
so I thought I would release it.
For now MrCombo is free, but if I keep adding more features that may change.</p>
<p>You can <a href="/ios/mrcombo">read more about MrCombo</a>
or <a href="http://itunes.apple.com/us/app/mrcombo/id489265191">get MrCombo on iTunes</a>.</p>
<p>If you run into problems with MrCombo, you can reach me through the App Store
or post a comment right here.</p>]]></content>
  </entry>
</feed>
