access variables from outside .each() jquery

jQuery
I am trying to access a variable set outside of an each() function and but I do not know why it does not work Here is my code: $(document).ready(f...
5 months ago

Get live wordpress images on staging with url change global

jQuery
I need setup a local staging from a live wordpress site. Live site containts over 200K images. My idea is put JS that changes file path all images s...
5 months ago

how to get the value of a modal href id

jQuery
from source code: <a class="nextinst" data-dismiss="modal" data-toggle="modal" href="#401"> <span class="glyphicon glyp...
5 months ago

MySQL JSON array to used in "IN" clause?

JSON
Can I use a JSON array as the parameter for an IN clause with MySQL (version 5.7 and greater, as that that supports JSON)? Below is the code that I c...
5 months ago

how to convert json objects of array into the php array

JSON
I have a json string i which has a object in one one there is one json array & another object i want to first the json array then convert into php...
5 months ago

php mysql query not being sent to database

MySQL
Hi i have written this function to register users on my site. it was all working fine until recently the only change i have done is added extra column...
5 months ago

How to get my GROUP BY to take the value of the last row (by date) for a specific column?

MySQL
I have a query which has a GROUP BY clause. This query takes employees "checkin" times from a records table and if the dn field on is 1 then the emplo...
5 months ago

Mongoose throw error - how to fix this?

Node.js
In my app, I am using mongoose to connect with mlab to post the data. when I use the postman to test the post, I am getting the data updated in the da...
5 months ago

Fetching data from two queries as one

PHP
This is a picture-type webpage What i want to be returned is a string like this: nameOfTag (numberOfUnratedElements) I am using a system where the u...
5 months ago

Starting of laravel in windows

PHP
I have recently started using laravel I have searched a lot and found many help how to start a project in laravel. I am using windows 64bit and xampp...
5 months ago

Python Requests TypeError: not all arguments converted during string formatting

Python
I'm using Python requests module, but I'm in a trouble. I'm trying to do a request, this is the code: params = {"user_id":"1234567890", "api":"API-K...
5 months ago

Calculate average value over last hundred rows of a column

R
Here is a quick hack to calculate the average of x over the last 3 rows: s <- data.table(x=c(.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,0.1)) s$avgx = NA ...
5 months ago

Generating a (random) sequence of multiple characters in R

R
I can create a sequence of single letters using LETTERS[seq( from = 1, to = 10 )] letters[seq( from = 1, to = 10 )] I can create a random string of...
5 months ago

Rolling means and applying means at beginning of a series of data

R
I want to do a rolling mean of the the previous 4 values in a dataset. However, for the beginning, since there is not 4 values, I want to do the roll...
5 months ago

Counting distinct values in a data frame in R

R
Let's say I have the following data frame in R: > myvec name order_no 1 Amy 12 2 Jack 14 3 Jack 16 4 Dave 11 ...
5 months ago

Is there a convenient, maintainable way to get the actual arguments list from within function?

R
Suppose that I'm writing a function foo with signature foo <- function (bar, baz, frobozz, quux = TRUE, frotz = 42) { # etc. } ...
5 months ago

I receive an error when trying to pass a component/prop into a parent component

React JSX
I'm new to react, so this is likely a beginner's error. Here's my code that I'm working on: https://github.com/tylerehc/hrs/ It runs fine in that ve...
5 months ago

How can I access the profiles/show.html.erb in rails app

Ruby
I´m using Devise, and after signing up, I want my users to access the profiles/show.html.erb I have an registrations_controller.rb and in there I hav...
5 months ago

Adding the styles of multiple classes using SCSS?

Sass (Sass)
I want to include the styles of four classes in one. And add some more style. I am not too sure about SCSS. Is this the right way to do it? .react-da...
5 months ago

SQL Server sum and subtract prevent null results

SQL
I'm using this code: SELECT (SELECT SUM(TrnQty) AS Total FROM InventoryTrans WHERE InventoryItemID = (select MAX(InventoryItemID) ...
5 months ago