Erlang: What does question mark syntax mean?
What does the question mark in Erlang syntax mean? For example: Json = ?record_to_json(artist, Artist). The full context of the source can be found here. ...
What does the question mark in Erlang syntax mean? For example: Json = ?record_to_json(artist, Artist). The full context of the source can be found here. ...
Say you have an Erlang record of the following kind for songs: rd(song, {artist, title, album}). Song = #song{artist = <<"oasis">>, title = <<"wonderwall">>, album = <<"morning glory">>}. But you want to reformat the song records to include only the artist and title. How would you go about removing a field in Erlang records (in this ...
I am interested in delving into Erlang's C source code and try to understand (at least at a moderate level) what is going on under the hood. Where can I find info on the design and structure of the code? ...
I am making my way through Joe Armstrong's book on programing Erlang. I came up with the following answer for the ring benchmark question. The code works but I am not sure if it is "Erlangic" (for lack of a better word). In particular I am not sure if I am using too many Guards. Can more experienced programmers critique the code? I had...
I have a Erlang webapp, based on Mochiweb and Mnesia, which consumes and emits JSON. It makes sense to store records in Mnesia; however Mochiweb/Mochijson require data in proplist format. So I end up with a large amount of boilerplate code: -record(foobar, {name, value}). record_to_proplist(Record)-> [{name, Record#foobar.name}, ...
How is erlang fault tolerant, or help in that regard? ...
I'm new to Erlang and I've tried some Erlang constructions. My program should behave something like that: if x == 42: print "Hi" else: print "Hello" Here is my code in Erlang -module(tested). -export([main/0]). main() -> {ok, X} = io:fread("","~d"), case X == 42 of true -> io:fwrite("Hi\n"); false -> io:fwrite("H...
ESense looks dead; what are your recommendations for Erlang code completion in Emacs? It doesn't have to be fancy (ESense built an index from the Erlang source); even something that just uses Erlang's module_info/0 and module_info/1 functions for introspection of function names would help. If one isn't available in Emacs, can you recomm...
Possible Duplicate: What is the faster ( and slower ) language to do this ? I want to know what is the faster ( execution time ) language for this simple script ( executed through ajax ): Pseudocode: // start code var str = GET['string'] INSERT SQL SELECT SQL // end code This is a very simple script with 2 simple query. ...
Let's say I have several versions of a gen_event handler and want to change them around while the program is running: -module(logger_all). -behaviour(gen_event). -export([init/1, handle_event/2, terminate/2]). init(_Args) -> {ok, []}. handle_event({Severity, ErrorMsg}, State) -> io:format("***~p*** ~p~n", [Severity, ErrorMsg]), ...
I installed the mypeb php apache erlang and more. mypeb is here : http://code.google.com/p/mypeb/ I need to connect Erlang node and call it. then my php code is : $link = peb_connect('[email protected]', 'abc'); if (!$link) { die('Could not connect: ' . peb_error()); } [email protected] is my Erlang node but also notice Could ...
Can I format an Erlang binary so that each byte is written in hex? I.e., > io:format(???, [<<255, 16>>]). <<FF, 10>> I don't see an obvious way to do it in io:format documentation, but perhaps I am simply missing one? Converting a binary to list and formatting its elements separately is too inefficient. ...
I am trying to return the max of a list. I have the following code list_max([]) -> []; list_max([H|T]) -> list_max(H, T). list_max(Temp, []) -> Temp; list_max(Temp, [H|T]) when H > Temp -> Temp = H; list_max(Temp, T). But am struggling to relate to Erlang. How do I assign something to temp and replace it to the hig...
I would like to have per-page sidebar content in Zotonic: Links White papers Webinars What is a good way to do this and what kind of template snippets would I need to make it work? ...
This may be a question that others have seen, but I am trying to find the best language for concurrent programming that can run on the .net platform. I have been doing side development in erlang to get a feel for the language and have loved how easy it is to get a stable concurrent or even distributed system up. It led me to scala wh...
The Actor-model was defined in a 1973 paper by Carl Hewitt, but has been popularized by the Erlang language. I believe the parts of Erlang that aren't self-hosted (written in Erlang) are written in C; BEAM and HiPE are written mostly in C. What are some alternative Actor-model implementations (languages, frameworks, or libraries) that ar...
After reading this answer, I want to understand if the same applies to the calls to gen_tcp:recv(Socket, Length). My understanding of the documentation is that this if more than Length bytes are available in the buffer, they remain there; if there is less than Length bytes, the call blocks until enough is available or connection closes. ...
When nodes connect to each other on Erlang, why not just use the original port the connection is made on? Why cause the firewall issues that using random ports causes. I know how to get around this, but I don't understand why. Edit: I realize that this is frequently done, and this isn't necessarily an Erlang question, but it was a desig...
Just started reading the OTP chapter on the great Erlang book by Francesco Cesarini. Are most Erlang applications such as MochiWeb, Riak, RabbitMQ, Zotonic, ejabberd and CouchDB OTP applications? ...
In the Erlang crypto library, there is no aes_cfb_ivec function. Does it mean that the same IVec should be used for multiple rounds? Or should the encrypted data from the last step be used, as in the example of "DES in CBC mode" at the end of the linked page? ...