Dartium and it's use of dart:io - dart

I am building a feature-rich standalone application using dart. I picked dart since it seemed to allow not only the standard development approach for webapps but also to access system resources (such as nodejs does). One of my requirements is file io or database access (which again requires file io). Dartium however does not allow the use of the dart:io package (only in servermode is this library accessible). Can anybody think of a workaround, a change to the dart environment or the chromium environment to allow this ? Maybe a custom compiled dartVM in the browser environemnt.
Basically a way to use database connections in a dart standalone app. A REST wrapper is only an option if this code could get generated automatically.
I am not clear if such a thing is possible or if chromium will prevent any approach to access system resources.

Yes in standalone mode dart you can use files, and also TCP socket, and web socket.
So you can connect to databases. (for example to MySQL: https://github.com/jamesots/sqljocky)
In browser mode you can use built-in databases dart:indexed_db or dart:web_sql.
You can also use web-socket protocol
Maybe you can use websocket to connect with local or remote database.

Related

What is the advantage of using angular with electronJS

I want to create desktop application compatible with other OS.For that I'm using electron with angular.Because both are frame work whether it will effect performance or loading time, and also whether deploying easy,can we use all the features of angular when we use with electron like routing..?
Electron uses Chromium and NodeJS which is the reason why it is compatible with other OSs. You can talk with the NodeJS process from your angular-app which opens up some possibilities. For example opening native file-dialogs to let the user choose files. Electron also already abstracts some platform specific operations like getting the user home to save some configuration files for example.
You can use routing just like in any Angular app and I think you can use most features like you would normally but dont take me for granted on this one.
I would not say it affects your loading time to combine those too. During development you have to build your angular app before electron can start up and use those files but in production Angular is already ready to be loaded so they dont hinder each other.

How I can test from browser (like from swagger) my webapp powered by gRPC-Web without REST?

I want to develop my client-server web app with clear gRPC (gRPC-Web) without REST. Something like described at official doc: https://grpc.io/docs/quickstart/web.html
Is it exist any tool like swagger that let me view message formats from .proto and test the server methods by sending any messages from the browser?
I use node.js for server side app
You could use https://kreya.app, which is a gRPC GUI client and supports gRPC-Web. Note that it requires an installation.
Disclaimer: I'm one of the authors of Kreya.
The gRPC-Web wire protocol is a binary format and is basically human-unreadable. There is an enhancement request to prettify it https://github.com/grpc/grpc-web/issues/317 but we haven't got around to it.
If you are ok with talking to your gRPC backend directly without gRPC web, there are a few CLI and GUI tools for that purpose:
CLI: The official tool grpc-cli
CLI: grpCurl
GUI: (this requires a golang backend unfortunately): grpc-json-proxy
GUI: omgrpc
Found this pretty tool for test my gRPC-backend directly (without gRPC-Web): https://github.com/uw-labs/bloomrpc

how can I create my own plugin for mosquitto broker?

How can I make a plugin like mosquitto-auth-plug for authorization, or one for storing message payloads or other usages?
Should I write it in C or can I use python?
Any plugin for mosquitto is going to have to be written in something that can be compiled to a native shared library that can be loaded by mosquitto. This would normally mean C or C++
There are hooks in place for the authentication plugin, but none for message storage or anything else so that is unlikely to work without modifying mosquitto directly.
You should examine the code for the auth-plugin and for mosquitto for details.
You could look into C (works for me)
https://github.com/hadleyrich/mosquitto-auth-plugin-http
and In Python
(not tested , but working for other folks)
https://github.com/mbachry/mosquitto_pyauth

Change the Values of the app config file in a windows service through another program

I have a windows service which downloads some files from SFTP and uploads it to database and generates PDf's from that data. So now when i should give the executable files to my client i think he need to change the app config file like sftp details and the pdf paths. So i am just thinking about a program like a windows forms or a console which reads the input and save those in app config file. Is it possible like and by the way i have created a setup project for the windows service where he gets 2 files .msi file and setup file. Is it possible to achieve the above problem in this case ?
If I understand correctly, you're wanting some kind of UI application that allows the user to configure the operation of the Windows service. This is certainly possible as I've been doing it for several years now. However, you don't want to do this via the app.config file. The app.config file is read by the Windows service when it starts up, so any changes made to it would go unnoticed until the service restarts. A better course of action would be to communicate the changes to the service via the Windows Communication Foundation (or some other ICP mechanism, e.g., pipes, sockets, shared memory, etc.). I've managed to use this successfully, although to be honest, I'm using ordinary sockets now. In any case, the service would basically "listen" for incoming configuration messages, "read" those messages, and then "configure" itself accordingly, perhaps even saving the changes in its app.config file so the changes are preserved for when the service restarts later.
HTH

PHP extension loading from script using dl()

I'm going to buy a (cheap) hosting space with apache/php 5/mysql. Because it's cheap i have no direct control over php.ini and extension loading.
My question is: can i load an extension putting the .dll file into my space and than using dl() php function? Can the host disable this feature thus avoid loading custom extension this way?
Yes, it can be disabled through the enable_dl and safe_mode php.ini settings (which would almost certainly be the case, as otherwise you could e.g. load your own code in the web server process).
And that's in addition to the disable_functions setting, which can disable anything.
the host can disable any function within php from the php.ini. in fact I would be surprised if the host left this feature on.
Since you're talking about a .dll, you are assuming to get a Windows hosting server running PHP, however, is better that you check with the hosting company, because probably dl() will be disabled.
Smaller hosting companies can be more accommodating with adding extensions you may require.

Resources