Please refer to this article http://ftp.sunet.se/pub/lang/erlang/workshop/2003/paper/p29-carlsson.pdf
The focus here is how to implement it. First look at the Code:
Root @ Nd-desktop :~ /Test/M # Cat main. erl% File: Main. erl-Module (main ).-Export ([start/0]).Start ()->M1 = Print: New ("Humpty "),M2 = Print: New ("dumpty "),M1: Message ("Hello! "),M2: Message ("Hi! "),OK.Root @ Nd-desktop :~ /Test/M # Cat print. erl% File: print. erl-Module (print,
Reprinted: http://cryolite.iteye.com/blog/1663436
Erlang/OTP organizes a group of modules that complete specific functions, called applications. This is not a good name. It has different meanings from the conventional application. For example, in the development of Jee, the entire application system is called an application; in iOS, an independent game and a small tool are called an application.The Application of
Erlang is mainly used for writing servers. The GUI is not very important, or even not necessary. However, to improve learning interest, you need to write some guis, so I tried wxerlang on XP. 1, download open web page: http://apps.sourceforge.net/mediawiki/wxerlang/index.php? Title = main_page find the link downloads: http://sourceforge.net/project/showfiles.php? Group_id = 151173 download wxerlang: http://sourceforge.net/project/showfiles.php? Group_
[Erlang crisis] (4.4) named pipeline, erlang4.4Original article, reprinted please indicate the source: Server non-amateur research http://blog.csdn.net/erlib author SunfaceE-mail: cto@188.comNamed Pipes Named Pipe (Named Pipes)
A little known way to connect with an Erlang node that requires no explicit distribution is through named pipes. This can be done by starting Er
1. Install Erlang,
Ii. Installation
To the http://www.erlang.org/download.html, I downloaded the R15B03-1 windows binary file (91.3 MB), just install it directly. This step is very important to set the path after installation!
Add the Bin (such as c: \ erl5.9.3.1 \ bin) to the path of the system variable (right-click my computer/properties/advanced/environment variables ).
Iii. Check whether Erlang
There are only two mixed data types within Erlang: list and tuple, neither of which supports named access, so it is not possible to create associative arrays (hash in ruby) in PHP, Ruby, or Python if there is no additional library.In Ruby I can do this:
server_opts = {:p ort + 8080: ip = ' 127.0.0.1 ',: Max_connections = Ten}
This expression is not supported at the grammar level of ErlangTo avoid this limitation, the
Learning a language, when learning those basic grammar, we often ignore its program debugging, when the program is a little more complex, we can not guarantee that the program is completely correct, we will worry about it, then, the program debugging becomes quite important.Once the Erlang environment is set up, it will default to a debug tool---Erlang debugger (the name is Good (^_^)).Simple use of
assigned by P is quickly executed (uneven distribution), which leads to a context p is idle and the system is busy. But if global Runqueue has no task G, then P will have to take some g from the other context p to execute. In general, if context P steals a task from another context p, it is generally ' stealing ' half of the run queue, which ensures that every OS thread is fully used.
PS: For more information, see how Golang's Goroutine is implemented?
The difference between
After learning a language for an hour, I still cannot implement "Hello World !" ThisProgramErlang is just like this. Even if you have been studying for an hour, you may not know how to implement "Hello World !". This articleArticleIs about how to implement "Hello World!" on Windows !" .
First install the Erlang Program (about 70 m) on the machine. This is not detailed here, so you will know it by Google.
After installation, an "
The Erlang system seems to me to have 3 features: 1. Distribution 2. Multi-core support 3.FP. These 3 features are distributed I think Erlang is the most powerful, supported from the first version to the present, relatively very mature, and multi-core support has been added in these years.
Erlang's distribution system achieves 2 points:
1. Location independence of the nodes;
2. Distributed and transparen
In r13a, Erlang has added support for Unicode. The data types covered in this article include: list, binary, modules involved Stdlib/unicode, Stdlib/io, Kernel/file. Binary The binary type attribute increases the UTF-related Type:utf8, UTF16, UTF32, which correspond to UTF8, UTF16,UTF32 encoding respectively. Binary Constructing When binary is built, if UTF correlation type is specified, then the value of the corresponding integer must be at: 0. 16#D7
Erlang Chat Room Program (i) Erlang chat room Program (ii) client exit Erlang Chat Room program (c) Data Interchange Format---JSON Decodeerlang chat room Program (iv) Data Interchange Format---JSON Encodeerlang Chat Room Program (v) Set up client information Erlang Chat room program (vii) Get online users
[Erlang crisis] (4.3) SSH daemon, erlangsshOriginal article, reprinted please indicate the source: Server non-amateur research http://blog.csdn.net/erlib author SunfaceE-mail: cto@188.comSSH Daemon
Erlang/OTP comes shipped with an SSH implementation that can both act as a server and a client. Part of it is a demo application providing a remote shell working in Erlang.To get this to work, you usually need to
1. Download Erlang r16b02 Source Pack
Http://www.erlang.org/download/otp_src_R16B02.tar.gz
2. Because Java is needed in the process of compiling Erlang, the JDK is installed and the corresponding environment variables are configured, using the Jdk-6u45-linux-x64.bin
wget--no-cookies--header "cookie:gpw_e24=http%3a%2f%2fwww.oracle.com%2f" Http://download.oracle.com/otn-pub/java /jdk/6u45-b06/jdk-6u45-linux-x
Generally speaking, there are 2 kinds of methods used in network communication: Text communication and binary communication. The text communication between PHP and Erlang is relatively simple, there is no discussion here, this article mainly discusses the implementation of binary communication between PHP and Erlang. The implementation steps are as follows:
Erlang
Reprint: http://agileprogrammer.blogspot.com/2006/08/erlang-abstract-form-moduleform.html
We will examine the composition of the Erlang Abstract form in detail. The method is simple, refer to the Abstract form section of the ERALNG document and validate it with practical examples.Abstract FormIn the Abstract form document, a function rep is used to represent a mapping from the
Reprinted: http://lenary.co.uk/erlang/2011/08/erlang-web-libraries/
I'll try to keep this updated as more information comes to light. please email me if anything is factually incorrect.
Recently I needed to compare a few Erlang web libraries and frameworks for a friend who was writing a simple internal API endpoint. He suggested I shoshould publish the rundown f
only track janus_acceptor.erl. -- In janus_acceptor.erl, acceptor_init () generates listensocket through gen_tcp: Listen (). In this case, {active, false} is blocked, and then enters the acceptor_loop to start loop listening to client TCP requests. This cycle mainly involves three processes:
1. gen_accept () generates socket;
2. gen_tcp: controlling_process () assigns the socket communication to the newly generated transport process for processing;
3. set the {active, once} of transport to
Label: Erlang tail recursion Erlang generative Erlang list set deduplication% Set deduplication. ACC is initially passed into [] and stores the final result.Delsame ([], ACC)-> ACC;Delsame ([pre | T], ACC)-> checksame ([x | x % IntersectionCrosslist (L1, L2)->[X | x % UnionMergelist (L1, L2)->Delsame (lists: Merge (L1, L2), []).Conclusion: (1) the
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.