Categories
CMS Magento Mastering Development

Magento Web API giving server internal error add products

I tried posting a product to my Magento site through its REST web API. I am using curl. I got this error: {“message”:”Internal Error. Details are available in Magento log file. Report ID: webapi-5e884238b420f”} And when I searched for the log file, I found: /var/www/html/var/log/exception.log:[2020-04-04 08:15:52] main.CRITICAL: Report ID: webapi-5e884238b420f; Message: Property “ShowDefaultNotificationMessage” does not […]

Categories
Mastering Development

Generate schema from json file using jq

I have a newline-delimited JSON file. Is it possible to generate a schema using a tool like jq? I’ve had some success with jq in the past but haven’t done something as complicated as this. Here’s the format of the schema I’m aiming for: https://cloud.google.com/bigquery/docs/nested-repeated#example_schema. Notice that nesting is handled with a fields key of […]

Categories
Mastering Development

org.apache.avro.AvroTypeException: Expected record-start. Got VALUE_STRING

I am doing simple json to Avro Record conversion, But I am getting this issue, I tried lot of ways, I applied more than 15 solutions from stackoverflow and online. My File look like this { “namespace”: “test”, “type”: “record”, “name”: “root”, “doc”: “This stream contains raw data.”, “fields”: [ { “name”: “aaa”, “doc”: “You […]

Categories
Cryptocurrency Ethereum Mastering Development

Interact with smart contract without metamask

I’m writing an ethereum application that I want to use for an IoT demonstrator. I want to use MQTT to subscribe to an topic and as soon as a signal is transmitted to that topic I want to write something on the ethereum blockchain. The problem I’m facing is that I struggle with actually -writing- […]

Categories
Cryptocurrency Development Ethereum

Is it possible to use ganache blockchain when I deploy my web app in heroku? or should I deploy the contract first to a test network?

const web3 = new Web3( new Web3.providers.HttpProvider( “https://kovan.infura.io/v3/6cf756b5f54f4cf99f794665249ae952” ) ); const abi = JSON.parse( ‘[ { “constant”: false, “inputs”: [ { “internalType”: “string”, “name”: “_patientId”, “type”: “string” }, { “internalType”: “string”, “name”: “_medicalHistoryId”, “type”: “string” }, { “internalType”: “string”, “name”: “_medicalHistory”, “type”: “string” } ], “name”: “insertMedicalHistory”, “outputs”: [], “payable”: false, “stateMutability”: “nonpayable”, “type”: “function” […]

Categories
Cryptocurrency Development Ethereum

Assigning address, data, and gas to smart contract to deploy with Node-js

I used this guide to deploy a smart contract with Node-js. I followed as far as my contract was created as an object. Because the mentioned guide is old some web3 methods changed nowadays. So it looks like i cannot continue following that. My question is “how do i assign address and data and gas […]

Categories
Development

Rails model does not load properly

I updated my Rails application to a newer version of Rails, and now one of my models is unusable, as if it was loaded empty, as if Rails was not aware of its structure and how to populate it. This model is Task and is based on Single Table Inheritance: class Activity < ActiveRecord::Base (…) […]

Categories
Development

JSON Schema Validator Selecting Validators

My problem is how do I get the json-schema-validator library to actually validate a JSON response against the JSON Schema I have defined. Files, code and background information follow. Schema Swagger 2.0 standard definition Schema Students API Defintion { “swagger”: “2.0”, “info”: { “title”: “Students API”, “description”: “Operations on Students”, “version”: “1.0” }, “basePath”: “/v1/students”, […]

Categories
CMS Development Drupal

Set display options for a json string in drupal 8 BaseFieldDefinition:

I have a field that stores a json string with keys and values in the database. I wish to format this output from my field definition display option to output the json string as a list. Is it possible to achieve this via such an approach? $fields[‘charges’] = BaseFieldDefinition::create(‘string’) ->setLabel(t(‘Charges’)) ->setDescription(t(‘The events charges in Ksh.’)) […]

Categories
CMS Development Magento

add search field just above admin grid

i want to add search field here where records shows up grid.php <?php namespace Vendor\Module\Block\Adminhtml\Sales\Mycustomreport; class Grid extends \Magento\Reports\Block\Adminhtml\Grid\AbstractGrid { protected $_columnGroupBy = ‘period’; protected function _construct() { parent::_construct(); $this->setCountTotals(true); } public function getResourceCollectionName() { return \Vendor\Module\Model\ResourceModel\Report\MyCustomReport\Collection::class; } protected function _prepareColumns() { $this->addColumn( ‘period’, [ ‘header’ => __(‘Interval’), ‘index’ => ‘period’, ‘sortable’ => false, ‘period_type’ […]