Ryan-Ryan
12415 questions
1
votes
2
answer
2.9k
views
React - passing refs as a prop
I am trying to manage a checkbox with react. The following code works well enough, but I want to refactor out the code in the render method so that it uses a Component. I want to pass the ref to that component, but I cant figure out how to do it.
export default class AreRefsAwesomeCheckbox extends C...
1
votes
2
answer
1.1k
views
docker-compose restart connection pool full
My team and I are converting some of our infrastructure to docker using docker-compose. Everything appears to be working great the only issue I have is doing a restart it gives me a connection pool is full error. I am trying to figure out what is causing this. If I remove 2 containers or (1 complete...
1
votes
3
answer
2.5k
views
Cypress How to store global constants in a file that can be used across all spec files?
I'm looking for a way to store global constants in a file that could be used across all my spec files. Can anyone help?
1
votes
2
answer
2.9k
views
When using the onUpdate function in Firebase, how do I retrieve the record that has been updated?
When using the cloud functions on firebase, with the onUpdate trigger, how do I retrieve the record that has been updated (in other words, the record that triggers the function)? I am using JavaScript to interface with the Firebase database.
1
votes
2
answer
1k
views
Create GCR secret error: exactly one NAME is required, got 26
I am trying to create a docker-registry secrete for GCR, but am getting a really cryptic error message. This is the kubectl cmd that I am running:
kubectl create secret docker-registry gcrsecret --docker-username=_json_key --docker-password=”$(cat wk-test-1-b3c9659d9a07.json)” --docker-server=ht...
1
votes
1
answer
342
views
Azure DevOps default permissions
In Azure DevOps, branch security for git repos defaults the 'Force push' property to 'Not set' for all Azure DevOps Groups. This effectively denies this permission.
We're following gitflow where I work and would generally deny this permission explicitly for persistent branches, Master and Develop; h...
2
votes
2
answer
20
views
Golang: what is atomic read used for?
Here we have a go case provided by Go by Example, to explain the atomic package.
https://gobyexample.com/atomic-counters
package main
import 'fmt'
import 'time'
import 'sync/atomic'
func main() {
var ops uint64
for i := 0; i < 50; i++ {
go func() {
for {
atomic.AddUint64(&ops, 1)
time.Sleep(time.Mil...
1
votes
1
answer
1.3k
views
Whats the most efficient way to update a partial after an AJAX form submit in Rails 3
I have a page with code as follows:
where form is a form for '@item' and 'render @item' renders a partial that represents '@item'. The form uses remote: :true and submits using AJAX.
Whats the simplest and most efficient way in rails 3 to update the entire @item partial when the form is submitted.
1
votes
1
answer
4.1k
views
string regex pattern.replace(/\{0\}/, “$0.00”) does not work
Given that:
var pattern = '{0}';
Why does this not work:
pattern.replace(/\{0\}/g, '$0.00');
and yet:
pattern.replace('{0}', '$0.00');
the first results in: '{0}.00'
the second results in '$0.00'
meanwhile the following does work as expected (producing '$1.00'):
pattern.replace(/\{0\}/g, '$1.00');
A...
8
votes
1
answer
8.1k
views
How to use CORS to implement JavaScript Google Places API request
I really do NOT understand how I'm supposed to make this work:
var requestURL = 'https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=AIzaSyAW4CQp3KxwYkrHFZERfcGSl--rFce4tNw';
console.log(requestURL);
$.getJSON( requestURL, function( data ) {
// data
consol...
1
votes
2
answer
1.8k
views
save predictions from pytorch model
Im following the pytorch transfer learning tutorial and applying it to the kaggle seed classification task,Im just not sure how to save the predictions in a csv file so that i can make the submission,
Any suggestion would be helpful,This is what i have ,
use_gpu = torch.cuda.is_available()
model = m...
1
votes
3
answer
45
views
Laravel Backpack how to bounce to exact match instead of showing just 1 result in table
In my Laravel 5.7 app, I currently browse to URLs such as https://example.com/admin/[email protected] using the 'q' param so that I can search the Contacts table directly without needing to type into the DataTables ajax search field.
This works well except that I'd prefer it to bounce direc...
1
votes
2
answer
226
views
Nginx config invalid parameter even though it is in documentation
I am tryin to run nginx latest version with the following configuration, but I get nginx: [emerg] invalid parameter 'route=bloomberg' in /etc/nginx/nginx.conf:13
docker run --rm -ti -v root_to_local_nginx_directory:/etc/nginx:ro -p 3080:80 --name=mynginx --entrypoint nginx nginx
# nginx.conf file...
1
votes
2
answer
33
views
How to make a windows service that has a task tray icon for managing it? [duplicate]
This question already has an answer here:
How can I display a system tray icon for C# window service.?
2 answers
I'm familiar with writing windows service applications. I've written a few using various approaches - third party libs, the .NET-provided approach, etc. None of my prior service applicat...
1
votes
2
answer
31
views
Cannot access this.state from React function even after using this.bind()
There are tons of questions on this topic and they all seem to point to an answer that I already knew about, binding functions in the constructor using this.bind.
From handleChange() I am able to update this.state.feedback because I can see each letter I type updated in the form but right after tha...
1
votes
2
answer
4k
views
Memcpy segfaulting with valid pointers
I'm using libcurl in my program, and running into a segfault. Before I filed a bug with the curl project, I thought I'd do a little debugging. What I found seemed very odd to me, and I haven't been able to make sense of it yet.
First, the segfault traceback:
Program received signal SIGSEGV, Segmen...
0
votes
1
answer
12
views
How to select all child elements with a specific class using the “this” keyword?
I am creating a navigation bar that allows a user to view a dropdown after hovering or clicking a link. Each link has a class called 'nav_item'. There is more than 1 dropdown menu; each one has a class called 'dropdown'. After hovering over 'nav_item' the child element with a class called 'dropdown'...
0
votes
0
answer
7
views
how to fix .babelrc configuration
I'm new when it comes to using babel with jest and i'm trying to run a snapshot test but when I try to run the test I get this error:
ReferenceError: [BABEL]
A common cause of this error is the presence of a configuration options object without the corresponding preset name.
Example:
Invalid:
`{ pr...
1
votes
0
answer
130
views
Laravel - How can I authenticate users from cached user object in Laravel? (using JWT)
I'm using the Laravel Tymon package for JWT user authentication.
I'm also caching every user object after a new user is created and saved in the database so that I can load the data faster on selects.
The authenticate() method in the Tymon package takes the token as an input and uses the user model...
1
votes
1
answer
144
views
How to compile SQLite3 for Linux without warnings?
I am getting hundreds of these warnings when I compile my sqlite3.c file for linux.
UATHelper: Packaging (Linux): C:\Users\pbssu\Desktop\Plugins\SQLite3UE4Plugin\Source\SQLite3UE4Plugin\Private\sqlite3.c(17134,5): warning: 'SQLITE_OMIT_AUTHORIZATION' is not defined, evaluates to 0 [-Wundef]
UATHe...
1
votes
1
answer
174
views
How can I send a 997 ACK through Logic Apps
I am trying to send a 997 ack through logic apps. I have managed to generate the JSON through get the FA returned when decoding a message. I then pass this over to another app which then tries to encode it to X12.
The problem comes here, the app throws an error saying that it cannot find the releva...
1
votes
1
answer
441
views
React final form multipart data
I am using react-final-form for handling form data in my component.
How can I submit multipart form data using react-final-form?
1
votes
2
answer
89
views
Python3: Search List of tuples for values which have public IP addresses
I am attempting to write a script which pulls data from a sqlite3 db and outputs only specific data which is of interest.
I have written a function:
def get_ip(db_file):
cur = con.cursor()
cur.execute('select 'Computer Name','User', 'IP Address1', 'IP Address2', 'IP Address3', 'IP Address4' from Sep...
1
votes
0
answer
58
views
Cannot find functions in call graph
I am beginning with Solidity and have begun experiencing this problem in my Contract. I created a test case to show the issue(pictured below with console log included) that is also getting the same error. Functions and events are not being recognized in the call graph and I am not quite sure why bec...
1
votes
1
answer
153
views
Trained model detects almost everything as one class after a long training
I trained a custom person detector using Tensorflow and Inception's pretrained model then after a few thousands of step and an average of 2-1 loss, I've stopped the training and tested it with a live video. The result was quite good and only gets few false positives. It can detect some person but no...
1
votes
1
answer
372
views
State machines: multiple conditions for determining next state?
See end for the TL;DR.
Consider a simple magazine article publishing workflow. The following diagram shows a basic, conceptual understanding of the process, which we'd like to turn into code (in this case using Stateless). It covers the basic, 'happy path' of publication, plus a few possible issues:...
1
votes
0
answer
230
views
AudioKit - audio engine configuration changes periodically
I have an app that uses samplers to play loops. I am in the process of converting my app from using AVAudioEngine to AudioKit. My app now works well except for this: Approximately every 1-3 minutes, my app receives two .AVAudioEngineConfigurationChange notifications in a row. There is no apparent pa...
1
votes
1
answer
76
views
Accessing all Advanced Custom Field checkbox values
Is it possible to access all values for an ACF Checkbox field available in the ‘Choices’ field settings?
These values are being used to populate a filter dropdown, so therefore simply associating these values with a singular $post leads to inconsistent results.
i.e. my current approach only work...
1
votes
1
answer
393
views
Issue running linux AWS CodeDeploy agent in non root context
I am using AWS CodeDeploy to deploy code to our AWS Amazon Linux instances. I followed this knowledge base article https://aws.amazon.com/premiumsupport/knowledge-center/codedeploy-agent-non-root-profile/ to have the agent execute in the ec2-user context instead of root
Before making the change, the...
1
votes
0
answer
29
views
ASP.NET Soap Webservice Implicit “Out” Parameters
I'm in the process of modernizing one of my company's older websites. As a part of this process, I need to change a few calls to the webservices we host.
I'm a bit new to WCF programming, and I understand that there is an 'old way' and a 'new way' of working with these services. The old version of...
1
votes
1
answer
44
views
Azure Cognitive Service Text API TranslateArray Category Usage
Is the 'Category' attribute in a request to TranslateArray a pre-defined list or open to specify during the request?
en
pets
0
dog
cat
fish
fr
Yields the following response:
Argument Exception
Method: TranslateArray()
Parameter: category
Message: Invalid category
Parameter name: category
message id...
1
votes
0
answer
35
views
Bootstrap Navbar wont play animation
I am having a bit of trouble getting my animation to play when my Bootstrap 3.3.7 navbar collapses upon scrolling from the top of the page. If I change the size of other divs in my navbar in Sublime while BrowserSync is active, it will show the animation but still doesn't work when I scroll. The e...
1
votes
0
answer
1.3k
views
Pandas - read_csv encoding error
This is an issue that is quite common for me. So common that it seems I'm missing something (i.e., there has to be a better way). There are multiple posts on SO dedicated to this problem, but they seem to be workarounds rather than an actual solution. So, I have a CSV to read in:
df = pd.read_csv(fi...
1
votes
0
answer
372
views
How to pre-fill RDP username & domain using mstsc in powershell
Currently, have two domains in which our users will have machines existing in either or. I am writing a powershell script in which I collect the user name and machine name. I think perform a test-connection to determine which domain the machine resides by pinging $computer.domain.com then if fails p...
1
votes
1
answer
271
views
Media query width 100% not working
Here is a link to the codepen for the code that I am working on. I am trying to get it so that if the device width is less than 540px, the width of the wrapper goes from 33.33% to 100%, however it doesn't seem to be doing so.
My media query is as follows:
@media only screen and (max-width: 540px) {...
1
votes
1
answer
1.1k
views
Jenkins hide build parameters
I currently have Project-based Matrix Authorization Strategy enabled. I would like to hide certain build parameters from some users when they run a job. Is there a Jenkins plugin available for that?
I saw this was asked in 2014 and after 4 years I am hoping that something was created. :) Thank y...
1
votes
0
answer
108
views
What is the Best C# Sortable Serialized List that can be used with DataContract?
As a part of a class, I have some Immutable POCO objects just to act as a Data Transfer Object for a configuration file.
[DataMember]
public IReadOnlyList Messages { get; } = new List()
{
new Warning(75, 'UserMessage1', 'LogMessage1'),
new Warning(90, 'UserMessage2', 'LogMessage2'),
new Error(100, '...
1
votes
0
answer
373
views
C# getting JSON through Cloudflare protection
FIXED - I got this to work by declaring the webclient as a static and then doing the actual call inside a using statement; Now it works if anyone else comes across this. The original issue was it was losing the Cookies after the initial call.
I'm trying to implement the first answer to this questi...
1
votes
1
answer
392
views
How to write/append PING results to output file
Fairly new to Python so forgive the basic question and my repetitive coding. I'm trying to write a script that PINGs a network segment then writes the results to a couple of TXT files.
I have the PING scan part working just fine with some code I found online, just cant get the results to save in th...
1
votes
1
answer
33
views
Beautifulsoup: extracting links from a file that links were already taken from
I'm trying to write a web searching algorithm and on my first time through the site, I call beautifulsoup on it. I then use find_all on it and it returns a list of 'a' class. Within this a class, there is a collection of data, but i'm trying to create of list of the URLs. Here's my code:
soupcurren...