erlang,websocket,cowboyView the original page-Collection of common programming errors

UnKnown Error


  • Gilles
    recursion erlang fold 2014-2-17 0:49:20
    According to Learn you some Erlang :Pretty much any function you can think of that reduces lists to 1 element can be expressed as a fold. […]This means fold is universal in the sense that you can implement pretty much any other recursive function on lists with a foldMy first thought when writing a function that takes a lists and reduces it to 1 element is to use recursion. What are the guidelines that should help me decide whether to use recursion or a fold?Is this a stylistic consideration or

  • alexey
    c# .net concurrency erlang lightweight-processes 2014-2-16 21:29:07
    Is there any way to implement Erlang-style light-weight processes in .NET?I found some projects that implement Erlang messaging model (actors model). For example, Axum. But I found nothing about light-weight processes implementation. I mean multiple processes that run in a context of a single OS-thread or OS-process.

  • Isac
    erlang 2014-2-16 16:21:39
    I’m looking for an automatic way to do my load balance and this module attracted me.As the manual says,pool can be used to run a set of Erlang nodes as a pool of computational processors. It is organized as a master and a set of slave nodes and includes the following features:The slave nodes send regular reports to the master about their current load.Queries can be sent to the master to determine which node will have the least load.The BIF statistics(run_queue) is used for estimating future load

  • mwt
    erlang 2014-2-16 15:01:31
    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 possible? Possible with nif but not port drivers or vice versa?I’ve never written any C, so I figured this would be good introduction. Xalan is C++. I assume nif can

  • viraptor
    erlang record 2014-2-16 1:12:18
    I’d like to create a record from a list of attributes – not the actual proplist, but for example from #xmlElement attributes. I’ve got a list of elements which I need to process and a list of possible attributes.I could of course do something like:create_record(Rec, [{attr1, Val}|As]) -> create_record(Rec#blah{attr1 = Val}, As); create_record(Rec, [{attr2, Val}|As]) -> create_record(Rec#blah{attr2 = Val}, As); …But that’s going to be a bit long and I already have the list of possible att

  • Yasir Arsanukaev
    erlang otp 2014-2-14 10:54:22
    I am working over solution to a problem, which requires changes in one of the functions of module gb_trees.I am getting an error compiling the edited version of gb_trees:1> c(gb_trees). cannot write to .bea# … 2>What’s the way I can make changes and compile an already existing module?

  • Rob Lachlan
    multithreading erlang parallel-processing lightweight-processes 2014-2-14 8:12:28
    Erlang is known for being able to support MANY lightweight processes; it can do this because these are not processes in the traditional sense, or even threads like in P-threads, but threads entirely in user space.This is well and good (fantastic actually). But how then are Erlang threads executed in parallel in a multicore/multiprocessor environment? Surely they have to somehow be mapped to kernel threads in order to be executed on separate cores? Assuming that that’s the case, how is this do

  • Alan
    multithreading erlang beam 2014-2-14 6:29:18
    I’ve begun studying Erlang and find the BEAM runtime environment fascinating. It’s commonly stated that in Erlang, processes belong to the language rather than the OS (meaning the runtime, meaning BEAM in this case). These are the lightweight, “green processes” that Erlang is getting famous for. It’s further stated (on page 5 of this paper) that BEAM uses one (1) OS thread per CPU core for scheduling and another OS thread for i/o. So I wonder: From what thread do the CPU cycles needed to actual

  • Paul Delhanty
    haskell functional-programming erlang garbage-collection ghc 2014-2-14 4:32:53
    If you’ve bought into the functional programming paradigm, the chances are that you like both Erlang and Haskell. Both have purely functional cores and other goodness such as lightweight threads that make them a good fit for a multicore world. But there are some differences too.Erlang is a commercially proven fault-tolerant language with a mature distribution model. It has a seemingly unique feature in its ability to upgrade its version at runtime via hot code loading. (Way cool!)Haskell, on

  • Anthony Kong
    osx erlang homebrew osx-mavericks 2014-2-14 0:33:32
    I can see the following error report when I start up the debugger.2> debugger:start().=ERROR REPORT==== 23-Jan-2014::11:59:08 === ERROR: Could not find ‘wxe_driver.so’ in: /usr/local/Cellar/erlang/R16B03/lib/erlang/lib/wx-1.1.1/priv {ok,<0.42.0>}The debugger window still starts despite the error report.Why the error? Will it cause debugger problem down the road?Erlang runtime is installed by homebrew. Version number is R16B03

  • noviceCodder
    java javascript eclipse websocket glassfish 2014-2-14 0:13:15
    I am trying to run websocket example.My client code is this<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”><html> <head><meta http-equiv=”Content-Type” content=”text/html; charset=ISO-8859-1″><title>Web Socket Implementation</title> </head> <body><form><input id=”textmessage” type=”text”><input onclick=”sendmessage();” value=”Send Message” type=”button”></form> <br

  • Jason
    websocket tomcat7 2014-2-13 10:59:58
    I’m trying to make my own chat client using websockets and thought I would start out with the Tomcat 7 websocket chat example code.. I have successfully compiled and deployed the ChatAnnotation class with Eclipse, but when I redirect the chat.html file to what I think the endpoint should be, nothing happens.In the sample class, they have a @ServerEndpoint(value = “/websocket/chat”) annotation and I’m not sure what I need to do (i.e. in the web.xml) to get that class to load on server start up an

  • kanaka
    javascript ssh node.js websocket 2014-2-6 13:18:20
    Ok so I have read through the Socket.IO docs and I am still a little unsure of a couple of points:The documentation says…To run the demo, execute the following:git clone git://github.com/LearnBoost/Socket.IO-node.git socket.io cd socket.io/example/ sudo node server.jsNow I don’t know what this means at all! I think it may be command line interface. I of course have access to this on my localhost, but my online hosting package is a shared LAMP setup. Meaning I don’t have access to the root comm

  • chilly
    java glassfish websocket glassfish-3 atmosphere 2014-2-1 17:36:27
    I got the chat example working from Atmosphere, and now I want to get the session, but I get a null pointer exception. My configuration:GlassFish 3.1.2 Atmosphere 1.0.0-SNAPSHOTMy ChatAtmosphereHandler.java file: @Override public void onRequest(AtmosphereResource r) throws IOException {AtmosphereRequest req = r.getRequest();// First, tell Atmosphere to allow bi-directional communication by suspending.if (req.getMethod().equalsIgnoreCase(“GET”)) {/* ——- ADDED LINES BY ME ——- */double i =

  • matthias krull
    websocket go 2014-1-31 17:48:15
    I want to create a websocket client that waits until the server is running. If the connection is closed by the server it should reconnect.What I tried does not work and my code exits with a runtime error:panic: runtime error: invalid memory address or nil pointer dereferencefunc run() {origin := “http://localhost:8080/”url := “ws://localhost:8080/ws”ws, err := websocket.Dial(url, “”, origin)if err != nil {fmt.Println(“Connection fails, is being re-connection”)main()}if _, err := ws.Write([]byte(

  • refaelos
    ruby sinatra websocket eventmachine padrino 2014-1-30 0:23:18
    i’m looking for a way to open and use websockets from within a Padrino application. i know Padrino works with a single thread but i’m looking for a way to open websockets and share variables between its “onopen” “onclose” “onmessage” methods and Padrino controllers.any idea how it’s done ?links i looked into:Examples of Eventmachine usage with Padrino and Sinatra (only Sinatra worked for me) em-websocket on GitHubUPDATE 1: this is my main.rb:require ‘rubygems’ # <– Added this require re

  • Abdennour Toumi
    java-ee grails websocket client-side server-side 2014-1-24 18:37:10
    i fail to build a app that implements websockets via Atmosphere grails plugin for the following reasons ; Chat sample isn’t available https://github.com/Atmosphere/atmosphere/tree/master/samples/chat Confusion in choosing the suitable dependencies :runtime ‘org.atmosphere:atmosphere-spade-server:jar:0.6.3’orruntime ‘org.atmosphere:atmosphere-compat-tomcat:2.0.1’orruntime ‘org.atmosphere:atmosphere-runtime:bundle:2.0.3’orruntime(‘org.atmosphere:atmosphere-jgroups:0.7’) { exclude ‘slf4j-api’ }Thi

  • abatishchev
    javascript jquery .net asp.net-mvc websocket 2014-1-22 16:11:44
    For some reason I am getting version 1.8.2 of jQuery added to my solution even though there is no reference to it anywhere. Only 1.9.1 in the scripts. The code to add it is:bundles.Add(new ScriptBundle(“~/bundles/jquery”).Include(“~/Scripts/jquery-{version}.js”));Things seem to work fine. I also have these errors in the console. Any ideas? Exception was thrown at line 5288, column 6 in http://xxx:7000/Scripts/jquery-1.8.2.js 0x800a139e – JavaScript runtime error: SyntaxError Exception was thrown

  • Shivam Jaiswal
    scala playframework websocket 2014-1-12 23:55:12
    Hye Geeks. I am coding for a live notification module in my project. I am tyring to call WebSocket Action method from a function to pass the notification data over the connection to the client. Here’s my code..def liveNotification(data: String) = WebSocket.using[JsValue] { implicit request =>val iteratee = Iteratee.ignore[JsValue]val enumerator = Enumerator[JsValue](Json.toJson(data))(iteratee,enumerator) }def createNotification(notificationTo: BigInteger, notiParams:Tuple5[String,String,Bi

  • Khalid Saifullah
    playframework http-headers websocket 2014-1-9 22:37:34
    I am using code from this example to get client’s browser info. But the key user-agent is available only for Firefox for my case, there is no key available for Chrome or Safari for this key. So, I am getting None object for Chrome or Safari. Can anyone please provide a generic way to get information like browser name, version etc from a Play! controllers?UpdateI am using Websocket protocol, not http (though they are similar in many ways) and I am using Play 2.1.0 (using Java 1.7.0_17 and Scala 2

  • nmichaels
    erlang otp rebar cowboy 2014-1-22 22:07:42
    I’m building a server with cowboy, and I’ve got some static HTML pages that I want to serve. Is there an OTP friendly place to put that sort of thing? Is there an established way to tell rebar where to look for this sort of thing?

  • John Doe
    erlang webserver cowboy 2013-12-17 11:28:05
    Trying out Cowboy (Erlang) http library, helloworld example: https://github.com/extend/cowboy/tree/master/examples/hello_worldWhen using Apache’s “ab” testing tool in this manner, I get “connection reset”:d7 ~/cb/cowboy/examples/hello_world % !564 ab -n 30000 -c 5000 http://127.0.0.1:8080/ This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/Benchmark

  • mattk
    erlang undef cowboy 2013-10-20 3:14:29
    I am trying to run a custom application but get multiple errors. I believe the main egs app gets an error because it calls the egs patch app which has an undefined type. I cant figure out how to get this working I have tried recompiling the code many times in regards to others with a similar problem but nothing seems to work. The cowboy start listener remains undefined.This is the error I receive.=CRASH REPORT==== 10-Apr-2013::21:02:00 ===crasher:initial call: application_master:init/4pid: <0

  • sibbl
    erlang webserver cowboy 2013-9-29 18:03:32
    I am currently playing around with minimal web servers, like Cowboy. I want to pass a number in the URL, load lines of a file, sort these lines and print the element in the middle to test IO and sorting. So the code loads the path like /123, makes a padded “00123” out of the number, loads the file “input00123.txt” and sorts its content and then returns something like “input00123.txt 0.50000”.At the sime time I have a test tool which makes 50 simultaneous requests, where only 2 get answered, t

  • user601836
    erlang websocket cowboy 2013-8-20 6:52:06
    I have seen many examples of chat room systems over websocket implemented with erlang and cowboy. Most of the examples I have seen use gproc. In practice each websocket handler registers itself with gproc and then broadcasts/receives messages from it.Since a user could close by accident the webpage I am thinking about connecting to the websocket handler a gen_fsm which actually broadcasts/receives all the messages from gproc. In this way the gen_fsm could switch from a “connected” state to a “di

  • couchemar
    rest erlang cowboy 2013-8-13 1:50:27
    How can I enable CORS for cowboy rest handler? I tried to add options/2 method, like this:options(Req, State) ->{[{<<“access-control-allow-origin”>>, <<“*”>>},{<<“access-control-allow-methods”>>, <<“GET, OPTIONS”>>}], Req, State}.but this causes errors like:Error in process <0.263.0> with exit value: {{case_clause,{[{<<27 bytes>>,<<1 byte>>},{<<28 bytes>>,<<12 bytes>>}],{http_req,#Port<0.2

  • Max Grigoriev
    erlang cowboy 2013-8-11 3:54:45
    How can I set status code in my REST POST resource.Now I’m doing this make_post(Req, State) ->lager:info(“post”),Resp = cowboy_req:set_resp_body(<<“HELLO POST\n”>>, Req),{ok, Resp3} = cowboy_req:reply(201, Resp),{true, Resp3, State}.But I receive such errors:1:43:10.510 [info] [nonode@nohost#pbshare_logic_registration#<0.205.0>] [handle_info#35] :Exit Logic from <0.204.0> Reason: {function_clause,[{cowboy_req,reply,[204,[],<<>>,{http_req,#Port<0.6355>,ranch_tcp,kee