Categories
Mastering Development

How to setstate in a loop?

i am getting error at this.setState({ Url: resp.data.Url }); in GETAPI TypeError: Cannot read property ‘setState’ of undefined.. Please suggest. The GETAPI is basically used to render the data from the API. My use-case is to store all the URLs in state and pass it to DownloadButton component. I need this URL to download the […]

Categories
Mastering Development

How can I make data, methods and computed globally in vue?

My code like this : <template> <v-layout column justify-center align-center > <v-flex xs12 sm8 md6 > … </v-flex> </v-layout> </template> export default { data () { return { currentDate: this.$moment().format(‘YYYY-MM-DD’) } }, computed: { birthdayFormatted () { return this.formatBirthday(this.birthday) }, }, methods: { formatBirthday (date) { if (!date) { return null } const d = […]

Categories
Mastering Development

Upgrading Node JS and ERR_REQUIRE_ESM: Must use import to load ES Module: ‘inheritsloose.js’ of Babel Runtime

The following error is emitted in my Node JS/React JS application after upgrading Node JS to v.12. I’m currently using @babel/core 7.10.1. How should this error be resolved? Here is my babel.config.js: module.exports = { presets: [ [ ‘@babel/preset-env’, { targets: { node: ‘current’, }, }, ], ‘@babel/preset-react’, ‘@babel/preset-typescript’, ], plugins: [ ‘@babel/plugin-proposal-class-properties’, [‘@babel/plugin-proposal-decorators’, { […]

Categories
Mastering Development

Aggregate number of likes for each day within period

I am building a REST Api on Django RF which represents a very basic social network. I have a model Post that has a value Likes which is related to a User by many to many through a Like model. My models: class Post(models.Model): content = models.TextField() created_on = models.DateTimeField(auto_now_add=True) author = models.ForeignKey(CustomUser, on_delete=models.CASCADE, related_name=’posts’) […]

Categories
CMS Mastering Development Wordpress

I am getting Admin-ajax.php 400 Error

I am implementing some changes to my website’s page with AJAX. I have enqueued my js file in functions.php add_action( ‘wp_enqueue_scripts’, ‘add_my_script’ ); function add_my_script() { wp_register_script( “index”, get_stylesheet_directory_uri() . ‘/index.js’, array(‘jquery’) ); wp_localize_script( ‘index’, ‘myAjax’, array( ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ))); wp_enqueue_script( ‘index’, // name your script so that you can attach other scripts […]

Categories
Mastering Development

Set title onSubmit based on current SELECT OPTION VALUE – react

I found this tutorial on how to create a react quizz app on youtube link to tutorial I am trying to set the title based on the current Select Option Value when submitting the form. Currently I managed to change the title only when a different option is selected. import React, { useState, useEffect, useRef […]

Categories
Mastering Development

How can i load a bigquery table to dataproc cluster

I am new to dataproc cluster and PySpark so, in the process of looking for codes to load table from bigquery to the cluster, i came across the code below and was unable to figure out what all am i suppose to change for my usecase in this code and what are we providing as […]

Categories
Mastering Development

How can I get all unique tags from an array with lodash?

Im using Vuejs and lodash and particular lodash to try and get all uniqe tags for question in my very simple questions “app”. But for some reason lodash returs all of the tags, not the uniqe ones. This is how I have design the array of questions and tags (might be a better way but […]

Categories
User Help

How come I can’t print this custom excel slide range?

So, I basically wanted to print a range of slides. I have about 800 slides in one PowerPoint and I wanted to print out every other slide, so I made the following numbers separated by a comma using Microsoft Excel: 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,185,187,189,191,193,195,197,199,201,203,205,207,209,211,213,215,217,219,221,223,225,227,229,231,233,235,237,239,241,243,245,247,249,251,253,255,257,259,261,263,265,267,269,271,273,275,277,279,281,283,285,287,289,291,293,295,297,299,301,303,305,307,309,311,313,315,317,319,321,323,325,327,329,331,333,335,337,339,341,343,345,347,349,351,353,355,357,359,361,363,365,367,369,371,373,375,377,379,381,383,385,387,389,391,393,395,397,399,401,403,405,407,409,411,413,415,417,419,421,423,425,427,429,431,433,435,437,439,441,443,445,447,449,451,453,455,457,459,461,463,465,467,469,471,473,475,477,479,481,483,485,487,489,491,493,495,497,499,501,503,505,507,509,511,513,515,517,519,521,523,525,527,529,531,533,535,537,539,541,543,545,547,549,551,553,555,557,559,561,563,565,567,569,571,573,575,577,579,581,583,585,587,589,591,593,595,597,599,601,603,605,607,609,611,613,615,617,619,621,623,625,627,629,631,633,635,637,639,641,643,645,647,649,651,653,655,657,659,661,663,665,667,669,671,673,675,677,679,681,683,685,687,689,691,693,695,697,699,701,703,705,707,709,711,713,715,717,719,721,723,725,727,729,731,733,735,737,739,741,743,745,747,749,751,753,755,757,759,761,763,765,767,769,771,773,775,777,779,781 The problem is it will only print out if I used all the numbers […]

Categories
Cryptocurrency Ethereum Mastering Development

Error: Transaction has been reverted by the EVM

I’m getting the error: Error: Transaction has been reverted by the EVM when I run the command to test the minting flow for Open Sea: node scripts/mint.js The deployment to the Rinkeby network has been successfully executed and I was able to get the contract addresses for minting. I tried minting using the recommended Open […]