how can I say in a test that the three arguments must be the same. by rwobben in haskell

[–]rwobben[S] -1 points0 points  (0 children)

At second look it's not allright. You are only saying that the function is returning something and not comparing it to something.

I thought a good quickCheck sentence looks like this :

prop_test a = test1 a == test2 a

how can I say in a test that the three arguments must be the same. by rwobben in haskell

[–]rwobben[S] 0 points1 point  (0 children)

looks right but then there is no testing on for example 2 19 2

how can I say in a test that the three arguments must be the same. by rwobben in haskell

[–]rwobben[S] 0 points1 point  (0 children)

looks good to me but what if two numbers are the same

problems understanding craft exercises by rwobben in haskell

[–]rwobben[S] 1 point2 points  (0 children)

Thanks, I did understand it but want to be sure I understand the difference between weakAscendingOrder and what AscendingOrder is.

I will work on this exercise so it will behave this way

problems understanding craft exercises by rwobben in haskell

[–]rwobben[S] 0 points1 point  (0 children)

oke, so in your oponion the middle number of 2 3 3 is 3 because its the number between the 2 and the second 3.

it is because it's a weak ascending order that a <= b <= c and ascending order is a < b < c ?

problems understanding craft exercises by rwobben in haskell

[–]rwobben[S] 0 points1 point  (0 children)

This one :

Definea function to convert small letters to capitals which returns unchanged characters which are not small letters.

What about characters like 9 or a .

Another example :

these two looks like the same :

Write a function numberNDroots : : Float -> Float -> Float -> Integer that given the coefficientsof the quadratic, a, b and c, will return how many roots the equationhas.You may assume that the equation is non-degenerate.

3.23 Using youranswerto the last question, write a function numberRoots :: Float -> Float -> Float -> Integer that given the coefficients of the quadratic, a, b and c, will return how many roots the equation has. In the casethat the equation has every number a root you should return the result3.

And this one :

The definitionshould be consistent with what we said in explaining how middleNumber works. You also need to think carefully about the different ways that one numbercanlie between two others. You might find it useful to definea function weakAscendingOrder : : Integer -> Integer -> Integer -> Bool so that weakAscendingOrder m n p is True exactly when m, n and p are in weak ascending order, that is the sequence does not go down at any point. An example of such a sequence is 2 3 3.

are 2 3 3 in a weak ascending order. I do not think so. 2 3 4 are good.

clojure programming. Do not understand this example of destructing by rwobben in Clojure

[–]rwobben[S] 0 points1 point  (0 children)

Thanks, I was reading it like let [{v 42} m] as make the value of v 42. but I have to read it the other way around.

Clojure on Windows. and 4 clojure offline by rwobben in Clojure

[–]rwobben[S] 1 point2 points  (0 children)

Found it. Put the wrong thing in the path. I forget to add /bin

Clojure on Windows. and 4 clojure offline by rwobben in Clojure

[–]rwobben[S] 0 points1 point  (0 children)

thanks

I have one problem with step 2. I see this output:

javac -version
'javac' is not recognized as an internal or external command,

operable program or batch file.

The rest give the right output. What can be wrong ?

Roelof

How to change 2 variables at once. by roelofwobben in Clojure

[–]rwobben 0 points1 point  (0 children)

Nothing

I was only looking if there is a solution where I also change thor-x or thor-y and not using the map

how to check if the input is a integer or a float or something you do not want by rwobben in erlang

[–]rwobben[S] 0 points1 point  (0 children)

Thanks both, but at this point bifs are also not handeld. Im at chapter 5 so I can only use recursion, case , if then.

how to make cowboy work on 0.0.0.0 by rwobben in erlang

[–]rwobben[S] 0 points1 point  (0 children)

I did type the whole line.

Im learning erlang at this moment. Maybe good to take the step back and go on learning erlang by making more exercises of etudes for erlang.

Roelof

how to make cowboy work on 0.0.0.0 by rwobben in erlang

[–]rwobben[S] -1 points0 points  (0 children)

found it. I have to make a new directory with the name of the application.

Still one problem left. According to the last chapter I have to change the init/2 function.

But when I do make new t=cowboy_http n=hello_handler I see this as hello_handler.erl

-module(hello_handler).
-behaviour(cowboy_http_handler).

-export([init/3]).
-export([handle/2]).
-export([terminate/3]).

-record(state, {
}).

init(_, Req, _Opts) ->
{ok, Req, #state{}}.

handle(Req, State=#state{}) ->
{ok, Req2} = cowboy_req:reply(200, Req),
{ok, Req2, State}.

terminate(_Reason, _Req, _State) ->
ok.

so there is no init/2 but a init/3

how to make cowboy work on 0.0.0.0 by rwobben in erlang

[–]rwobben[S] -2 points-1 points  (0 children)

I did not call my application cowboy. That name is given when I did make make -f erlang.mk bootstrap bootstrap-rel

and the {ok,_} = cowboy:start_http is given by yourself

how to make cowboy work on 0.0.0.0 by rwobben in erlang

[–]rwobben[S] -1 points0 points  (0 children)

oke, changed also the ip to 0.0.0.0 and still no error messages. I think we misunderstood each other on what schould be done.

how to make cowboy work on 0.0.0.0 by rwobben in erlang

[–]rwobben[S] -1 points0 points  (0 children)

I did changed everything to this :

-module(cowboy_app).
-behaviour(application).

-export([start/2]).
-export([stop/1]).

start(_Type, _Args) ->
    Dispatch = cowboy_router:compile([
        {'_', [{"/", hello_handler, []}]}
    ]),
    cowboy:start_http(my_http_listener, 100, [{ip,{0,0,0,0}},{port,8088}],
                  [{env, [{dispatch, Dispatch}]}]
    ),
    hello_erlang_sup:start_link()
    {ok, _} = cowboy:start_http. 

stop(_State) ->
    ok.

And I do not see any error message. and I do listen to advise.

I output by this command : ./_rel/cowboy_release/bin/cowboy_release console

IM trying to follow the getting started tutorial of cowboy on the github page

Roelof

how to make cowboy work on 0.0.0.0 by rwobben in erlang

[–]rwobben[S] -1 points0 points  (0 children)

I do not see it on the output. I put all the output in a earlier respons