erlang

What are some good Erlang Primers/Tutorials for beginners?

馋奶兔 提交于 2019-12-20 09:48:40
问题 What are some good links for diving into Erlang and functional programming in general? 回答1: Here's the first half of Concurrent Programming in Erlang [PDF], free. 回答2: this might be a good one to look at http://learnyousomeerlang.com/ 回答3: I think the language itself is surprisingly easy to learn. I recommend http://www.erlang.org/download/getting_started-5.4.pdf 回答4: Let me suggest that Erlang is not necessarily typical of "functional programming in general". If you want a good balance, I'd

Erlang — How to convert a fun() object to a String

青春壹個敷衍的年華 提交于 2019-12-20 09:38:38
问题 Is there a straightforward way to convert an Erlang fun to a string ? A call to io_lib:format only prints the function reference, e.g. something like "#Fun<erl_eval.20.67289768>" . For example, I'd like to be able to do this: 1> Fun = fun() -> atom_to_list('hello world') end. 2> FunStr = fun_to_str(Fun). "fun() -> atom_to_list('hello world') end." I'm looking for how to implement fun_to_str . In javascript, some interpreters have a .toSource() function that can be called on any object,

How do you compile an Erlang program into a standalone windows executable?

一笑奈何 提交于 2019-12-20 09:14:21
问题 Richard of Last.fm over at metabrew has ported his apps to Erlang. It was also done by riak, couchdb and others. He mentions extracting the needed parts, or including the whole VM into the distribution. Main trait here is: the program does not require Erlang to be installed on the target machine. So the question is, how do you, step by step, package an Erlang program into a windows (and, less important, linux) executable? P.S. I've seen the SAE project, and I've read all the relevant

How do I run a beam file compiled by Elixir or Erlang?

末鹿安然 提交于 2019-12-20 08:35:57
问题 I have installed Erlang/OTP and Elixir, and compiled the HelloWorld program into a BEAM using the command: elixirc test.ex Which produced a file named Elixir.Hello.beam How do I run this file? 回答1: Short answer: no way to know for sure without also knowing the contents of your source file :) There are a few ways to run Elixir code. This answer will be an overview of various workflows that can be used with Elixir. When you are just getting started and want to try things out, launching iex and

Node.js or Erlang

和自甴很熟 提交于 2019-12-20 07:58:48
问题 I really like these tools when it comes to the concurrency level it can handle. Erlang looks like much more stable solution but requires much more learning and a lot of diving into functional language paradigm. And it looks like Erlang makes it much better when it comes to multi cores CPUs(fix me if I'm wrong). But which should I choose? Which one is better in the short/long term perspective? My goal is to learn a tool which makes scaling my web projects under high load easier than

Rabbit安装(单机及集群,阿里云)

情到浓时终转凉″ 提交于 2019-12-20 06:51:31
Rabbit安装(单机及集群,阿里云) 前言 虽然我并不是部署人员,但是自己私人测试环境的各类东东还是得自己安装的。 尤其在规模不大的公司,基本安装部署工作都是后端的份内之事。 那么最令人痛苦的,莫过于自己就是安装大佬教程走,但是就是过不去。尤其是初学者,解决问题的能力,还不足,往往就直接卡死了。 其实还有另外一个问题,那就是很多的教程,包括许多视频的教学,大多采用不真实的环境。要么是多台虚拟机实现集群,要么是一台线上服务器走天下。当然作者们也有着诸多考虑,有的是为了学员可以零成本的感受安装,另一方面学员大多都是学习知识,而不是为了实际应用(真的懂得,又不大需要这个东东)。最重要的是,学习阶段,大部分安装都是单机的,可以满足需求了。 但是,我发现在很多的扣扣群,微信群依然存在着那么一批正式环境安装遇到各类问题,苦求无门的朋友。在我回复之后,部分人提议我可以将这部分经验发出来,帮助更多的人。 所以有了这个系列,我会通过真实的阿里服务器集群(三台),搭建各个中间件的集群等。 最后,由于打马赛克太麻烦了。并且我之后可能会开放安装视频,所以有的IP什么的,我并不方便打马赛克。但是希望你们不要做坏事儿哈。 Rabbit安装概述 简介 RabbitMQ是一款消息中间件,其安装分为: 单机安装(只有一台服务器,上面只有一个RabbitMQ的Broker实例) 多主集群转发数据

Docker环境下的前后端分离项目部署与运维(八)使用Docker部署RabbitMQ集群

旧城冷巷雨未停 提交于 2019-12-20 06:49:17
下载RabbitMQ镜像 镜像地址 RabbitMQ Docker官方认证镜像地址: https://hub.docker.com/_/rabbitmq 安装命令 安装之前,切记把Docker Hub设置为阿里云的加速,方便安装。 docker pull rabbitmq:3.7.14-management 注意使用后缀为"-management"的镜像版本,是包含网页控制台的。 查看安装 使用命令:docker images查看下载的镜像,如下图所示: 启动RabbitMQ docker run -d --hostname localhost --name myrabbit -p 15672:15672 -p 5672:5672 rabbitmq:3.7.14-management 参数说明: -d 后台进程运行 --hostname RabbitMQ主机名称 --name 容器名称 -p port:port 本地端口:容器端口 -p 15672:15672 http访问端口 -p 5672:5672 amqp访问端口 启动完成之后,使用:docker ps 查看程序运行情况。 使用:http://宿主ip:15672 访问,用户名密码使用默认:guest/guest. 启动多个RabbitMQ docker run -d --hostname localhost --name

Will Erlang have Bignums for math functions?

不想你离开。 提交于 2019-12-20 06:18:56
问题 Why does Erlang not include arbitrary precision for math functions? I recently had to use math:pow(2,4333) , and it throws an error. Why does Erlang not use libraries like GMP? Are there any plans to include it in the standard library? (Haskell uses it, [strike]even Java has bignums[strike]). Thanks. Update: To add more perspective, I understand that it can be done using NIFs. I was solving problems from hackerrank in which the input uses larger numbers. pow/2 can be easily written in Erlang

Erlang emysql iPhone Emoji Encoding Issue

耗尽温柔 提交于 2019-12-20 05:33:13
问题 I'm trying to store text (with emoji) From an iPhone Client App on a MySQL database with Erlang. (Into a varchar column) I used to do it with a socket connection server done with C++ and mysqlpp, it was working great. (It is the exact same database, So I can assume that the issue is not coming from the database ) However, I decided to pass everything on Erlang for scalability reasons, and since, I am unable to store and retrieve correctly emojis. I'm using emysql to communicate with my

how to support chinese in http request body? erlang

被刻印的时光 ゝ 提交于 2019-12-20 05:01:15
问题 URL = http://example.com, Header = [], Type = "application/json", Content = "我是中文", Body = lists:concat(["{\"type\":\"0\",\"result\":[{\"url\":\"test.cn\",\"content\":\"", unicode:characters_to_list(Content), "\"}]}"]), lager:debug("URL:~p, Body:~p~n", [URL, Body]), HTTPOptions = [], Options = [], Response = httpc:request(post, {URL, Header, Type, Body}, HTTPOptions, Options), but http request body received by http server is not 我是中文。 how to sovle this problem? 回答1: Luck of the Encoding You