erlang

HMAC SHA256 hex digest of a string in Erlang, how?

删除回忆录丶 提交于 2019-12-19 05:44:51
问题 I am trying to interact with third party real time Web messaging System created and maintained by Pusher.com . Now, i cannot send anything through the API unless i produce an HMAC SHA256 hex digest of my data. A sample source code written in ruby could try to illustrate this: # Dependencies # gem install ruby-hmac # require 'rubygems' require 'hmac-sha2' secret = '7ad3773142a6692b25b8' string_to_sign = "POST\n/apps/3/channels/test_channel/events\nauth_key=278d425bdf160c739803&auth_timestamp

Add Path to Erlang Search Path?

巧了我就是萌 提交于 2019-12-19 05:37:03
问题 I recently installed Erlang RFC4627 (JSON-RPC) with the debian package. I ran the test server using: sudo erl -pa ebin and then at the prompt: test_jsonrpc:start_httpd(). returned ok I tested with http://:5671/ and got the success messages. When I try to run rabbitmq-http2 however, I get the errors that the readme says are caused by rfc4627's code not being on the erlang search path. How do I put it on the path. I saw something on Dave Thomas's blog which suggested putting the path in the

Add Path to Erlang Search Path?

随声附和 提交于 2019-12-19 05:36:04
问题 I recently installed Erlang RFC4627 (JSON-RPC) with the debian package. I ran the test server using: sudo erl -pa ebin and then at the prompt: test_jsonrpc:start_httpd(). returned ok I tested with http://:5671/ and got the success messages. When I try to run rabbitmq-http2 however, I get the errors that the readme says are caused by rfc4627's code not being on the erlang search path. How do I put it on the path. I saw something on Dave Thomas's blog which suggested putting the path in the

How to Search for an item in a List in Erlang?

对着背影说爱祢 提交于 2019-12-18 21:12:12
问题 I am writing a cache gen-server for the company Use. I am wondering how to search an item from the list as I want the cost of the search for comparing various data structures in erlang like dict, orddict, List, tuples, tree, queue etc to use for cache program. Example: List = [{"A1",["ankit","sush", "Hover", "x4", "a3","nilesh","mike","erlang" | ...]}|...]. Now, I want to search for the Key A1 and search for 'mike' in the list. What is the best way to search the above List. Please provide

How can I handle SIGINT in Erlang?

情到浓时终转凉″ 提交于 2019-12-18 19:38:12
问题 I know how to create custom signal handlers in Java, Python, Ruby, Perl, and Lisp, thanks to Google and a plethora of tutorials. I can't find online how to create handlers for SIGINT, SIGTERM, HUP, etc. in Erlang. 回答1: You can not. OS signals handled exclusively by Erlang VM. I guess OS signals can be handled in a driver but it can interfere with the VM signal handler so use it on your own risk. 回答2: I stumbled upon this: http://erlang.org/doc/man/kernel_app.html#erl_signal_server. I have not

EUnit vs. Common Test

别等时光非礼了梦想. 提交于 2019-12-18 19:07:31
问题 I am new to Erlang. It has 2 test frameworks: EUnit and Common Test. I am confused when to use one over another. Can someone explain to me what are the advantages of EUnit over Common Test, and vice versa. Seem Common Test can do everything EUnit can do and much more, not sure what I should use EUnit. Thanks! 回答1: Learn you some erlang (one of the best online resources for erlang, besides the official doc) explains both methods quite well: EUnit Common Test As Pascal pointed out, EUnit is

rabbitmq-server installation CentOS - Erlang Error

一个人想着一个人 提交于 2019-12-18 18:23:38
问题 I have centos 6 and trying to install rabbitmq 3.5.3 using rpm. ( do not have option for yum ) its throwing me below eror. [root@osboxes CentOS]# rpm -Uvh rabbitmq-server-3.5.3-1.noarch.rpm warning: rabbitmq-server-3.5.3-1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID 056e8e56: NOKEY error: Failed dependencies: erlang >= R13B-03 is needed by rabbitmq-server-3.5.3-1.noarch But I have already installed erlang [root@osboxes CentOS]# which erl /usr/bin/erl [root@osboxes CentOS]# [root@osboxes

CentOS7 linux下yum安装RabbitMQ以及使用

流过昼夜 提交于 2019-12-18 17:13:37
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> CentOS7 linux下yum安装RabbitMQ以及使用,亲测可用!亲测可用!亲测可用! 系统版本:CentOS 7 RabbitMQ-Server:3.5.1 一、安装erlang 1.安装准备,下载安装文件 sudo wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm sudo rpm -Uvh erlang-solutions-1.0-1.noarch.rpm 2.安装erlang sudo yum install erlang 3.安装完成后可以用erl命令查看是否安装成功 erl -version 二、安装RabbitMQ Server 1.安装准备,下载RabbitMQ Server sudo wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.5.1/rabbitmq-server-3.5.1-1.noarch.rpm 2.安装RabbitMQ Server sudo rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc sudo yum

Erlang: Distributed Application Strange behaviour

Deadly 提交于 2019-12-18 13:21:12
问题 I'm paying with distributed erlang applications. Configuration and ideas are taken from: http:/www.erlang.org/doc/pdf/otp-system-documentation.pdf 9.9. Distributed Applications We have 3 nodes: n1@a2-X201, n2@a2-X201, n3@a2-X201 We have application wd that do some useful job :) Configuration files: wd1.config - for the first node: [{kernel, [{distributed,[{wd,5000,['n1@a2-X201',{'n2@a2-X201','n3@a2-X201'}]}]}, {sync_nodes_mandatory,['n2@a2-X201','n3@a2-X201']}, {sync_nodes_timeout,5000} ]} ,

How create a P2P web-chat without any server?

♀尐吖头ヾ 提交于 2019-12-18 13:07:20
问题 is there a way to create a P2P web-chat without any server ? 回答1: If you're willing to use Flash, check out Adobe Stratus, which allows for peer to peer data and video streaming. http://labs.adobe.com/technologies/stratus/ 回答2: Yes, but you must decide on a place to meet. If your friend send his ip over to you, you can connect. Then you only need to tell some more people to join. After some time you will get bigger and bigger. Then, if some link on the net fail, the cloud will be broken up in