You are wrapping a statelss REST API, I don't see why you need a gen_server here to wrap httpc:request calls. Just call httpc:request from within lookup_account, outbound_call, etc (you'll have to pass AccountSid and AuthToken as arguments every time, though). And while at that, don't use httpc. Use ibrowse instead (https://github.com/cmullaparthi/ibrowse).
Can't help you with your other questions right now (no time), but will be able to next friday-saturday. PM me if you'll still be needing advice by that time.
Changes (some copied from rc1 not necessarily just in rc2):
maps, maps, maps (docs here: https://www.erlang.org/eeps/eep-0043.html)
The default encoding of Erlang files has been changed from ISO-8859-1 to UTF-8.
{active,N} options for sockets
Experimental "dirty schedulers" functionality (good for those writing NIFs)
Funs can now be given names
A new versioning scheme (if you couldn't tell by the title)
Welcome to erlang!
I just started an erlang API last night for Spreedly. You may want to check it out as a guide.
https://github.com/roder/spreerly/blob/master/src/spreedly.erl
And some previous work: https://github.com/roder/chargify
I agree with the previous points on using ibrowse and not using a gen_server. For XML look into xmerl and erlsom, for json I'm interested in github.com/davisp/jiffy. You should use rebar as well.
You might be interested to look at my chatserver on github, its fairly complete and well-tested, and allows for pluggable chat-protocols and transport layers et cetera: click. When I get back home later today I shall look somewhat closer at your code and see if I can find anything that could break.
If you look at the documentation for file:open/2, you will see that it returns either {ok, IoDevice}
or {error, Reason}
. Your code tried to use f
on the left side of the equals. In Erlang, f
is an atom. You need to remember that variables start with an upper case letter in Erlang, or F
in this case.
But then you are unable to pass that directly into file:write/2
because the open function returned {ok, IoDevice}
, you will need to pattern match in order to get the file. The following code should work for you
{ok, F} = file:open("targetfile", [write]), file:write(F, "on no"), file:close(F).
With that said, I don't know if that will help you with the CVE.
I've had a couple of people recently ask me about the exchange software about Smarkets so I wrote about one of the systems I still remember. I've poked the Smarkets team about writing more technical articles. I also just noticed that their web framework is now on github: https://github.com/skarab/smak
Datastorage on blockchain may not be feasible, but you could use it to store contract who has the responsibility to store you data.
See sia: https://sia.tech/
Useful project, product works (although when I tried it ~6months ago it was minimal in terms of usefulness)
> smells a little bit
What is wrong with a HTTP 304 Not Modified status code?
> you'll need to introduce additional route.
introducing things on top of standards is what smells a little bit.
Also for interest sake. If you are only doing the backend; and only give your frontend dev backbone; expect a lot of polls.
Toxic can mean a variety of things. Unhelpful, harsh to newcomers, mean spirited, snide remarks, many things can contribute to making something or a group of people "Toxic".
Better Syntax is kind of just all over the place tbh...I'd have to point you towards http://elixir-lang.org/getting-started/introduction.html :/
At a glance places of interest seem to be Sigils, Tasks, Agents, and Metaprogramming.
I'm not really aware of any non-trivial examples, perhaps the OCaml LLVM tutorial comes reasonably close. Though I'd build things somewhat differently to how they describe there. Certainly Erlang examples are even fewer and now that I realise, which reddit I'm in I perhaps should revise my example.
Do you have an application area that would be particularly helpful?
Good post. Thanks.
I also found this: https://github.com/kato-im/ejwt
Haven't test or use any of them yet. Note that there is a vulnerability in some jwt implementations: https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/
https://stackedit.io/editor works nice and support erl code highlighting. See it supports Blogger exporting, but don't know how well it works.
Also don't let the "hello" example page scare you. Open a new Document from the right top tap and start with basic markdown. especially ```erl... you code example here!
Let me know when part 3 is out.
You want to look at Vagrant [0]. Many people will already have Virtualbox installed and it is a simple install for those who don't, and Vagrant is pretty easy to install. Once that is done getting a VM up and running, including automatically installing whatever packages are needed, is just a single command.
Another option would be a Virtualbox appliance [1], which would only require Virtualbox to be installed, which is basically trivial to install. You could pre-install Erlang and whatever else you need (even some sample code) into the appliance so it would be ready to go the moment they booted it up.
[0] https://www.vagrantup.com/ [1] http://www.virtualbox.org/manual/ch01.html#ovf
Chat application should be process in realtime. In this scenario, Erlang is agile to adapting to instant updates and hot fixes. Mnesia DB handles the heavy-duty task of database management. Mnesia is a multiuser distributed DBMS which also happens to be the default DB of ERLANG. Mnesia helps achieve quicker request responses, thereby improving the overall efficiency.
​
PS: I am from Mirrorfly, we are readily built solution using Erlang for web, Android & iOS platforms.