How to calculate differences on item balances using retrieved snapshot data

I’m currently getting data of all my users current inventory balances on a daily basis from a third party system.

JSON data structure of the retrieved data is basically looking like this:

    "UserId": 1,
    "Items": (
        "ItemName": "Item A",
        "Quantity": 2
        "ItemName": "Item B",
        "Quantity": 5
    "UserId": 2,
    "Items": (
        "ItemName": "Item A",
        "Quantity": 6
        "ItemName": "Item B",
        "Quantity": 14
        "ItemName": "Item C",
        "Quantity": 1
    "UserId": 3,
    "Items": (
        "ItemName": "Item A",
        "Quantity": 1
        "ItemName": "Item B",
        "Quantity": 3

Sadly as you can see the data does not contain any detailed positive/negative transactions, instead I get a snapshot of the current user inventory.

I would like to get this snapshot data and store it in my application, but I’m unsure how to calculate differences for each user item on each load of data.

The goal is to show different statistics like:

  • Daily current item balance (basically the raw snapshot data)

  • Item difference since last day snapshot data

  • Item difference for the last week

  • Item difference for the last month

How should the data structure look like for the retrieved data? I have relational database tables and document (nosql) databases to utilize but I’m unsure which the best choice for my requirements.

I’m also thinking of allowing specific users perform additional retrival of item balances basically when ever they want to refresh their to the latest data.

File upload blocked – error code 0x800700de “The file type being saved or retrieved has been blocked.”

A user has encountered a curious issue when trying to upload a 3MB Excel file. There are already other files greater than 3MB is size, so that’s not the issue.

The error code is as you see in the picture below, “Error 0x800700DE: The file type being saved or retrieved has been blocked”. I found this error code on the SCCM Error Code Bible on page 39.

Error 0x800700DE

  • I’d be surprised if we’d put in place some kind of file blocking setting.
  • This is an Excel file in .xlsx format, it is not a macro.
  • Other Excel files have been uploaded already.
  • Perhaps there is something else within the file that Sharepoint wants to block? There is one link to another file on a file server contained in the file (I see this in Data/Connections/Edit Links in the Excel ribbon menu).

File Permissions (in Excel itself)

Excel Permissions

The file does have password protected worksheets – can this be a reason for upload being blocked? If so, where can I access these settings (I’m SP Admin)?

SP User Permissions

  • The user has contribute permissions and has uploaded other files today.
  • I’m the SP Admin and I also can not upload the file.

Other Links / Research

Suggested invalid characters in file name: see link here

php – Save latitude and longitude values ​​that were retrieved using JavaScript (in an HTML form) in BD

Well i think i am close to the solution but i need a new vision lol.

I have a form:


At this point, where I have inserted several points (…….), I would like to determine the latitude and longitude of the user and send it to the database using this form.
I take latitude and longitude as follows:

This is my add () function; and so?

function add() {


    if (!empty($_POST('formulario'))) {

        $formulario = $_POST('formulario');

        header('location: ../index.php');

And the function save (); and so:

function save($data = null) {

  $database = open_database();
  $columns = null;
  $values = null;

  foreach ($data as $key => $value) {
    $columns .= trim($key, "'") . ",";
    $values .= "'$value',";

  //remove a ultima virgula
  $columns = rtrim($columns, ',');
  $values = rtrim($values, ',');

  $sql = "INSERT INTO formularios ($columns)" . " VALUES " . "($values);";

  try {

    $_SESSION('message') = 'Formulario cadastrado com sucesso.';
    $_SESSION('type') = 'success';

  } catch (Exception $e) { 

    $_SESSION('message') = 'Nao foi possivel realizar a operacao.';
    $_SESSION('type') = 'danger';


I think it's about passing the LATITUDE and LONGITUDE variables from the script in the middle of the form to the variables form (& # 39; width & # 39;) and form (& # 39; length & # 39;), but I don't know and I don't think how I can do that.
I have already seen that the latitude and longitude recording function works. I managed to display the values ​​on the screen and the browser asks if I want to grant access to my location.

Thanks in advance for your help.

Entities – How can a user be retrieved from the entity reference in rules? (to receive emails from a user field)

I use one Entity reference field with selection list, Target type user

(so a user can be selected and saved as organizer)

How can I check the actual email (instead of the name) so that I can use it as a recipient when sending emails?

I tried to use (event-node: field-eventorganizer: uid) as a token, but it doesn't work.
Also tried to add one Get by entity Users hoping that the mail token could be available in this user field.

For your information: I have checked the node fields and the user ID is definitely in the field

field_eventorganizer (Array, 1 element)
und (Array, 1 element)
0 (Array, 1 element)
target_id (String, 2 characters ) 43

I've read countless posts and tried many options, but couldn't find out. Please help.

8 – Retrieved logged in user from another script

I need to load the user object from another non-Drupal script.

An anonymous user is returned below. I suppose because it creates a new session.

Is there a way to get the user object for the user who is logged on to the site?

define('DRUPAL_DIR', '/var/www/xxxxxx');
use DrupalCoreDrupalKernel;
use SymfonyComponentHttpFoundationRequest;

require_once DRUPAL_DIR . '/core/includes/';
require_once DRUPAL_DIR . '/core/includes/';

// Specify relative path to the drupal root.
$autoloader = require_once DRUPAL_DIR . '/autoload.php';
$request = Request::createFromGlobals();

// Bootstrap drupal to different levels
$kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod');
$em = $kernel->getContainer()->get('entity.manager');

$user = DrupaluserEntityUser::load(Drupal::currentUser()->id());

SQLServer: Remove trailing spaces from the char column if the value is retrieved by setting a parameter or configuring the server

I have a program that was only used with MySQL until yesterday. As of today I was told that the program must also be compatible with SQLServer. Since I use an ORM (Hibernate), almost everything went well, except for one CHAR Pillar.

In fact, MySQL and SQLServer (configured as they are on my computer) treat them differently CHAR Pillar. My program works well with the MySQL method CHAR, which is:

The length of a CHAR column is fixed to the length you have declared
when you create the table. The length can be any value from 0 to 255.
When CHAR values ​​are saved, they are padded with spaces on the right
specified length. Trailing spaces are used when retrieving CHAR values
removed, unless the SQL mode PAD_CHAR_TO_FULL_LENGTH is activated.

On the other hand, SQLServer adds trailing spaces to the value when it is saved and does not remove them when it is retrieved.

So my question is: Am I forced to edit my program to deal with such differences, or is there a SQLServer parameter or configuration of the SQLServer server that I know nothing about to simulate MySQL handling CHAR?

Domain Name System – If you have retrieved a subdomain, how does search affect performance when accessing another subdomain on the same TLD?

Consider this example. My browser visits the following URL:

The page in the domain creates an iframe for

Both domains are hosted in AWS Route53 as Alias-A records => CloudFront

What would be the performance impact in DNS lookup times?

My company is concerned about the milliseconds.

DropDownButton does not work if Db async Future is retrieved with the: Future Builder Flutter widget

Exception that appears:

════════ exception caught by widgets library ════════════════════════════════════ ═ ══════════════════
The following statement was made when creating FutureBuilder (dirty, status: _FutureBuilderState # 74679):
Type & # 39; (City) => DropdownMenuItem & # 39; is not a subtype of the type & # 39; (card) => DropdownMenuItem & # 39; from & # 39; f & # 39;

I use the StateFul class:

class Sincronismo extends StatefulWidget {
  _SincronismoState createState() => _SincronismoState();

class _SincronismoState extends State {
 // return Users.fromJson(jsonresponse(0));

**Aqui pego os dados da Classe DB:**

  getCidade( ) async {
    DBAvaliacoes db = new DBAvaliacoes();
    List city = await db.getCitys();
    return city;


  Cidade selectedCountry;

  Future _future;

  void initState() {
    _future = getCidade();

  Widget build(BuildContext context) {

    return  FutureBuilder (
        future: _future ,
        builder: (context, snapshot){
            return Text(snapshot.error);

          if (snapshot.hasData) {
            return  DropdownButtonFormField(
              decoration: new InputDecoration(icon: Icon(Icons.language)), //, color: Colors.white10
              value: selectedCountry,

The exception breaks off when it arrives here:

items:>((Cidade city) {

                return  DropdownMenuItem(

                  value: city,
                  child: Text(city.descricao_cidade, style: TextStyle(color: Color.fromRGBO(58, 66, 46, .9))),


              onChanged: (Cidade newValue) {
                setState(() => selectedCountry = newValue);
                // selectedCountry = newValue;


            return CircularProgressIndicator();



vpn – SSP repository for Ubuntu 20.04 cannot be retrieved

I tried to set up sspt. It seems that I need to add the following repository:

sudo add-apt-repository ppa:eivnaes/network-manager-sstp

But I get the fullowing error:

Err:5 focal Release
  404  Not Found (IP: 80)
Hit:6 focal-security InRelease
Reading package lists... Done
E: The repository ' focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.