How to Query Ejabberd for Version

Send this:

<iq type="get" to="localhost">
  <query xmlns="jabber:iq:version"/>

Receive this back:

<iq xmlns="jabber:client" from="localhost" to="bob@localhost/2943672495139718417282263" type="result">
  <query xmlns="jabber:iq:version">
    <os>unix/darwin 13.0.0</os>

Tail Recursion in Erlang

Suppose we have a try-catch block in Erlang as follows:

try Expression of
  SuccessfulPattern1 [Guards] ->
  SuccessfulPattern2 [Guards] ->
  TypeOfError:ExceptionPattern1 ->
  TypeOfError:ExceptionPattern2 ->

It’s important to remember that the protected part of the exception (that is, what is between try .. of, or in this case, Expression) must not be tail-recursive(!) The VM must always keep a reference there in case there’s an exception popping up.

Since a try .. catch block without the of term is nothing but protected code, calling a recursive function from here might be dangerous – especially if your code is supposed to run for a long time (as Erlang is designed to do).

Any recursive calls you want to make should be put between the of and catch terms.

FIX Protocol

FIX is a financial interchange protocol. Tutorials for it are terse. 

The following are some sample FIX messages, and what they mean:



Tag Field Value Description
8 BeginString FIX.4.2  
9 BodyLength 42  
35 MsgType 0 Heartbeat
49 SenderCompID A  
56 TargetCompID B  
34 MsgSeqNum 12  
52 SendingTime 20100304-07:59:30  
10 CheckSum 185