Label: Erlang??
Original article, reprinted with the source: Server non-amateur researchSunface by http://blog.csdn.net/erlib
Project Structure
The structures of OTP applications and of OTP releases are different. an OTP application can be expected to have one top-level supervisor (if any) and possibly a bunch of dependencies that sit below it. an OTP release will usually be composed of multiple OTP applications, which may or may not depend on each o
In the development process, there are two concepts related to the regional area: character encoding and time; the evolution of the Code and Time specification has a historical legacy, and it is a corner of the development of software. About character encoding I've worked on a post before, [Erlang 0024] Erlang binary Data processing this part of the knowledge is very interesting, in particular, Gulliver's tr
Recently saw Sunface "Why I choose Erlang+go Server Architecture", feel erlang+go is really the monster of the service side, In particular, after doing some of the node. JS, I think node concurrency is really not good, compared to. NET (and of course, the great God says that if you say. NET is not concurrent, that is, you do not use. NET) is a lot faster. But I have to admit that my love for. NET has passed
recently a friend wanted to learn Erlang and asked me what I could do to get started. I'd also take this opportunity to tidy up: http://download.csdn.net/detail/cwqcwk1/8395531Entry Information:Erlang Documentation Manual (best for Getting started)Introduction to Erlang programmingErlang bit arithmetic and binary parsingErlang binary Efficient programmingAn explanation of
Introduction to Erlang Distributed (i)-ping pongTest environments like http://willvvv.iteye.com/blog/1523918, 192.168.0.182 (centos-182) and 192.168.0.183 (centos-183),1. Follow the link above (step 1-4) to set up a password-free login via ssh hostname.2. Set the Magiccookie of Erlang, as the root account, the following commands are executed on both machines:Cd/rootVI. Erlang.cookieInputShell Code
Http://blog.chinaunix.net/uid-22566367-id-382011.htmlIn the book programming Erlang, in the tenth chapter, the main realization of the communication between the different nodes, the book listed four steps, the first step is easy to achieve, according to gourd painting scoop, it is easy to achieve the same machine, the communication between different nodes, the results of the operation and the book in full agreement.When you are eager to try the second
In a parallel world, it's hard to do a single-step breakpoint debugging to locate the problem (too many messages flying around), and Erlang designers are also deeply aware of this and have introduced another trace mechanism. With this trace, you can:1 . Specify the in-process function call input and output, send and receive messages; 2. Specify the input and output of the port and send and receive messages.This way you can add no line of code (abandon
21.The following code is used to generate a random number:
random:seed(erlang:now()).
Erlang: Now () is a continuously increasing number that never repeats, but is not suitable for Random Algorithms. It is best to use the following:
-spec get_random_num(integer()) -> integer().get_random_num(Max) ->
22.What are the three digits of PID
A, which node corresponds to (0 indicates a local node, and other numbers represent a remote node );
B. 15 byt
Background: gen_fsm is a finite state machine behavior of Erlang, which is very useful. One of Ericsson's TDD experts wrote an article on how to test gen_fsm. This FSM is a trading system responsible for simple traders to log on, insert items, delete items, etc:
1. Start and Stop
First take a look at the original version of tradepost_tests:
-module(tradepost_tests).-include_lib("eunit/include/eunit.hrl").% This is the main point of "entry" for my EU
Ask a basic question: Is the Erlang parameter assigned a value or referenced?Method Test not found.Ask for advice.A:How can this argument be referenced in Erlang? All variables are copied in the past.Q:Reference cannot be implemented, right?What I'm writing is going to be in a big state.So I am confused.A:All the variables in Erlang can only be passed in the func
cool started to be interested in the performance of this item. I just touched the Erlang document for a while, so we went on the Performance Tuning journey of the Erlang network connection ~~ The process is really exciting. We soon passed the 1024 mark ~~ We were very excited when we reached 4999 connections.
But why are there 4999 connections? Check the code and find that echo_server.erl defines a macro w
To establish a connection between nodes in Erlang, we can use net_adm: Ping (). If the connection succeeds, Pong is returned. If the connection fails, Pang is returned. In practice, we not only need to establish a connection, for example, we need to do something when we establish a connection with other nodes or when other nodes are disconnected, such as logging when the node is down, this requires the corresponding information at the corresponding ti
Reprinted: http://blog.csdn.net/minyskirt/article/details/5031221
Erlangweb is an open-source HTTP-based application framework. It uses the Erlang language to quickly and concisely build Web applications. However, currently, this framework only supports Linux platforms. Its official site is http://erlang-web.org /.
The following describes how to download and compile the source code from its website, and t
Reprinted: https://bitbucket.org/basho/rebar/wiki/Extensions
Extending rebar
In its standard release, rebar provides for most Erlang DevelopmentNeeds.Shocould you encounter a need to extend rebar's capabilities, then itsImplementation allows easy transition sion of further functionality.Contexts
The key to understanding how to extend rebar is, the roleContextsWithin the rebar core machinery. contexts determine which commands(Rebar modules)Shocould be
1, EPMD is the Erlang port Mapper daemon abbreviation, completes the Erlang node and the IP, the port mapping relations, the communication between the different nodes depends on the EPMD process to communicate. 2. Erl is the command to start the Erlang virtual machine. 3, from the actual operation point of view, as long as the execution of the ERL option contai
After the sd2c Conference, I have been busy with this job, that is, sorting out some resources on Erlang. Now it's basically finished (or started), and two projects have been created on Google Code:
Erlangdoci: this is a document project, mainly used to add bookmarks and indexes to the PDF document officially released by Erlang.=====Home: http://code.google.com/p/erlangdoci/Project Description: http://co
Socket communication between Php and Erlang ??
Generally, there are two common network communication methods: text communication and binary communication. It is relatively simple to implement text communication between php and erlang. we will not discuss it here. this article mainly discusses how php and erlang implement binary communication. The implementation
Label: Erlang ??
1. if an error occurs in guard, no error is reported. Only false is returned!
case 1=:1 of true when not erlang:length(t) =:= 1 orelse true -> ok; _ -> errorend.Result is: Error
An error occurs when length is obtained for T (atom) in the protection formula, which should have been crash. However, in the protection formula, the default error occurs and the protection formula calculation ends and false is ret
Book preparation
I bought two books:
I have read more than 30 pages, a lot of concepts, and a lot of perceptual knowledge, but it is also a bit more confused, because it is very different from the previous language, whether it is the design idea or the design thinking in the application field.
Therefore, I think it is better to do all the basic examples and do some programming exercises on algorithms. At the same time, it is better to understand them in combination with books.
As a result, we a
Looking at Ching see from the Erlang processAfter the multi-core slowly fire, the co-process class programming also began to become more and more fire. There are more representative goroutine of Go, Erlang in Erlang, Scala actor, fibre under Windows, and some dynamic languages like Python, Ruby, and Lua are also slowly supporting the process.In fact, we have hear
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.