erlang

erlang init error using tsung-recorder

I have setup Tsung to do some load testing on an ubuntu VM. Tsung itself works fine if I write the setup scripts by hand, but I would like to use tsung-recorder to build my scripts dynamically through the browser. When I start tsung-recorder I get the following error, however: cpjolicoeur@vbox-ubuntu-koala:~$ tsung-recorder start Star...

How to determining why an Erlang application is not starting?

I'm trying to start an Erlang app that is failing. All I see in the shell is: =INFO REPORT==== 7-Jan-2010::17:37:42 === application: ui exited: {shutdown,{ui_app,start,[normal,[]]}} type: temporary How can I get Erlang to give me more information as to why the application is not starting? There currently is no other output...

Erlang, Is it necessary to close the file here?

When using file:read_file(x) is it necessary to close the returned file? {ok, File} = file:read_file("maillog.sample"), file:close(File), ...

Call Erlang from Ruby

What is the most awesome gem I should use to call Erlang functions from Ruby app? I wish to use rspec for testing some gen_server stuff. Erlectricity looking solid, but there is no something like Node#rpc, just message passing. Any ideas? ...

How do I disable debug checks in yaws?

When i start yaws (yaws -i --conf config/yaws.conf) i get this line in the output: Running with debug checks turned on (slower server) It depends on the "-i" option? Or where did i turned on debug checks? No mention of debug in the config file... thx edoardo ...

Running An Erlang Escript File With SSL Distribution

I have a little escript file that connects to a node and does some rpc calls and stuff... It works fine for short or longnames but relies on standard http comms for distributed Erlang. I would like to use it but with https/SSL for distribution. To start a 'normal' Erlang system with SSL you have to pass in the various flags to tell Er...

How to measure time a function takes to execute from an erlang shell?

Is there is a simple way to measure a function's execution time if I run that function from an erlang shell? ...

How to handle authenticated user access to resources in document oriented system?

I'm developing a document oriented application and need to manage user access to the documents. I have a module that handles user authentication, and another module that handles document CRUD operations on the data store. Once a user is authenticated I need to enforce what operations the user can and cannot perform to documents based upo...

Erlang mysql example

Just wondering if anyone could give a working example of using the erlang-mysql module (http://code.google.com/p/erlang-mysql-driver/). I am new to erlang and I am trying to replace some old scripts with a few erlang batch processes. I am able to connect to the DB and even complete a query, but I am not sure how I use the results. Her...

Defining erlang functions in the shell

Is there any way to define an Erlang function from within the Erlang shell instead of from an erl file? ...

Erlang and method_missing

I come from a Java and Ruby background and I was wondering if there is any equivalent of "method_missing" in Erlang. I have looked at the documentation and the closest I can see is the use of erl_eval and erl_parse, but I wanted to know if there is any other way? ...

Erlang : Mnesia : Is it safe to remove files with prefix _fs?

I have a couple of files in mnesia directory, like fs_my@node_14585_1263_545605_962084.273 fs_my@node_14702_1263_545842_879762.273 fs_my@node_14585_1263_545605_962084.290 ... Can I remove them (because it is big files) without risk to lose data? Why does these files apear? What are these files for? Is it safe to remove them? ...

Erlang VM -s argument misbehaving

When I start up a function within the erl shell, it works fine. When I try to invoke the same function with erl ... -s module function, it fails. The line of code that eventually fails is: start(Port) -> mochiweb_http:start([{port, Port}, {loop, fun dispatch_requests/1}]). I'm positive that Port is set correctly. My error message...

How can I specify the type of a bit string through a variable

Erlang doesn't let me do: Type = bitstring. <<FirstPart:8/Type, Rest/bitstring>> = some_binary. although it lets me do: Size = 8. <<FirstPart:Size/bitstring, Rest/bitstring>> = some_binary. So, in bit string expressions, while I can pass the size through a variable, It doesnt let me pass the type through a variable. Is there any ...

Sinatra style web framework for Erlang

Hi, I programmed in Ruby and Rails for quite a long time, and then I fell in love with the simplicity of the Sinatra framework which allowed me to build one page web applications. Is there a web framework like Sinatra available for Erlang? I tried Erlyweb but it seems far too heavyweight ...

Erlang: How should I test this?

I've got an application where I cast a message to a gen_server to start an operation, then I call the gen_server every second to gather intermediate results until the operation completes. In production, it usually takes a couple of minutes, but it's only limited by the input size and I'd like to test hour long operations, too. I want t...

How do I get pages like src/pages/myrootpage.erl to show up at http://mysite.org/myrootpage using nitrogen?

Nitrogen does not seem to like pages being at the root url path, only addon paths like /web/ is there some way to get pages to show up at the root url like /mypage ? ...

Building a mutliplayer game site

I am building a site that has a lot in common with a person-on-person chess site. I was thinking of using Rails for the front-end(User Registration, Navigation, etc) and something like Scala or Erlang for the engine(Game state and maybe AI). I was wondering - Is this a good situation to use that type of design? How exactly would be be...

How to get Peer IP Address in Nitrogen

Is is there a built in function in nitrogen framework to get Peer IP address? If not, is there a way to get the IP address of peer which is making to request to Nitrogen App ...

Generating an RSA Key Pair with Erlang?

Erlang has a crypto function which generates public private keys (documentation copied below). However the documentation seems vague and I can't find any example code that describes how to generate the shared prime number or the generator. Can someone post an example that generates a public/private key pair? Thanks in advance for any ...