erlang

Is Erlang 19.xx is FIPS compliant?

狂风中的少年 提交于 2019-12-24 07:59:53
问题 Does Erlang 19.x compliant FIPS? Or it needs to be built? How can we build FIPS enable erlang and once build is there, is there some mechanism to verify it? When search erlang documentation, there is no mention of FIPS http://erlang.org/doc/search/?q=fips&x=0&y=0. But when search the github repo of erlang there are quit a referance to fips https://github.com/erlang/otp/search?p=2&q=fips&type=&utf8=%E2%9C%93 回答1: FIPS 140-2 support was merged into the master branch in this pull request. It is

Check if parallel processes evaluate same function

蓝咒 提交于 2019-12-24 07:38:48
问题 Since few days, I'm learning Erlang, using the great book Programming Erlang by Joe Armstrong. I'm following the chapter about concurrent programming, and, at the end of chapter, there's a little problem to solve: Write a function start(AnAtom, Fun) to register AnAtom as spawn(Fun). Make sure your program works correctly in the case when two parallel processes simultaneously evaluate start/2. In this case, you must guarantee that one of these processes succeeds and the other fails. I solved

erlang - is it possible to output the list length after having it run a quicksort?

自闭症网瘾萝莉.ら 提交于 2019-12-24 07:38:28
问题 I'm a newbie to Erlang. I've been running a quick sort on a random list of numbers (i've also had it only keep unique numbers so duplicates do not show up in the sorted list). It works fine in that the output is giving the sorted numbers with no duplicates, but I have been trying to have it output not only the list, but also the length list too which is where I'm running into errors. The length(mod:func). will give the length of the list no problem in the erlang shell, but I can't get it to

do record_info and tuple_to_list return the same key order in Erlang?

妖精的绣舞 提交于 2019-12-24 07:29:09
问题 I.e, if I have a record -record(one, {frag, left}). Is record_info(fields, one) going to always return [frag, left] ? Is tl(tuple_to_list(#one{frag = "Frag", left = "Left"})) always gonna be ["Frag", "Left"] ? Is this an implementation detail? Thanks a lot! 回答1: The short answer is: yes, as of this writing it will work. The better answer is: it may not work that way in the future, and the nature of the question concerns me. It's safe to use record_info/2 , although relying on the order may be

Which NoSQL database is best to store chat messages? [closed]

五迷三道 提交于 2019-12-24 07:17:11
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I am working in mobile chat application using ejabberd as server and mysql as main database to store user's details. I want to store chat messages in NoSQL database for fast retrieval and avoid traffic.Each conversation should be in single key.There are different NoSQl databases like Hbase, Cassandra, Riak

How to uninstall erlang r16b from Mac os x

北战南征 提交于 2019-12-24 07:11:28
问题 I have R16B on OS X (Mountain Lion) and want to uninstall it, to replace with a Homebrew version. Anyone any ideas how to do this? 回答1: It depends on how you have installed it. I suppose, you've installed it from source, doing configure && make && make install . If so, I'd suggest compiling and installing it once again, now in a 'special' directory. Then, given that list of installed files, uninstall it manually. So, something like that: ERLTMPDIR=/tmp/myerlang ./configure && make && make

RabbitMQ windows 安装

为君一笑 提交于 2019-12-24 06:59:52
rabbitMQ是一个在AMQP协议标准基础上完整的,可服用的企业消息系统。它遵循Mozilla Public License开源协议,采用 Erlang 实现的工业级的消息队列(MQ)服务器,Rabbit MQ 是建立在Erlang OTP平台上。 1、安装Erlang 下载地址: https://www.erlang.org/downloads 本文选择OTP 21.0.1 Windows 64-bit Binary File (91707927) : http://erlang.org/download/otp_win64_21.0.1.exe 设置环境变量,新建ERLANG_HOME 修改环境变量path,增加Erlang变量至path,%ERLANG_HOME%\bin; 打开cmd命令框,输入erl 至此,Erlang 安装完成 2、安装rabbitmq 下载地址: http://www.rabbitmq.com/download.html exe安装地址: http://www.rabbitmq.com/install-windows.html 解压缩安装地址: http://www.rabbitmq.com/install-windows-manual.html 本文选择解压缩安装 rabbitmq-server-windows-3.7.7.zip 下载地址:

Why Erlang Dialyzer cannot find type error in the following code?

天大地大妈咪最大 提交于 2019-12-24 05:49:43
问题 free_vars_in_dterm({var, V}) -> {var, V}; obviously cannot type check, however, dialyzer says everything is OK. $ dialyzer *erl Checking whether the PLT ~/.dialyzer_plt is up-to-date... yes Proceeding with analysis... done in 0m0.66s done (passed successfully) Code is as below: -module(formulas). -type formulas() :: {predicate(), [dterm()]} | {'~', formulas()} | {'&', formulas(), formulas()} | {'|', formulas(), formulas()} | {'->', formulas(), formulas()} | {'<->', formulas(), formulas()} | {

Erlang raise number of opened sockets, MacOS and CentOs

我是研究僧i 提交于 2019-12-24 04:46:07
问题 I'm trying to open connections ( sockets ) to my Erlang server; everything works fine with around 100 paralell connections, but when I want more than 100 i get {error, closed}. It may be something that has to do with OS file descriptor limit ? If yes, can you guys please give me a solution? I use MacOS and CentOS. Should I give some params to the Erlang Vm in vm.args file? 回答1: Open sockets limit in erlang relies on two things: OS max open files limit, you can check how two tune it here

Erlang case statement

只谈情不闲聊 提交于 2019-12-24 04:22:28
问题 I have the following Erlang code and it is giving the warning as follows, when i try to compile it, but that make sense. function need two arguments, but i need to patten match "everything else" rather x, y or z. -module(crop). -export([fall_velocity/2]). fall_velocity(P, D) when D >= 0 -> case P of x -> math:sqrt(2 * 9.8 * D); y -> math:sqrt(2 * 1.6 * D); z -> math:sqrt(2 * 3.71 * D); (_)-> io:format("no match:~p~n") end. crop.erl:9: Warning: wrong number of arguments in format call. I was