defmoduleDistro.Worker do useGenServer require Logger defstart_linkdo GenServer.start_link(__MODULE__, [], name: {:global, __MODULE__}) end definit([]) do {:ok, [], 1000} end defhandle_info(:timeout, state) do Logger.debug "timeout" {:noreply, state, 1000} end end
functionconvertStringToArrayBufferView(str) { var bytes = newUint8Array(str.length); for (var iii = 0; iii < str.length; iii++) { bytes[iii] = str.charCodeAt(iii); }
return bytes; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
functionconvertArrayBufferToHexaDecimal(buffer) { var data_view = newDataView(buffer) var iii, len, hex = '', c; for(iii = 0, len = data_view.byteLength; iii < len; iii += 1) { c = data_view.getUint8(iii).toString(16); if(c.length < 2) { c = '0' + c; }
hex += c; } return hex; }
生成字符串的HASH值
1
var data = "QNimate";
var crypto = window.crypto || window.msCrypto;
if(crypto.subtle)
{
alert("Cryptography API Supported");
var promise = crypto.subtle.digest({name: "SHA-256"}, convertStringToArrayBufferView(data));
promise.then(function(result){
var hash_value = convertArrayBufferToHexaDecimal(result);
});
}
else
{
alert("Cryptography API not Supported");
}
Thrift is a software framework for scalable cross-language services development. It combines a software stack with a code generation engine to build services that work efficiently and seamlessly between C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, and OCaml.
<divng-switchon="video"> <divng-switch-when="video.large"> <!-- code to render a large video block--> </div> <divng-switch-default> <!-- code to render the regular video block --> </div> </div>
Alternatively, you might also use ng-show/ng-hide but using this will actually render both a large video and a small video element and then hide the one that meets the ng-hide condition and shows the one that meets ng-show condition.
So on each page you’ll actually be rendering two different elements.
In the versions above 1.1.5 you can use the ng-if directive. This would remove the element if the expression provided returns false and re-inserts the element in the DOM if the expression returns true. Can be used as follows.
1 2 3 4 5 6
<divng-if="video == video.large"> <!-- code to render a large video block--> </div> <divng-if="video != video.large"> <!-- code to render the regular video block --> </div>
./autogen.sh
./configure --enable-mysql \
--enable-iconv \
--enable-elixir \
--enable-tools \
--enable-nif \
--enable-odbc \
--enable-zlib \
--enable-json
make
make install
更新模块列表
1
ejabberdctl modules_update_specs
列出可用的模块
1
root@xmpp:~# ejabberdctl modules_available
atom_pubsub Provides access to all PEP nodes via an AtomPub interface
ejabberd_auth_http Authentication via HTTP request
ircd IRC server frontend to ejabberd
mod_admin_extra Additional ejabberd commands
mod_archive Supports almost all the XEP-0136 version 0.6 except otr
mod_cron Execute scheduled commands
mod_log_chat Logging chat messages in text files
mod_logsession Log session connections to file
mod_logxml Log XMPP packets to XML file
mod_mam Message Archive Management (XEP-0313)
mod_message_log Log one line per message transmission in text file
mod_muc_admin Administrative features for MUC
mod_muc_log_http Serve MUC logs on the web
mod_multicast Extended Stanza Addressing (XEP-0033) support
mod_openid Transform the Jabber Server in an openid provider
mod_post_log Logs messages to an HTTP API
mod_profile User Profile (XEP-0154) in Mnesia table
mod_rest HTTP interface to POST stanzas into ejabberd
mod_s2s_log Log all s2s connections in a file
mod_shcommands Execute shell commands
mod_statsdx Calculates and gathers statistics actively
mod_webpresence Publish user presence information in the web
root@scm:~# cat /proc/18938/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 127460 127460 processes
Max open files 60000 60000 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 127460 127460 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us