matt_matt

14882 questions
0

votes
0

answer
5

views

Specify nginx PID for certbot (for gitlab bundled nginx)

I'm running a server with GitLab on it, and want to be able to use nginx for other services too (in my instance, Jenkins). I've modified the GL config to add additional vhosts as per this answer and it's all working fine. However, I want to also set an SSL certificate with certbot, however when I ru...
Matt Fletcher
1

votes
1

answer
593

views

Numpy or Scipy way to do polynomial fitting in 2 dimensions

I have some data that looks like this What is the typical way to do a polynomial map of z based on x and y? I have used numpy.polyfit in the past to do similar things in 2 dimensions, so I suppose I could just iterate through all the points and then fit those answers with another 1d polyfit. Howev...
Matt
1

votes
2

answer
1.6k

views

Drupal 7 Views custom view template fields

I've successfully created a custom view template for my Drupal 7 site but am having issues adding attributes to the content which is outputted. I've searched high and low for the answer to this but to no avail. I have a view called: views-view-fields--homepage-articles.tpl.php I am printing content...
Matt Saunders
1

votes
1

answer
252

views

Oracle: Limit results of a select statement to XXX number of rows for each record

I have a scenario where I want to pull up to the first 500 rows for each agent_ID on a table. Example: TABLE NAME: AGENT Schema: AGENT_ID, CUST_ID, CUST_F_NAME, CUST_L_NAME PK: CUST_ID Scenario: AGENT_ID 1234 has 800 results AGENT_ID 4567 has 1000 results AGENT_ID 1212 has 300 results I would lik...
Matt K
1

votes
2

answer
528

views

How to run a script when starting the Node.js console?

Is there a way to configure the Node.js console window (node.exe) to run a script on startup? I'd like to do some minor initialization automatically each time, such as setting variables and colors. It's not sufficient to just run node.exe myinitscript.js. That will run the script and then exit. I'...
Matt Johnson
1

votes
1

answer
50

views

Efficiently page query results

I have mongo hooked up to a web application (Python/Pyramid Framework) and there is a large collection I want to display in the browser. Since it is very large, I only want to render 100 records at a time, allowing the user to click a "load more" button to retrieve the next 100 records. Pagination...
Matt H
1

votes
1

answer
246

views

LINQPAD - Extension Method to run statement every X seconds

I've got an idea for a fun little extension method in LINQPad but it's stumping me on how to do it. Basically I'd like an extension method that I can add at the end of any LINQPad statement to make that statement execute every X seconds. So, for example, I'd do something like this: "Hello World".Dum...
Matt Nieland
1

votes
3

answer
4.5k

views

Can I force the order of dependencies in my classpath with Gradle?

