James James

15679 questions
0

votes
1

answer
30

views

copy value of html button after the mouse has hovered over the button for 1 second

I have a series of buttons, and I'd like to copy the value of the button to the clipboard after the mouse has hovered over the button for two seconds. function getButtonValue(obj) { document.getElementById(obj); var dummy = document.createElement("input"); document.body.appendChild(dummy); dum...
James Norris
0

votes
0

answer
4

views

Azure AD B2C Set Authentication Contact Info Email Address

I am trying to programmatically update the Authentication Contact Info email address for a contact created using Azure AD B2C. I have attempted to do this via the Microsoft Graph and Azure AD Graph API, but failed in both cases each time. For example; PATCH /{tenantId}/users/{userId}?api-version=1....
James Wood
1

votes
0

answer
4

views

Azure AD Password Reset

I am trying to understand how Azure AD B2C password reset is meant to be used. It appears there are a number of ways password reset can be handled. What is the difference between these? Is there is a price difference between these? Are some of these features of Azure AD, whilst some are features of...
James Wood
0

votes
0

answer
4

views

Accessing data via API in R

I'm trying to pull data on hospitals from www.phin.org.uk using R. The pages themselves are rendered in Javascript, so scraping looks painful. I found that they have an API and think I managed to decipher it, although I am a complete beginner to APIs. Example code below. library(httr) > GET(url = "h...
James
1

votes
2

answer
88

views

Counting up a column incorrectly SQL

I am having a problem working out why a query I am writing is counting up the overall views for a page and not for each organisation, it should come out as 19 and 8 but when I run the query it comes out as 27 page view each the rest of the query seems to work fine. anyone got an idea why? Thanks Tho...
Thomas James
1

votes
2

answer
5.1k

views

Multiple Include and Where Clauses Linq

I have a database where I'm wanting to return a list of Clients. These clients have a list of FamilyNames. I started with this var query = DbContext.Clients.Include(c => c.FamilyNames).ToList() //returns all clients, including their FamilyNames...Great. But I want somebody to be able to search for a...
James
1

votes
2

answer
89

views

Update my git branch with commits in another branch

My question is probably a simple one, but I am relatively new to using GitHub and wanted to check before I do anything wrong. Basically, I am working on a feature branch which was cut from the develop branch. I am still working on my feature branch, but another dev has pushed some changes to the dev...
James
1

votes
1

answer
146

views

Multiple updates in one document using mongoose

