erlang

[Erlang - trace] How to trace for all functions in an Erlang module except for one?

I wanted to trace for all functions in an erlang module, with dbg:tpl, but one of the internal functions took up 95% of the trace file. I then wanted to exclude only that single function and found that it was not as easy as I thought it would be. I know there are great pattern matching possibilities for arguments when tracing. Is ther...

Erlang: simple refactoring

Consider the code: f(command1, UserId) -> case is_registered(UserId) of true -> %% do command1 ok; false -> not_registered end; f(command2, UserId) -> case is_registered(UserId) of true -> %% do command2 ok; false -> not_...

Is F# a poor choice for a functional language

Hi, To me, I think F# is a bad choice due to the fact that it uses threads behind the scenes. To me, threads are too "heavy" due to things like context switching. I can see why Erlang is a good choice because it uses light weight processes. Am I wrong? Cheers Paul ...

Erlang: How can I remove a node from other nodes' nodes()?

I want to simulate the behavior of 'erl -sname example -hidden' but dynamically. How can I drop a node out of visibility in a cluster? See the comments by @mwt at @Yasir Arsanukaev for additional clarification of what I'm trying to do. ...

How do I do an HTTPS request with Erlang?

I tried the inets library but it timeouts. I don't think it supports https. I am trying to use ibrowse, but it isn't working. ...

Anyone know of an Erlang pubsubhubbub subscriber client?

Anyone know of an Erlang pubsubhubbub subscriber client? ...

Minimal deployment of couchdb on windows

Hi, I'd like to use couchdb for a client-only application on Windows (the document-oriented structure and the synchronization features would be perfect for me). There is a Windows installer package here, but the installer itself has about 45 MB, when installed it takes more than 100 MB on my HD. This is far to much for my (relatively s...

[Erlang] Changing working directory

Hello, I have Erlang installed on my WinXP machine. Becouse so, I use it by a "werl.exe". The problem is, that I would like to change a default folder that werl starts in. I cannot find option that would let me do that, although I know there must be something like that. Could anybody help ? ...

How do you install a module in erlang?

I am new to Erlang and would like to to know how to install third party modules for use in my web application. Where do you place this files and what sort of commands do you execute? ...

What is your experience with Nitrogen on Erlang?

I've been checking out the Nitrogen Project which is supposed to be the most mature web development framework for Erlang. Erlang, as a language, is extremely impressive. However, with regards to Nitrogen, what I am not too keen about is using Erlang's rather uncommon syntax (unless you're native in PROLOG) to build UIs. What is your ex...

Canonical pattern reference in Actors programming model.

Hello! Is there a source, which I could use to learn some of the most used and popular practices regarding Actor-/Agent-oriented programming? My primary concern is about parallelism and distribution limited to the mentioned scheme - Actors, message passing. Should I begin with Erlang documentation or maybe there is any kind of book t...

Mochiweb's Scalability Features

From all the articles I've read so far about Mochiweb, I've heard this over and over again that Mochiweb provides very good scalability. My question is, how exactly does Mochiweb get its scalability property? Is it from Erlang's inherent scalability properties or does Mochiweb have any additional code that explicitly enables it to scale ...

Want to add a functional language to my toolchest. Haskell or Erlang?

I've been an OO/procedural guy my whole career except in school where I did a lot of logic programming (Prolog). I work on an amazing variety of projects (freelancer) and so I don't want the tools I know and understand to hold me back from using the right tool for the job. I've decided I should know a functional programming language. I'...

Erlang : Handling HTTP Requests and Responses

What is the best erlang library for processing http requests and responses from within an erlang application? I have taken a look at inets but as a standalone application, it seems more like a replacement for curl. I would like to access external APIs from within the erlang application so would need to parse responses and be able to ma...

Erlang: How do you send yourself a handle_info message?

Other than timer:send_after(0, message), is there a way to send a gen_server a handle_info message? ...

Erlang: Interfacing with Xalan: port driver or nif?

I'd like to get a real XSLT processor working with erlang. Which would be the best interface, nif or port driver? According to the nif documentation, nif calls block the runtime, so they should not take long. Is processing a long xml document too long? Also, I'd like to allow erlang callbacks during the transformation. Does that seem po...

Erlang Mnesia Equivalent of SQL Select FROM WHERE Field IN (value1, value2, value3, ...)

I have an mnesia table with fields say f1, f2, f3. Now if I were to select all the rows with the field value as V1, I would use mnesia:select and match specifications or a simple mnesia:match_object. Now I need to select all the rows which have V1, V2, V3 ... or Vn (a list of arbitrary length) as the value for field f1. In SQL I would do...

Erlang : flattening a list of strings

I have a list like this: [["str1","str2"],["str3","str4"],["str5","str6"]] And I need to convert it to ["str1", "str2", "str3", "str4", "str5", "str6"] How do I do this? The problem is that I'm dealing with lists of strings, so when I do lists:flatten([["str1","str2"],["str3","str4"],["str5","str6"]]) I get "str1str2str3str4...

Starting an Erlang slave node in escript fails when using custom Erlang in Ubuntu 10.4

I have the following escript: #!/usr/bin/env escript %%! -name [email protected] main(_) -> NodeName = test, Host = '127.0.0.1', Args = "", {ok, _Node} = slave:start_link(Host, NodeName, Args), io:format("Node started successfully!"). When running it on Ubuntu 10.04 I get this: $ ./start_slave Node started ...

Erlang message loops

How does message loops in erlang work, are they sync when it comes to processing messages? As far as I understand, the loop will start by "receive"ing a message and then perform something and hit another iteration of the loop. So that has to be sync? right? If multiple clients send messages to the same message loop, then all those mes...