I know I'm going very much against the grain hear but here me out... I have a project that runs on Google App Engine. The project has dependency that uses a class that can't be invoked on App Engine due to security constraints (it's not on the whitelist). My (very hacky) solution was to just copy a...
matt burns
0

votes
0

answer
12

views

Xamarin.Forms Control Template Binding Not Working

I've specified a control template in my App.xaml: You can see I've got one of my controls databound: Text="{TemplateBinding BindingContext.HeadingText}" The control template works fine, I can add it to a page without any problems, except for the bound property doesn't display: Here is my page code:...
Matt G
0

votes
3

answer
33

views

Calling src from nearest audio tag to javscript function without ID

I'm attempting to play multiple locally stored mp3 files on a single html page. I want a single JavaScript function in a separate js file triggered onclick that will play the correct file referenced in the adjacent audio tag. The audio just needs to play through once every time it is tapped/clicked....
Matt
1

votes
2

answer
40

views

Use SFINAE to enable method if tuple is large enough

I have a class that holds a tuple: template struct Point { std::tuple data; ... }; Internally, I want some methods that create views of the data. For instance, when the data has 1 or more dimension, then it is nice to have methods called x and y which pull off the first and second elements: templ...
bremen_matt
4

votes
3

answer
144

views

Specialize member functions based on size of member container

I have a class that holds some statically-sized containers: template struct Point { Container container; ... void bar(); } where a Container class might look like: struct Container1 { static constexpr size_t size = 5; } Now I want to specialize the bar method based on the size of the container. I...
bremen_matt
0

votes
0

answer
13

views

PHP, HTML JS MySQL Dynamic Drop-Downs

I have a form that I have everything working and submitting except... User should select departments and the 4 Defect fields should populate with the Defects that match the Department. Departments and Defect 4 works. If I remove 4 then 3 works, remove 4&3 and 2 works and so on. I think it is los...
Matt Long
1

votes
2

answer
374

views

Making a search bar appear slowly after clicking search icon

So I have a searching glass icon that when clicked makes the search box appear. Here is the code. The first line is the icon. The second line is the search box. The third line is an 'x' icon to exit the search box. document.getElementById('searchIcon').onclick = function() { document.getElementById...
Matt Comeaux
1

votes
1

answer
343

views

Calling SKPaymentQueue restoreCompletedTransactions, no response

The use case here is that the user has never purchased my in-app purchase but taps the Restore button. I want to let the user know that the restore has failed because there is nothing to restore. The problem is that I'm not getting any event. So I don't know that anything has happened. When my user...
matt
1

votes
1

answer
13

views

How can I set my favicon to appear on every page of my website without using JS/PHP

Im new to HTML/CSS and have just created a favicon by copy and pasting code from a favicon generator website. The following is the code ive placed in my index.html I want my favicon to appear on the other pages on my website. I'm wondering if I am forced to copy and paste all that code over and over...
Matt
1

votes
1

answer
568

views

GCP shows No Organization

We have migrated to GSuite having used the GCP for a number of projects already. As some accounts already existed, we transferred these over to our new GSuite tenure. We now want to transfer the projects to our new Organization but it shows "No Organization" when we try and migrate: When we try and...
Matt Stannard
1

votes
2

answer
188

views

Renaming columns in dask dataframe

I have two questions about dask. First: The documentation for dask clearly states that you can rename columns with the same syntax as pandas. I am using dask 1.0.0. Any reason why I am getting these errors below? df = pd.DataFrame(dictionary) df # I am not sure how to choose values for divisions, m...
Matt Elgazar
1

votes
1

answer
28

views

Bash Script using sdiff to compare content from two remote urls

I am trying to use a simple bash command to cause the sdiff of two curl requests $ sdiff -l -w 140 $(curl -s "https:/URL/1/2/thing.php?d=20190202") \ $(curl -s "https:/URL/1/2/thing.php?d=20190203") If I download the two curl requests into files, then sdiff the files it works. is it possible to cons...
Matt
1

votes
1

answer
27

views

Can storing a system service statically lead to memory leaks?

We all know that storing a context object (other than the application context) statically is bad practice because it can lead to memory leaks. But can you store a system service derived from the context object? Such as ConnectivityManager? // Is this okay? static ConnectivityMananger connectivityMan...
Matt D
1

votes
0

answer
36

views

C++ Class members specified by template

Is it possible to use a variadic template to specify the members of a class? An acceptable solution would involve storing the data internally in a tuple. template struct FromPP { // TODO: Get the tuple type from parameter pack std::tuple data; // TODO: write the constructors // Other code......
bremen_matt
9

votes
3

answer
256

views

Read uint8_t from std::stringstream as a numeric type

My understanding is that reading a uint8_t from a stringstream is a problem because the stringstream will interpret the uint8_t as a char. I would like to know how I can read a uint8_t from a stringstream as a numeric type. For instance, the following code: #include #include using namespace std; i...
bremen_matt
1

votes
2

answer
373

views

How to inject CSS into webkit?

On Linux I'm creating a webkit window which needs to display a certain URL. I'm doing that like the following: GtkWidget *main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); // Create a browser instance WebKitWebView *webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); // Put the browser area into the...
Matt
1

votes
1

answer
781

views

Changing state doesn't remove input values in React

I have a table with different rows (react components). This rows are named service_users. When i click the save button of a row, a registerServiceUser method is called which updates the state in the parent component with a splice function. But after the state changes the input values from the saved...
Matt Dice
1

votes
2

answer
334

views

Getting a possible leak using gulp watch, tasks take longer each time

I'm using gulp to compile and minify my SASS in an ASP.NET5 website to use as a CDN. I've written a watcher that watches my *.scss files, it then uses dependencies to compile the scss and then concat/minify it into one style.min.css. The issue I'm having is that the longer the project is open, or at...
Matt Brewerton
0

votes
0

answer
26

views

Running SpecFlow tests without the feature files included in the solution

I run my SpecFlow tests without code-behind - or rather, with code-behind generated at run time. This lead me to thinking that, if there is an established step definition library, could the *.feature files be added to the solution at run time? Going further, is there an API to pass feature files to...
Matt W
1

votes
1

answer
127

views

Sum from lookup or whatever works

I'm wanting to sum a column from a certain point to another certain point which is dictated by the user and a drop-down box. Awkward to explain, I think best to view spreadsheet. Something along the lines of this is my thought process: SUM( VLOOKUP(CURRENT LEVEL CELL, VLOOKUP(DROP DOWN BOX...
Matt Hutchins
1

votes
1

answer
975

views

ServiceWorker - Cache all failed post requests when offline and resubmit when online

My service worker at the moment successfully achieves the following: It caches all pages visited when online It only returns cached pages when offline My application has the ability for users to input signatures, which are submitted via ajax automatically. I am attempting to capture this post reques...
Matt
1

votes
1

answer
2.4k

views

How to Convert PNG Transparent Background to JPG White Background?

I'm converting a PNG to JPG. The transparent background turns black by default. I need it to be white. What is the FFmpeg command to set the alpha channel to a color? I think it has something to do with the alphamerge and alphaextract Filters. ffmpeg -i image.png -qscale:v 2 image.jpg This replaces...
Matt McManis
0

votes
0

answer
13

views

Custom annotation to automatically configure a Spring Data JPA repository

Some of our microservices need to connect to multiple databases. My config classes for repositories end up looking very similar. It's not a lot of code, but it's very boilerplate. 2 to 3 times per microservice and across a lot of microservices it ends up being more repetition than I'd like. Is there...
Matt Berteaux
0

votes
0

answer
6

views

Excel 2011 for Mac - outputting PDF fails if File->Print selected beforehand

I have written a Macro-Enabled Workbook in Excel for Windows, and am now trying to get it to work in Excel 2011 for Mac. One thing my workbook does is allow the user to create a PDF of whatever sheets they want. My code works fine on Excel 2011 under normal circumstances. However, if I go to File...
Matt
1

votes
1

answer
2.7k

views

Converting resource to string list with Terraform interpolation

Given a .tfvars containing: environment = "dev" web_servers = ["192.168.0.1","192.168.0.2"] and a node resource like: resource "node" "web_nodes" { count = "${length(var.web_servers)}" name = "${var.environment}_web_${count.index}" address = "${element(var.web_servers, count.index)}" } I want to exp...
Matt Canty
1

votes
1

answer
1.2k

views

Detailed Sentiment Score in Stanford CoreNLP

On the StanfordCore NLP website there is the following demo:http://nlp.stanford.edu:8080/sentiment/rntnDemo.html The demo gives a sentence a detailed sentiment score from 0 to 4. I understand how to get a "positive" or "negative" assessment using command line, similar to this: Screenshot from core...
matt_07734
1

votes
1

answer
217

views

React undefined props issue

I'm passing a props object to a child component. The problem I'm having is that sometimes some of the nested values will be null, or undefined, and therefore I'm getting the dreaded props undefined message Uncaught TypeError: Cannot read property 'xxx' of undefined. As I understand defaultProps is o...
Matt Saunders
1

votes
2

answer
659

views

ExcelDataReader FilterColumn usage

I am trying to return a data set that returns the first row as the header row(this is working) as well as filter out entire columns from the data depending on their column header. ExcelDataReader 3.4.0 introduced the FilterColumn callback option which I am attempting to utilize. Below is my AsDataSe...
Matt
1

votes
1

answer
931

views

pandas.date_range resulting in a repeated 'sticky' warning: “414: FutureWarning: 'summary' is deprecated and will be removed in a future version.”

EDIT 6/20/18: As pointed out by @aydow, this is similar to this: How to suppress Pandas Future warning ? The solution from that page did get rid of the warning for me: import warnings warnings.simplefilter(action='ignore', category=FutureWarning) However, there is no discussion of why (once I run pd...
Jeremy Matt
1

votes
2

answer
177

views

Redirect output from running process (Visual C#)

I have a console that is running and I need to get the output. I cannot use startprocess to start the console as it is spawned separately. I do not have access to the source code, I am simply trying to redirect the output from the console while it is already running.
Matt Lynch
1

votes
2

answer
285

views

How to write a PHPUnit test for Laravel Artisan command that calls an external API without calling that API physically?

A brief introduction to give you an idea of what I want to achieve… I have a Laravel 5.6 artisan command that calls an external API with a simple GET request to get some data. I want to test this without actually calling any API physically. (I want to be offline and still have test test green). No...
Matt Komarnicki
1

votes
1

answer
41

views

How to retrieve the bucket boundaries when using mongo's $bucket aggregation?

I have a collection of 200,000+ records which include a float field amountAwarded (eg. 12345.67, 2342, 22 etc). I'm using MongoDB to aggregate these into buckets based on the following boundaries: amountAwarded: [ { $bucket: { groupBy: '$amountAwarded', boundaries: [0, 10000, 50000, 100000, 1000000,...
Matt Andrews
1

votes
2

answer
48

views

Looping through nested dictionary

I am attempting to get data from a JSON file found at https://fantasy.premierleague.com/drf/event/19/live. However, I'm running into a problem whenever I loop through the data received. The first loop in my code below should be appending the value in data["elements"]["1"]["stats"]["goals_scored"], b...
Matt

View additional