I want to update multiple values in a single document in one mongoose call. Is this possible? I have something similar to this: update = {$inc : { numShown : 1 }, $inc : { secondField.subField : 1 }}; options = {}; MyModel.findByIdAndUpdate(req._id, update, options, function(err){ if(err){ return c...
James B
1

votes
1

answer
2.8k

views

Using PowerShell to find the differences in strings

So I'm playing around with Compare-Object, and it works fine for comparing files. But what about just strings? Is there a way to find the difference between strings? CompareTo() is good about reporting that there is a difference, but not what the difference is. For example: PS:> $a = "PowerShell roc...
James Brown
1

votes
2

answer
1k

views

How to make sure that random.choice() doesn't pick the same item twice?

I am making a quiz. That means I have to generate random questions for a list, but I need to make sure that questions aren't repeated. I am using Python 3.1.4, but I dont know how to make sure it checks if the string hasn't already been generated. The piece of code that I am using to generate the s...
James
0

votes
4

answer
29

views

how to get how many with average age from a state

So I am going to make a view with: - State - Average age of people from a state - How many with same age as average age of the state create view myView as select state, avg(age), count((select avg(age) from person)) from person group by state; I have tried this, but I only get how many people who...
James Hansen
1

votes
1

answer
42

views

Finding X binary numbers with n non-zero digits for large X. - Matlab

Is there a more efficient method for generating X binary numbers (that have n non-zero digits) for a range of 1 to N? I have developed the following solution: Totalcombos = nchoosek(N,n); floor = floor(log2(Totalcombos)); L = 2.^floor; NumElem = 2^N-1; i=0; x=1; %Cre...
James Crawford
1

votes
2

answer
2.1k

views

How does iFrame traffic work?

If I put an iframe in document A pointing to document B, does document B reach me through the server hosting document A, or are both documents sent directly to me? Following from this, if HTTPS is enabled for the server hosting document A but not the server hosting document B, is B encrypted before...
James MacKay
-1

votes
1

answer
18

views

Nodejs html pass argument inside img or link source

First of all I am new in NodeJS. I am trying to phrase arguments inside links and image source but its not working. > href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> > > class="container" id="app"> > > > Search > > > >...
James Arems
0

votes
0

answer
17

views

IP suppose gives 0.0.0.0

I am kinda new to php and I am trying to build vote script for an online game. Now I added $ip = odbc_result($result1,4); $ip1 = ord(substr($ip,0,3)); $ip2 = ord(substr($ip,1,3)); $ip3 = ord(substr($ip,2,3)); $ip4 = ord(substr($ip,3,3)); $user_ipaddress = $ip1.'.'.$ip2.'.'.$ip3.'.'.$ip4; To get the...
James Fa
4

votes
0

answer
23

views

How to return a list of objects from a function inside a loop

I'm trying to loop over a list of views, and for each view retrieve a list of objects associated with that view, using a service call. Each view is being assigned the result of the last call to the function, instead of the result of the function call with its parameters. Debugging output stateme...
James Muldoon
1

votes
2

answer
695

views

Add property to JQueryStatic interface

I want to add a property someString to the JQueryStatic interface so I can access it with $.someString. In index.ts, I have this code: interface JQueryStatic { someString: string; } $.someString = "string"; $ is of type JQueryStatic, however I get the following error: Property 'someString' does not...
James Monger
1

votes
2

answer
312

views

Swift matching elements within nested array of structs

I'm a Swift newbie and I'm trying to get to grips with the following data structure. I have an array (categories) of category structs. Each category struct contains an array of business structs stored as a value on the property items. I'm not sure how to represent this kind of thing but hopefully th...
James
2

votes
0

answer
21

views

Using finditer() with string decoded from request.FILES

I'm trying to get my head around this problem and have tried to find something on the internet, to no avail. I am uploading a file (< 2.5MB) which I read from request.FILES and decode it to utf-8 which is saved in a variable. I then need regex to do it's thing with that string so I can iterate throu...
James Bellaby
0

votes
2

answer
19

views

using WHERE on a column that is an array is not working

I have a table with a column that is an array. There are records in the table that have the array ["something","another thing"] in the column of values. But they are not showing up for some reason when performing a where query. So I'm not sure what I'm doing wrong. # schema t.text "values", default:...
James Herd
1

votes
2

answer
25

views

Matplotlib histogram does not show details of distribution

I have some data and I would like to look at its distribution. But I don't know why when I use this code, the histogram does not really show what is going on within the data and it shows a very general picture. I want to have a more granular histogram. data['feature'].plot(kind='hist') And here is w...
James Robisnon
1

votes
1

answer
21

views

Make Lua table nil via a function

I create an empty table, t. I then try to set it nil by using function destroy. While in function, the table becomes nil, but outside of the function nothing has happened to it until I explicitly set it to nil Is there any way to set a table to nil via using a function in Lua? local t = {} local fun...
James T.
0

votes
2

answer
12

views

Importing objects from another python file as a list

I have a file (Crop_Library.py) containing a list of objects with various attributes (same number for all): from Crop import Crop Basil = Crop("Basil", 3, 0, 5, 10, 5) Lettuce = Crop("Lettuce", 3, 4, 5, 10, 7) Kale = Crop("Kale", 1, 2, 3, 4, 5) I would like for my GUI program (GUI.py) to read all t...
James
1

votes
3

answer
2.3k

views

How to browse submodule in Git Extensions?

I am trying out basic submodule functionality in Git Extensions. I have a repository called "sub" and a repository called "super"; sub is a submodule of super. When I open the super repository in Git Extensions, I can view the history of it and do normal stuff in it as usual. I would like to work...
James Johnston
0

votes
0

answer
3

views

How to force Kotlin using gson.fromJson() to call my class initializer?

In a Kotlin project I have Gson injecting data from a JSON source into some classes I made. The data injects, however the class init{...} is never called. import com.google.gson.GsonBuilder fun main(args: Array) { val myClass1 = MyClass("Hello!") // should have printed "Hello!" val jsonOfMyClass = "...
James Collier
0

votes
1

answer
13

views

getelementbyid Multiple ID display [duplicate]

This question already has an answer here: How to select next sibling of a certain type with JS? 2 answers I have a drop down where once a subject is clicked it opens selected fields on a list. Is it possible to display two or multiple div's from one click? Here is my current code; function showfiel...
James Wright
1

votes
1

answer
15

views

Does a callback passed to CancellationToken.Register cause synchronous waits?

If I attach a callback to CancellationToken.Register, is execution of that callback handled synchronously (and therefore blocks) at the point the CancellationToken is cancelled? Or is it handled asynchronously?
James
0

votes
1

answer
13

views

How to find the max index for each row in a tensor object?

So I'm creating a pytorch model and for the forward pass, I'm applying my forward pass method to get the scores tensor which contains the prediction scores for each class. The shape of this tensor is [100, 10]. Now, I want to get the accuracy by comparing it to y which contains the actual scores. Th...
James Isa
1

votes
2

answer
273

views

Run Ruby Script after Build on Heroku

I have a rails app running on Heroku. I have it set to watch a branch on Github so that it automatically 'builds' and updates when I push a commit to that branch. Awesome. I have a file in my repo scripts/dostuff.rb. I want Heroku to fire off that script each time it 'builds' my rails app. Google...
Matthew James Briggs
1

votes
2

answer
654

views

Wrapping text inside a CSS shape

I've searched a lot on the internet and couldn't find any solution on my problem. I would like to justify/wrap my text inside a triangle to follow its border shape. I've made an example using a parallelogram, but the result isn't satisfying. .parallelogram { width: 200px; padding: 20px; -webkit-t...
James Harrys
1

votes
2

answer
34

views

Creating a new column that is an average of non-adjacent rows in the data frame

I am very new to R. I have multiple columns of variables relating to different question responses on a questionnaire. I wish to generate a new column in the data frame that is an average of a set of these preceding variables. I have seen that rowMeans can be used for this, but this seems to only wor...
Peter James Taylor
1

votes
1

answer
37

views

How to change a still plot to a movie in Matlab?

I am trying to understand how Movie in Matlab works, I have never used it before. I have a code for the heat equation that finds temperature for the amount of segments I decide to put on the length of the object (rod). I am able to plot a normal plot that shows all the values at different conditions...
James
1

votes
3

answer
1.2k

views

Optimizing the Verhoeff Algorithm in R

I have written the following function to calculate a check digit in R. verhoeffCheck
James
0

votes
2

answer
33

views

How can I pass multiple different numbers (ints) into an array using a single textbox? C#

Basically I want to fill an array with ints and cap it at 20 elements using a single text box and button in a c# GUI. I've tried using a for loop and it just fills all 20 subs with the first number I pass it. I've tried a break statement to exit the loop, but that doesn't work. Here's my code so far...
Jeremy James
-2

votes
0

answer
19

views

HTML / CSS / JS --> Syntax Error: Animated SignUp Form

I followed advice from this site on how to embed the code that i found on how to recreate the Animated Sign In Form … shown here: https://youtu.be/5uANWpkuPww I was hoping to modify it, so that one face of the animated circle contained text inviting people to subscribe to my mailing list … with...
James James
1

votes
3

answer
2.6k

views

Using expect to log into VPN from a bash script

I connect to a VPN from console using something like: sudo openvpn my.conf [sudo] password for user: Enter Auth Username:my_user Enter Auth Password: I don't care about entering the admin pwd manually but I want to automate the vpn auth, I think expect is what I need to do this but I don't know how...
James Harzs
1

votes
3

answer
16

views

Finding the row corresponding to the Nth value in each group by in SQL

I have a table A as follows: name course grade Bob C1 12 Bob C2 13 Bob C3 23 Bob C4 17 James C2 15 James C6 27 Nick C5 18 Nick C1 16 Nick C3 22 Nick C2 32 Nick C7 19 I want a query that can return the student na...
James Robisnon
0

votes
0

answer
9

views

Where is app pool located in visual studio?

I'm having trouble finding the app pool, I need to set my app pool to allow my crystal report to run properly. On my computer where I develop the application, it works properly but when I try to run the program on another computer it won't run, I've read similar articles about it here, but I can't f...
Noah James
1

votes
1

answer
53

views

Only One Line Of File Not Being Handled Correctly By Dijkstras Algorithm

I am new to StackOverflow and i just want to say thank you for all of you guys hard work! I am having a very strange behavior with my program to compute the shortest path from information given in a file. My file has a format of Source1 Dest Cost Dest Cost Dest Cost Source2 Dest Cost Dest Cost Dest...
James Combs
1

votes
2

answer
566

views

How to change the return value of a method in a unit test mid execution

I'm trying to design a unit test to test a retry loop pattern. The only way I can think to do this is to change what's returned by the method embedded at the heart of the retry loop half way through the test. For example... I'd like to throw an exception for a particular method for the first 5 secon...
James Law

View additional