Thrift or RestKit for iOS Application - restkit

Can anybody provide some input whether we should use Apache Thrift OR RestKit(or something similar) to access/send the data from my iOS application to server and vice-versa. Any pros and cons of using one or the other.

Seems like you're trying to compare apples to oranges. Thrift and RestKit really have nothing to do with each other. If you want to use RestKit, you will need to use a backend services framework that allows you to easily create REST services for your iOS client to consume.
RestKit is an RESTful HTTP framework that allows you to send and retrieve data from an endpoint without manually managing the converting of data from one format to another. With RestKit you define relational mappings up front, then pull down data that RestKit -- using the mappings you've defined -- will then parse (generally JSON or XML format) and load into your objective-c objects.
More resources for you:
Difference between Thrift , JSON and REST
Using Thrift for Objective-C
RestKit vs ASIHTTPRequest vs AFNetworking
Hope that helps.

Related

Download pdf file to blob storage in data factory

How can I in a datafactory pipeline download a pdf file(or any type of file)? to a blob storage , this file are searching throutgh an api but they are in base 64
Not very sure which API you download the pdf file from, you could think about these connectors in Data Factory:
REST connector specifically support copying data from RESTful APIs;
HTTP connector is generic to retrieve data from any HTTP endpoint,
e.g. to download file. Before REST connector becomes available, you
may happen to use the HTTP connector to copy data from RESTful API,
which is supported but less functional comparing to REST connector.
Web table connector extracts table content from an HTML webpage.
These may achieve your request.
Update:
At last now, you decided to choose Logic app to do it for cost concerns:
"During the weekend I was trying to do this by DataFlow, but
unfortunately it is not possible to do this type of integration by
Data Factory, for this reason I will have to make a small logic app
that allows me to do it, I do it by logic app because it is what
represents the lowest cost to me."

CoAP support for twitter heron

I'm working on IoT project where I receive datastream in CoAP protocol.
I want to process the data in Heron by doing some transformations on top of it.
Is it possible to integrate CoAP protocol objects to heron?
I think it is not very important from the CoAP endpoint's view where do you put the received data.
Use this link as a initial point:
http://coap.technology/impls.html
There you can find brief descriptions for implementations for several languages/platforms.
Unfortunately, I am not familiar with Twitter Heron and don't know which language is best for implementing a Heron data provider.
If such language is Java or Heron is language-agnostic (say, has a REST API as a primary interface) - I'd consider the https://eclipse.org/californium/ as a very mature implementation. That way (sure in 5000ft view as I don't know the details) you could write an app which uses Californium and CoapHandlers might push data to Heron.

Nativescript mapserver maps

Any ideas how to start with MapServer with NativeScript. I don't have necessary skills yet to make own plugin but I must try if nothing else is found.
Does anyone know any resources to get started implementing mapserver maps for nativescript. Plugin, code anything.
I assume you have an application using NativeScript framework and you want to include some map services from MapServer.
If that is the case, you may not need to write your own plugin but you still do some level of coding to achieve the goal.
My recommendation would be :
1) At your front end, choose a GIS map library such as Google maps API, Leaflet or OpenLayers API. The GIS library would handle a lot of critical tasks in the process such as handling communication with GIS server, user interface function etc. So that you don't have to reinvent the wheels again.
https://developers.google.com/maps/
2) Based on your system requirement, you may or may not need a GIS server such as MapServer. Data could come from directly from clients for example. But since you mentioned it i would think you may need a GIS server to publish some data for the application to consume the services.
MapServer services via OGC standard protocols are easy to integred with most of the popular GIS libraries mentioned earlier. So once you publish Map service (wms) for example, it would be as easy as add one layer in such GIS library point to the service endpoint you published via Http request and by passing some parameters you would be able to get the GIS contents.
This is the link about how to consume MapServer service on the client side:
http://mapserver.org/ogc/wms_client.html

How to connect to MongoDB from a single page ClojureScript / React.js application using Ajax?

