Is there some direct way (without writing platform-specific code) to collect some entropy from underlying system?
Do you have any plans to add cross-platform entropy collecting mechanism? It will be very useful feature.
Our encryption support is all implemented via a cn1lib which isn't the latest and greatest either but it provides most of the basic stuff we need. We never went into that level of encryption/security when porting that library, if the native platforms support more secure randoms you can use a native interface to map to that and possibly also submit a pull request to the lib.
Related
MTA Subway data (among other data) is formatted in GTFS-realtime. In order to convert the protobuf into a string representation I must run it through some Google protobuf tools using gtfs-realtime.proto. The only problem is that, as can be seen here, the gtfs-realtime-bindings are available only for
NET
Java
JavaScript / Node.js
PHP
Python
Ruby
Golang
Additionally,
We don't provide generated code for C++, use the official protoc compiler for that (from here or here)
None of these are Swift or Objective C. While there is an open issue/request for a Swift/Objective C version from 2016, I was wondering what I can do currently in order to do this. As of now, the only viable solution I see is to have a server parse the data and then GET the parsed data (JSON encoded?) from that server instead of directly from the MTA.
Here is the Google page for protocol buffers. I am not sure, but is there some way to use what is there to read the GTFS-realtime data.
Is that the best path forward? Are there any other possibilities?
As noted by Tony Laudig, having your app directly communicate with the MTA is a breach of their terms and conditions which you almost definitely would have had to agree to in order to get an api key.
Breaking terms and conditions is generally a pretty bad idea. In the case of this API, it seems like your key will be revoked.
Thus, I would not suggest using the library in Tony’s answer. Instead, do what you proposed:
Have a server parse the data and then GET the parsed data (JSON encoded? [—sounds good]) from that server instead of directly from the MTA.
Any of the languages you listed will do the job, it’s just a matter of which you’re most comfortable with.
There is an official library in Objective C for parsing Protobuf. You can compile classes from the GTFS-rt standard and the MTA extension .proto files.
It looks like your planned usage, having the app connect to the MTA directly, doesn't conform to the MTA terms and conditions:
In developing your app, you will provide that the MTA data feed is
available to others only from a non-MTA server. Accordingly, you will
download and store the MTA data feed on a non-MTA server which users
of your App will access in order to obtain data. MTA prohibits the
development of an app that would make the data available to others
directly from MTA's server(s).
I have a 64 bit cocoa project that needs to use a 32-bit rendering library, which I cannot port to 64-bit.
I decided to separate it to a rendering service, which will be compiled in 32-bit and will provide an interface for the library, and the main project, which will be compiled in 64-bit and will access the rendering service.
I am wondering what is the best way to do the interprocess communication. I am looking for a solution that will provide fast communication and easy api.
It seems that XPC (and specifically, NSXPCConnection) is the recommended solution nowadays. However, I'm not sure - is it implemented for 32-bit applications?
In addition, I need to pass a fairly large quantity of data (max ~5MB), and so I worry about the performance and speed of the XPC. Is shared memory mapping is possible/recommended in this situation? can it work in conjunction with xpc?
For 32-to-64-bit APIs, Apple does use XPC services in their own apps, like Pages, to migrate old data to a more recent API.
Although I have yet to get it to work using NSXPCConnection, and Apple's own apps use the functions found in xpc/xpc.h.
I would like to call MQL4 or MQL5 function from my own imported DLL in Metatrader.
Is it possible?
Forest,
As far as i have experienced during the past 2 years working with MetaTrader, there is no real way to call MQL functions from an external DLL. But there are some custom built APIs that closely resemble to what you want to achieve:
MT4 API
MetaTrader™ Java / .Net API
These APIs do somewhat allow you to use MQL functionality out-of-the-box
Principle
After several hundred man*years in the FX domain, there is another approach to orchestrate a smooth and elegant MT4 Terminal co-operation with other processes than to try to push water up the hill or than to pay USD500+ for a kit, that will stop working right upon the next shock once Build 524-> Build 562->Build 586->Build 600->Build 609->Build 624->... moves again
A non-existent toy
Yes, MT4 architecture does not expose it's own interface to allow self to be "disturbed" by an undeterministic obligation to handle external low-level calls via DLL et al.
How to fix it
Nevertheless, it is possible to reverse the architecture and make MT4 Terminal act as a lightweight thin-Client, operating a smart messaging library, trough which the MT4 functions are being exposed for a remote call ( RPC ).
Example
This way a Python Node may collect MT4 data for numerical processing,
same way a PHP Node may in parallel handle remote-syslog-s,
same way a C++ Node may integrate another task,
same way another Python Node may act as a CLI terminal interface with a Custom-specific scripting-syntax language to command MetaTrader-side activities via command-line / stdio
simply -- whatever your application infrastructure needs can be done this way
( One may even improve a poor real-time features of the native MT4 threads to gain a much better soft-real-time predictability and a low-latency massively parallel architecture .. and still be on a safer-side, protected from being torpedoed by any next "new"-MQL4 )
nota bene: just to imagine the invisible threat, the headbang collision in "new"-MQL4.56789 is, besides others, that string, while being syntax-proposed as string, is not in fact a string but a struct and all your previous DLL-related work simply has to be re-worked and wrapped-around to emulate a string-as-struct or a new DLL-interface has to be designed for cases, which return a value in a buffered ArrayOfBYTEs, which MQL4.56789 side can receive and process, but which it cannot free on it's own and memory leaks.
If it's acceptable for your DLL to be a .NET DLL, then you could try
this MT4 .NET integration library called NQuotes.
With this library it's possible to access any MQL4 function from your DLL.
Is it possible to use google protocol buffers as the serialisation mechanism when only one end of the comms channel is using it?
ie given a client that needs to speak to some 3rd party server or hardware that communicates in some defined message byte structure.
is it possible to specify the exact byte structure to expect using the protobuf IDL? Or does protobuf use it's own byte packing format therefore both ends must speak using protobuf protocol?
If not protobuf is there some library that would achieve this?
No. Protocol buffers has a very rigid layout, that cannot be changed, and is unlikely to match the one you are using unless it is secretly using protocol buffers and just not advertising that fact. The encoding is documented here.
As for alternatives; that would depend hugely on what platform / language / framework you are using. It would not be unusual to find you have to write your own tools for talking the required protocol.
My question is very simple, and I want a clear answer with a simple example.
What's the main difference between API, Toolkit, Framework, and Library?
I prefer following:
An API is an abstract description of how to use an application. For example, an API may describe the function syntax (declaration) of a chat server. i.e. login, publish_message, subscribe_messages. And, it describes any protocols to use the application. i.e. must login before sending or recieving messages, or clients are dropped after 2 minutes if not sending or receiving messages.
A library is an implementation of an API, it containes the compiled code that implements the functions and protocols (maintains usage state).
A toolkit is a set of libraries (API) and services grouped together to provide the developer with a wider range of possible solutions. For example, the Globus Toolkit provides services (such as File transfering, Job Subission and Scheduling) that a devleoper can install and start on their servers. They also provide API's to build applications that may use the services deployed in an integrated fashion. For example, the developer may build a program that uses the Job Submission API to communicate with the Job Submission Service.
A Framework is a set of guidelines that prevents inappropriate use or developement. The developer must contruct their applications within the rules and boundaries of the framework. This is done by forcing the developer to extend the current framework to develope new software. by extending the framework, you force adhearence to the framework.
I'm not saying these are completely correct, but its worked ok for me so far!
This has always been my understanding, you will no doubt see differing opinions on the subject:
API (Application Programming Interface) - Allows you to use code in an already functional application in a stand-alone fasion.
Framework - Code that gives you base classes and interfaces for a certain task/application type, usually in the form of a design pattern. (Though not always)
Library - Related code that can be swapped in and out at will to accomplish tasks at a class level
Toolkit - Related code that can be used to accomplish tasks at a component level.
Those terms sometimes are misinterchanged.
Similar posts, read:
What is the major difference between a framework and a toolkit?
Framework vs. Toolkit vs. Library
I prefer to call a library as an alias of module or namespace. Toolkit and A.P.I. is usually a set of libraries for a common task. Altought, A.P.I. is more used for Procedural Programming than Object Oriented Programming.