Again, I stumbled upon a Brainfuck question, and I wondered, do any of its compilers/interpreters provide a way to access some API (the system one, or individual functions from a dll, and so on)?
Note: I already asked about APIs provided directly by the compiler/interpreter in this other question.
As Thomas Jager pointed out , yes, systemf provides access to Linux syscalls.
Related
So I stumbled upon a Brainfuck question, and I wondered, do any of its compilers/interpreters provide an API?
I'll make a separate question about accessing other APIs.
In pure Brainfuck, there won't be anything, unless you write your own interpreter that uses specific chunks of memory for this.
One project that may interest you is ajyoon/systemf, an interpreter where you can make Linux system calls using a special ninth character.
EDIT: I ended up answering the wrong question of the asker, this is more an answer to the other one.
I have been provided with a WebService with a REST Interface, implemented as a DLL.The documentation is really poor, and does not detail all the possible parameters.
Is there any way to get all the parameters that the DLL can accept without disassembling the DLL(something like a man function)?
Thanks a lot for your help!
In general you can't.
Of course you can list all functions with DLL Export Viewer and hope that you will find something like man function. But most probably you should use trial and error method here. Call functions and examine what they do.
PS: if there's a way to obtain documentation or source code, it will be the most correct way.
The short answer is "very unlikely". It really depends on how those services were implemented. If they really are REST, they should comply with the HATEOAS principle, so you should theoretically be able to navigate all the services just by following links provided by the responses. If this is true, all you need to know is the entry point of the services.
Or, there could be a WADL describing the service 'topology' (https://en.wikipedia.org/wiki/Web_Application_Description_Language).
On the other hand, if the services were not implemented this way (I won't say 'properly', but..), I am afraid you don't have many options apart from diving into the implementation.
We are thinking about writing a softphone app. It would basically be a component of a system that has calls queued up from a database. It would interface with a LINUX server which has Asterisk installed.
My first question is
Whether we should write the softphone at all or just buy one?
Secondly, if we do,
what base libraries should be use?
I see SIP Sorcery on CodePlex. More than anything, I am looking for a sense of direction here. Any comments or recommendations would be appreciated.
The answer would depend on the capabilities you have in your team and the place you see your core value and the essence of the service you provide.
In most cases, I'd guess that you don't really care about SIP or doing anything fancy with it that require access to its low level. In such a case, I'd recommend getting a ready-made softphone - either a commercial one or an open source one. I'd go for a commercial one, as it will give you the peace of mind as to its stability and assistance with bug fixing and stuff.
To directly answer your question, one of the many open source softphones are likely to fit your needs, and allow slight modifications as needed. Under most open source licenses there is no obligation to distribute your code as long as you only use it internally (do not distribute the binary.)
Trying to guess what you are trying to do, it sounds like a call center like scenario, so one of the many call queue implementations out there might fit your needs.
I had to write an own softphone and I found a great guide how to achieve it. In the guide there are 10 steps provided for having an own softphone (voip-sip-sdk.com on page 272)
I found it useful and maybe you will find it as well.
How do I implement activesync protocol in iphone app?
Any advice, any docs and tutorials are well come.
I have read the Exchange ActiveSync and iOS 4 Devices from apple.
Is there any real docs for this?
Despite having asked a question in the comment, you might be looking for the Microsoft documentation of the Exchange Server Protocols.
If you're thinking of implementing your own client though, I would strongly advise you to pause and consider whether it's really worth it. As someone who's worked on a server-side implementation of these protocols, I can tell you they can get pretty complicated - and the documentation doesn't always give you enough information. (In some areas it's flat out wrong, too.)
It is hard, but not impossible to write an app which communicates via exchange active sync. The link to the Exchange Server Protocols in Jons answer contains a document named MS-ASWBXML. You have to write an encoder for wbxml on your own and the document describes clearly the needs. Additionaly I recommend strongly this document: http://www.w3.org/TR/wbxml/
If the low level is working, you have to implement the EAS-protocol on top ob wbxml, which is not trivial, because of bugs in the documentation, different behaviour of different protocol versions. It will be a lot of trial an error to examine, why the exchange server does not understand your requests ;-)
Using Apple's built in support just means using Apple's APIs for writing to the Address Book and Calendar Store on the phone. Your app isn't supposed to know anything about the way that data is synchronised: it just happens in the background.
If you want direct control over the synchronisation process, then Apple's APIs cannot help you. Jon Skeet's answer contains a link to Microsoft's protocol documentation, but as he mentioned you'll be setting yourself up for a world of pain.
EAS is really meant for device makers to implement and not normal application development. You should look over the ActiveSync Protocol documentation and look into licensing the protocol (yeah its a pay-for license) and then ask yourself if its worth all the trouble to write all the business logic, ecoding logic, intensive testing and the licensing. An alternative is to use Exchange Web Services (EWS), which might be a much better fit - more rhobust in many areas and no licensing needed.
You should also look at this: http://blogs.msdn.com/b/webdav_101/archive/2011/09/29/new-to-exchange-activesync-development.aspx
I am looking into something lightweight, that, at a minimum should support the following features:
Support for easy definition of actions through metadata
Wrapper that extracts parameters from request into clojure map, or as function parameters
Support for multiple forms of authentication (basic, form, cookie)
basic authorization based of api method metadata
session object wrapped in clojure map
live coding from REPL (no need to restart server)
automatic serialization of return value to json and xml
have nice (pluggable) url parameter handling (eg /action/par1/par2 instead of /action?par1=val1&par2=val2)
I know it is relatively easy to roll my own micro-framework for each one of these options, but why reinvent the wheel if something like that already exists? Especially if it is:
Active project with rising number of contributors/users
Have at least basic documentation and tutorial online.
First of all, I think that you are unlikely to find a single shrinkwrapped solution to do all this in Clojure (except in the form of a Java library to be used through interop). What is becoming Clojure's standard Web stack comprises a number of libraries which people mix and match in all sorts of ways (since they happily tend to be perfectly compatible).1
Here's a list of some building blocks which you might find useful:
Ring -- Clojure's basic HTTP request handling library; all the other webby libraries (for writing routes &c.) that I know of are compatible with Ring. Ring is being actively developed, has a robust community, is very well-written and has a nice SPEC document detailing its design philosophy. This blog post provides a nice example of how it might be used (reacting to GitHub commits).
Sandbar -- currently an authentication library, more types of functionality planned; under development.
Compojure -- a mature and robust library which provides a nice DSL for writing routes to be used on top of Ring. This will give you the nice URL parameter handling.
Compojure-rest -- "a library for building RESTful applications on top of Compojure". Compojure-rest is, as far as I can tell, in its early stages of development; perhaps you might see this as an opportunity to influence its design. :-)
For dealing with XML, there's clojure.contrib.lazy-xml (and the helper library clojure.contrib.zip-filter.xml) and Enlive (the built-in clojure.xml namespace is currently not very usable); these would be used in tandem (though for your purposes the former might suffice).
For JSON, there a library in contrib and clojure-json (and I think there was at least one other lib I seem to be forgetting now...); pick the one you like best.
All of will be perfectly happy with a REPL-driven development style (see the accepted answer to this SO question for a Ring trick which is very much to the purpose here). I suppose the above collection of links does leave a few blind spots (in particular, the authentication story is still being ironed out, as far as I can tell), but hopefully it's a good start.
1The only single-package solution for building webapps in Clojure that I know of is Conjure, inspired by Rails; unfortunately I have to admit that I don't know much about it, so if you feel interested, follow the link and look around the sources, wiki &c.
While building my first Clojure rest service I found myself asking often the same question. The Clojure Toolbox helped me a lot: http://www.clojure-toolbox.com/
If you are looking for some sample, real-world, illustrative code to get you started, then you could study this clojure-news-feed on github project which demonstrates how to implement a non-trivial RESTful web service with compojure/ring that wraps both SQL (postgresql or mysql) and NoSQL (cassandra), search (solr), caching (redis), event logging (kafka), connection pooling (c3po), and real-time metrics via JMX.
This blog about Building a Scalable News Feed Web Service in Clojure provides a good introduction. I ran some load tests against this service on a humble AWS deployment and got about eighty transactions per second with less than a half second average latency per transaction.
Take a look at liberator library http://clojure-liberator.github.io/liberator/ It's noy a standalone solution, buy very good for rest service definition.
Just to provide an updated answer to this old question, currently (in 2018) I think Luminus provides an excellent starting point. It's using many of the libraries (ring, compojure, etc.) mentioned in previous answers, is modular and as close to "single package" as you can get with Clojure. Specifically for REST, take a look at compojure-api. Luminus recommends buddy for authentication, I've had good success using it both for traditional session-based auth as well as Oauth and stateless JWTs.