This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Replace the item at `Index' in `List' with `Element'. | |
%% Zero-based indexing. Deal with it. | |
-spec replace_list_element(non_neg_integer(), term(), list()). | |
replace_list_element(Index, Element, List) -> | |
{Prefix, Suffix} = lists:split(Index, List), | |
Prefix ++ [Element] ++ tl(Suffix). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=ERROR REPORT==== 4-Aug-2015::09:01:01 === | |
** gen_event handler lager_stderr_backend crashed. | |
** Was installed in lager_event | |
** Last event was: {log,{lager_msg,[], | |
[{application,cuttlefish}, | |
{module,cuttlefish_conf}, | |
{function,generate_element}, | |
{line,122}, | |
{pid,"<0.719.0>"}, | |
{node,nonode@nohost}], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%% @author John Daily <jd@epep.us> | |
%%% @copyright (C) 2012, John Daily | |
%%% @doc | |
%%% Assignment from programmingpraxis.com | |
%%% | |
%%% @reference See <a href="http://programmingpraxis.com/2009/02/19/rpn-calculator/">RPN Calculator</a>. | |
%%% @end | |
-module(rpncalc). | |
-export([rpn/0]). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%% @author John Daily <jd@epep.us> | |
%%% @copyright (C) 2012, John Daily | |
%%% @doc | |
%%% The httpc module in inets does not appear to offer any way to | |
%%% determine the "real" URL if it follows a series of redirects | |
%%% during its request. This code addresses that gap. | |
%%% | |
%%% The code does not interpret any HTML-based redirect, such as a | |
%%% meta refresh. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env escript | |
% -*- mode: erlang -*- | |
main([BeamFile]) -> | |
{ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(BeamFile,[abstract_code]), | |
io:fwrite("~s~n", [erl_prettypr:format(erl_syntax:form_list(AC))]). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Riak's MapReduce functionality cannot survive a node failure. If a vnode involved with a query fails while actively processing the request, the entire query will have to be re-run. The failed query should be automatically terminated, but you'll have to re-run the query yourself. | |
If you create queries using Riak Pipe (the technology layer beneath MapReduce), it is possible to create queries that can survive a vnode failure, but that is not a trivial exercise. | |
Regarding the empty result set you're seeing: one possibility is that a vnode has failed recently and has come back online without data. MapReduce will not currently trigger a read repair, but that problem should be resolved with the forthcoming Riak 1.3 release. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124> <<T7/utf8, Excess/binary>> = hd(Blob). | |
<<77,195,131,194,188,110,99,104,101,110>> | |
125> Excess. | |
<<195,131,194,188,110,99,104,101,110>> | |
126> T7. | |
77 |
You're free to view the older revisions of this gist, but much of this content has been rewritten and will appear on the [Basho blog] (http://basho.com/blog) in the very near future.
Update: First part of the series is now at http://basho.com/understanding-riaks-configurable-behaviors-part-1/
OlderNewer