Categories
CMS Drupal Mastering Development

Downloading a file after a batch process using BinaryFileResponse

We need to download a file after a batch process. We tried using the BinaryFileResponse for downloading. But it is not working and also not showing any error. The code is as follows <?PHP namespace Drupal\module_quiz; use Symfony\Component\HttpFoundation\BinaryFileResponse; /** * Defines QuizMarksDownloadBatch class. */ class QuizMarksDownloadBatch { /** * This function runs the batch processing […]

Categories
CMS Drupal Mastering Development

Downloading a file after a batch process using BinaryFileResponse

We need to download a file after a batch process. We tried using the BinaryFileResponse for downloading. But it is not working and also not showing any error. The code is as follows <?PHP namespace Drupal\module_quiz; use Symfony\Component\HttpFoundation\BinaryFileResponse; /** * Defines QuizMarksDownloadBatch class. */ class QuizMarksDownloadBatch { /** * This function runs the batch processing […]

Categories
Mastering Development

Number System in C++

I have a program that should translate values ​​from one number system to another, but I have a problem with "_itoa_s" writes that [Error] ‘_itoa_s’ was not declared in this scope I tried to connect libraries <cstdlib> and <stdlib.h> I also tried replacing itoa with "snprintf" but it does not help in the compiler there […]

Categories
Mastering Development

error in uploading base64Image to azure storage by using nodejs

I am getting an error when uploading a base64Image to Azure. Code with Node.js: var name = req.body.name; var img = req.body.image; //this image is base64Image var uploadOptions = { container: ‘myphoto’, blob: name, text: img } blobServiceClient.createBlockBlobFromText( uploadOptions.container, uploadOptions.blob, uploadOptions.text, { contentType: ‘image/jpg’, contentEncoding: ‘base64’ }, function(error, result, response) { if (error) { res.send(error); […]

Categories
Mastering Development

MySQL Result is undefined [duplicate]

This code is supposed to execute and compare flags on an ID. It throws an error TypeError: Cannot read property ‘length’ of undefined and when I put a console.log in there to see what result is, it returned undefined even though it should return from the MySQL Query. MySQL is set up properly and the […]

Categories
Mastering Development

Segmentation fault for numbers too big for Ackermann’s function

Why is this failing? I have written Ackermann’s function in C and used longs to make sure that no number will be too small. Yet, when I go above (including) 4 for m and n, it gives me a segmentation fault: 11. Does anyone know why? #include <stdio.h> int ackermann(long m, long n) { if […]

Categories
Linux Mastering Development

How to introduce a new header to a CSV file based on condition using gawk

I have a csv file from I wish to extract only column number 7 and 11. Depending on the value of column 7 which has either value OK or KO I wish to insert a column next to it called value where the mapping is: OK -> 0 KO -> 1 and additionally, I add […]

Categories
Mastering Development

Add 2-3 images in the mouse hover effect

I have made this code for mouse hover zoom effect and it is working without error. But I want to add 2-3 images so as the user clicks on it, then that image is shown and mouse hover effect works on it, i.e. on hovering the mouse on the picture shows a zoom effect. Here […]

Categories
Mastering Development

SQL update or insert based on last record found

Quick background: Process equipment vendor wrote code to update DB with results of process. Data essentially is: (Order #, Result, Qty) except that the Qty is always 1, and when the batch is large, I get a lot of identical records. Vendor software update is not an option. DB update by vendor is done by […]

Categories
Mastering Development

Async await from Database loop

I am new to nodeJS and I was not able to achieve the async await with the value I want for a variable. var express = require(‘express’); var router = express.Router(); var mysql = require(‘mysql’); var urlExists = require(‘url-exists’); /* GET home page. */ router.get(‘/’, function(req, res, next) { var con = mysql.createConnection({ host: ‘localhost’, […]