Consider a ClojureScript web application using reagent where the reagent components are subscribed to a single db atom containing a vector of maps. The contents of this vector is different for each user and has to be queried from a mongo database ( which is updated with regular intervals ). The database might be hosted by a third party. Considering that CongoMongo, Karras and Monger are Clojure ( not ClojureScript ) libraries what would be the best way to connect to MongoDB from a single page ClojureScript/React.js using Ajax?
This “answer” is more of a comment but here goes.
If you don't absolutely need a Clojure backend, I'd recommend having a ClojureScript-only single-page app without any Clojure wrapper to Mongo (so no need for Sente either). As Timothy Baldridge (of Cognitect, so he knows a thing or two about this 😛) pointed out, your ClojureScript app can just make HTTP REST requests to the database.
cljs-http is a ClojureScript project that uses Clojure's core.async library to make HTTP requests and is perfect for interacting with REST APIs if you know or can learn core.async.
A more conventional (i.e., callbacks) approach, but still very ClojureScript-friendly, is to use Google Closure's goog.net.XhrIo library. I have an example here of connecting to a public REST API using XhrIo and re-frame (built on top of reagent, and highly recommended) that may help show how to get started.
Using either of these ClojureScript/JS libs, you can make requests directly from the ClojureScript browser app to the database, get replies, parse the JSON with (js->clj (js/JSON.parse json-string)) or with transit-cljs, and do something with the result.
Since Mongo has a fairly simple REST interface (https://docs.mongodb.org/ecosystem/tools/http-interfaces/#simple-rest-api), I'd be tempted to just write my own CLJS code that calls the Mongo server. Depends on your security requirements. But writing the CLJS code would be no different than any other remote request. Just a bit of string concatenation and parameter serialization.
You could use sente to get communication going between the Reagent application and your web server. This SO answer references an example client/server application that consists of a web server with browser access, giving you some buttons to press that return information from the server. It is not Reagent - but you can substitute what they use. It is a starting point example that works out of the box.
Then build up the example's web server so that it communicates with the three Clojure libraries rather than just returning static text as it does.

Delphi serverside framework for managing sessions and respond with JSON to ajax requests?

Without reinventing the wheel, what I can use to manage user sessions in a web application and being able to respond with JSON to ajax requests?
Is there some framework (made for example with Indy components or something like this)?
Note for bounty:
in practice it is enough for me to have a reply with a clear example of a server application that serves json. Somehow a Delphi example of the php example mentioned HERE. (without the DB part, I want to see the basics of what does it mean to send JSON. I have basic knowledge of TIdHTTPServer.)
You can take a look at our Synopse SQLite3 Framework, which was just updated to version 1.11.
It serves the data in pure JSON, ready to be used in any AJAX application.
You can also easily create Services, more precisely Client-Server JSON RESTful Services. In this case, you can even not use SQLite3 for your data storage.
This framework is pure Open Source, compiles/run/is tested for Delphi 6 up to XE, is Unicode ready for all versions of Delphi (it uses UTF-8 internally).
By using this framework, you could be able to create easily also Delphi clients, using JSON data from the same server.
There is no internal User session handling yet. Because there are several way of implementing them, and, since our framework is RESTful, it's therefore stateless: no session is needed.
If you need it, I could easily add HTTP sessions using Cookies. What about the User authentication you are expecting?
Maybe this can help you:
REST Servers in Delphi XE Using DataSnap Whitepaper
Learn how to build REST servers using features available in Delphi XE, how to extend them with extra Delphi support code and how to take advantage of the jQuery library.
Marco Cantù
http://app.en25.com/e/er.aspx?s=608&lid=4414&elq=d428643420d2494581299418d9753feb
DelphiMVCFramework does this
Some notable features:
RESTful (RMM Level 3) compliant
Can be used in load balanced environment using Redis (http://Redis.io) [dev]
Fancy URL with parameter mappings
Specialied renders to generate text, html, JSON
Powerful mapper to map json to objects and datasets to objects
Can be packaged as stand alone server, apache module (XE6, XE7, XE8) and
ISAPI dll
Integrated RESTClient Works with XE3, XE4, XE5, XE6, XE7
and XE8 Completely unit tested
There is a sample for each functionlities
There is a complete set of trainings about it, but the
samples are included in the project Experimental support for IOCP
[dev]
Server side generated pages using eLua (Embedded Lua) [removed soon]
Specific trainings are available (ask me for a date and a place)
Messaging extension using STOMP (beta)
Community driven (Facebook group https://www.facebook.com/groups/delphimvcframework)
Simple and documented
There are books that talk about the framework
Project web site: https://github.com/danieleteti/delphimvcframework
N.B. I'm the main developer
I would suggest Delphi on Rails, it is an open source REST/MVC/StateLess web framework.
http://code.google.com/p/delphionrails/
It use:
superobject JSON parser
UIB/Firebird JSON driver
Cairo for SVG, PDF, PNG rendering
LUA for scripting/template ...
It is able to serialize automatically Delphi data structures to JSON using the new RTTI introduced in Delphi 2010 & XE.
I would recommend Super Object Toolkit.
http://www.progdigy.com
Example Code:
procedure Share(ARequestInfo: TIdHTTPRequestInfo)
var
ReturnObject: ISuperObject;
begin
ReturnObject := SO();
ReturnObject.B['success'] := false;
AResponseInfo.ContentType := 'application/json';
AResponseInfo.ContentText := ReturnObject.AsJSon();
end;
Daraja HTTP Framework, which uses Indy internally and adds a high level API for "web application contexts" and request mappings, loosely inspired by the Servlet API.
If you already have experience with TIdHTTPServer, you can directly access and adjust the server component according to your needs.
For JSON, you may use the built-in JSON support in newer Delphi versions or a third-party library (e.g. JsonDataObjects).
Disclaimer: I am the developer of the framework

Resources