Categories
Mastering Development

Jquery datatable gives error “Requested unknown parameter ‘0’ from the data source for row 0”

I am creating json format for jquery datatable using jquery , but it gives error "DataTables warning (table id = ‘compare’): Requested unknown parameter ‘0’ from the data source for row 0" I’ve already read https://datatables.net/manual/tech-notes/4 my Html is <div class="row wrap blocks" id="table1" > <div class="col-1"></div> <div class="col-10 wrap-inner d-flex align-items-center"> <table id="div_compare" class="dtables"> […]

Categories
CMS Mastering Development Wordpress

Targeting single page with JS

I created a JS and PHP code to query a database and display matching rows on a page. It was messing up other pages on WP, so I wanted to know how to target a single page so the JS doesn’t run on other pages. JS: jQuery(document).ready( function() { console.log("Document loaded"); jQuery("#searchButton").click( function(e) { console.log("Search […]

Categories
CMS Mastering Development Wordpress

admin-ajax error 400

I’ve gotten the following code to work when I put it in functions.php of a theme, but because it was causing other pages to have errors, I’ve created a child theme and am attempting to put the code in there. But now I’m getting a error 400 code. My child themes style.css file: /* Theme […]

Categories
CMS Mastering Development Wordpress

How can I make a proxy call to this WordPress PHP function, one time without a parameter, other time with?

So in WordPress, I have a hook for an ajax action, that looks like this: add_action( ‘wp_ajax_myhook’, __NAMESPACE__ .’\myhook’ ); function myhook() { $username = "webmaster@example.com"; $password = "password!"; $url = "http://00.00.000.1:8080/api/v1/generalsite"; $options = array(‘http’ => array( ‘method’=>"GET", ‘header’ => "Authorization: Basic " . base64_encode("$username:$password") . "\r\n" . "Content-type: application/json\r\n" . "Accept: application/json" ) ); […]

Categories
Cryptocurrency Ethereum Mastering Development

Insufficient funds for gas * price + value in Ropsten

I write API for smart contract but its shown error "Insufficient funds for gas * price + value"? My try I have increased my address balance but it’s showing the same error. I have changed my chain code id but it’s showing same error. I have changed gas price – tx.gasPrice = web3.utils.toHex(1000000); but its […]

Categories
Mastering Development

Query set for a pie-chart

I think I am just making a simple error here, but I can’t seem to solve it. I am trying to create some fake data and analyze through different types of users which I will then put into a pie chart. Here is my models.py: from django.db import models import factory import factory.django import factory.fuzzy […]

Categories
CMS Mastering Development Wordpress

Update widget values from ajax function

I have widget like this class Test extends WP_Widget { public function __construct() { parent::__construct( ‘proreco’, __(‘Product recommender’, ‘password_domain’), array( ‘customize_selective_refresh’ => true, ) ); } // The widget form (for the backend ) public function form($instance) { // Set widget defaults $defaults = array( ’email’ => ”, ‘password’ => ”, ‘limit’ => ”, ‘date’ […]

Categories
Cryptocurrency Ethereum Mastering Development

Error while calling a erc721 contract funciton using go-language

I am trying to call a function which is "mintUniqueTokenTo(address,uint256,string)" in a ERC721 token using go language , but for some reason it is failing. I think one reason could be that i am not using padded and encoded uri just like toAddress and id, but i coudnt find a way to do so. I […]

Categories
Mastering Development

How to make a URL Encoded API request using Google AppScript

I am trying to send bulk sms using Google AppScript and Google Sheets. I am using the textlocal API at the following link: https://api.textlocal.in/docs/bulkjson I have successfully been able to do this in python, here is the code: – apiKey = ‘asdfa’ def bulkSend(messagePackets): data = urllib.parse.urlencode({‘apikey’: apikey, ‘data’: messagePackets}) data = data.encode(‘utf-8’) request = […]

Categories
Mastering Development

how can I plot a Cox model with ~pspline and find the cutoff in R?

I am now learning how to evaluate a non-linear association between X and Y. And I find package ‘smoothHR’ is a good choice. for example, I want to evaluate the non-linear association between HDLC and event model<-coxph(Surv(futime, death) ~ age+sex+pspline(hdlc,df = 2), data = data,x=T) hr1 <- smoothHR(data=data, coxfit=model) print(hr1) plot(hr1,predictor=’hdlc’,prob = 0,conf.level=0.95,round.x = 1) […]