matt_matt

19568 questions
1

votes
2

answer
1k

views

Flutter - Create dynamic number of texteditingcontrollers

I am recreating an app I have previously made in Swift, and on one of my pages we call an API and based on the results, we present the user a dynamic number of textfields to search by different search parameters. Is there any good way to do this in Dart/Flutter? Since dart doesn't support generatin...
Matt Lampe
1

votes
1

answer
229

views

Creating and using a custom Anaconda environment on Azure DSVM

I want to use a specific Python environment with specific libraries (Keras, TensorFlow) on an Azure Linux data science virtual machine (DSVM) to move some of my local work to the cloud. I created the environment in the terminal using Keras v2.1.6. Also, I can see the environment in the Jupyter envir...
Matt
1

votes
3

answer
37

views

How can I align one flexbox item to the right and two stacked on the left?

I have an image ('repairPic') I would like to align to the right which is no problem, and two elements ('repairTitle & repairBtn') I would like to stack on top of each other on the left side. I would like to use flexbox because I think it's a great way to set up a site. I'm pretty new to html and c...
Matt
1

votes
1

answer
21

views

How to access nested JSON object in Python DataFrame

I have a JSON response that I am converting to a DataFrame in Python. JSON response: [ { 'id': 123456, 'first_name': 'John', 'last_name': 'Doe', 'fields': [ { 'title': 'ABC', 'value': '123' }, { 'title': 'DEF', 'value': '456' } ] } ] When I parse this JSON to a DataFrame, the columns appear as id, f...
Matt
1

votes
2

answer
86

views

CS0120 An object reference is required for the non-static field, method, or property

I am trying to test a redirection code that someone is helping me with and it is giving me two cs0120 errors. The first on an integer variable and the second on a textbox. I am new to coding in general and am teaching myself C#. If someone could explain to me what this error means and why I am getti...
Matt Lynch
1

votes
1

answer
48

views

Why is the recursive function returning undefined on return array?

I have a simple algorithm I'm working on, return the smallest number using recursion. Everything seems to be right and working, except that when I return the numbers array at the end, it comes back as undefined. function findSmallestInt(numbers) { var updatedArr = []; if (numbers[0] < numbers[1]) {...
Matt Brody
1

votes
2

answer
305

views

Replacing a string of text when only knowing a certain amount of characters

I have a list of PO numbers. They look something like (4010059877-TUR36036133 or TUR6039716## 4010073239). I need to be able to narrow the cell down to only the PO number which is the 4010059877 number. The only consistent part about the part I want to exclude is the 'TUR########'. I have worked on...
Matt Lane
-1

votes
0

answer
31

views

Why doesnt my code work twice? it executes fine the first time, but not the second

I need to make a function that moves the nth element in a singly linked list to the end of the list. I created some code that does that but it only works once if I try to do it again it moves the selected element to the end but the one that was moved previously gets deleted/dissapears. My theory is...
Matt
1

votes
0

answer
10

views

How to group by and aggregate conditional in Django ORM

I have a Django query to get average hours worked per day per employee (There could be multiple worklogs per day). I want to split these up in weekday and weekend work. I have tried the following: qs = Worklog.objects.filter( day__range=[start,end] ).values( 'worker__fullname' ).annotate( weekday=Ca...
Matt
1

votes
1

answer
3.6k

views

msgrcv: Invalid argument Error

I am getting an error that says: msgrcv: Invalid argument what could be causing this error? Here is my code Bassically I'm passing a message from a parent to a child then I want to pass a message from the child to the parent and even though I'm using basically the same code for both, it isn't workin...
Matt_Bro
1

votes
1

answer
1.4k

views

Marshalling DIDL-Lite with Go's xml package

Here's a sample DIDL-Lite XML document from the UPnP AV ContentDirectory v2 Service Template: ... How would one go about marshalling to this with Go's xml package? More specifically: How are namespace prefixes defined, such as xmlns:dc and xmlns:upnp? How are multiple name spaces configured on an el...
Matt Joiner
-1

votes
0

answer
16

views

Starting a new activity from a fragment

I'm looking to start a new activity directly from a specific fragment. Currently, the error I'm getting is that onClickListener() can't be resolved. I had a lot of issues doing through inside onCreateView(), so now I'm attempting to do it inside onViewCreated(). public class TermsFragment extends F...
Matt Joslen
0

votes
3

answer
29

views

get full string before and after a specific pattern

I'm looking to grab noise text that has a specific pattern in it: text = 'this is some text [email protected] and some more text [email protected] and some other stuff' I want to be able to remove everything in this sentence where after a space, and before a space contains [email protected] result = 'this is some tex...
Matt W.
1

votes
3

answer
741

views

Rails send_file rendering files as plain text on new page instead of browser downloading file

When send_file is called, it's sending the file to the browser, but the browser is dumping the contents as plain-text on a new page instead of downloading the file. If I refresh that page, it then downloads the file as normal. Route get 'download' => 'qr_codes#download' Controller def download path...
Matt Weick
0

votes
0

answer
16

views

How to assign a new value to top n rows in a subset using data.table?

I am trying to subset my datatable, select the top n rows, and assign them a new value. My first attempt was as follows: DT[condition_1 & condition_2][1:N][x := 1] However datatable doesn't seem to let you pipe assignments like this, nor does it let you select the top rows (given multiple conditions...
Matt Holdup
1

votes
1

answer
249

views

Setting section headers in R file that get rendered with spin()

Traditionally I declare section headers in Rmd files like this: # header 1 ```{r, echo=FALSE} print('foo') ``` ## header level 2 ```{r} print('bar') ``` So that when it gets rendered to HTML, it looks like this. And I can put in a table of contents. header 1 foo header level 2 bar Using the spin() f...
Matt H
1

votes
2

answer
641

views

PythonNET DateTime C# .NET List how to populate it?

I can't find any answers out there for PythonNET working with Lists, a package for Python that lets you import .NET DLLs. For some reason creating a list of DateTime was not working for me. SOLVED Here's how to make it work: import clr from pandas import to_datetime, Series from System.Collection...
Matt
1

votes
4

answer
1.4k

views

Can't install node-sass

I am attempting to install node-sass and it just won't let me. I have tried updating npm. I put this in: sudo npm install -g node-sass and i get this (starting one line before the error): gyp verb build dir attempting to create 'build' dir: /Users/matt/node_modules/node-sass/build gyp ERR! confi...
Matt Wright
1

votes
1

answer
545

views

How to setup PostgreSQL with Visual Studio 2017 or .NET 4.5+?

There are several posts and articles related to the installation of PostgreSQL, but they are a bit confusing and provides different approaches for different versions. This post will help those wanting to use PostgreSQL with Entity framework - Database first approach. Requirements : VS 2017 PostgreS...
Matt Burner
1

votes
2

answer
64

views

How to specify requests to return data as JSON?

I'm new to the Python requests module and I'm trying to export game data from a user from the Lichess.org API (a chess website). Here is my code: import requests, json url = 'https://www.lichess.org/api/games/user/mbellm' r = requests.get(url, params={'max':2, 'analysed':'true', 'clocks':'true', 'ev...
Matt
1

votes
4

answer
56

views

Reactjs state initialize an array of values

I am trying to initialize an array of boolean values, where there is a different value on a specific position in array. If I initialize state like this, empty is array. state = { activeItems: [...new Array(5)].map((item, idx) => idx === 1 ? true : false ) }
Matt
1

votes
1

answer
42

views

Ask 2 questions and have 3 different outcomes

I am trying to ask users with a MsgBox two seperate questions. Depending on what they select yes to print the appropriate set of drawings. This is where I am at so far. The single option Yes & No will work but the Yes & Yes does not. Dim acadMsgBox As String, exclMsgBox As String Dim LoginName As St...
Matt Taylor
1

votes
2

answer
89

views

Migrate a PositiveIntegerField to a FloatField

I have an existing populated database and would like to convert a PositiveIntegerField into a FloatField. I am considering simply doing a migration: migrations.AlterField( model_name='mymodel', name='field_to_convert', field=models.FloatField( blank=True, help_text='my helpful text', null=True), ),...
Matt
1

votes
2

answer
90

views

Alternative for anonymous namespaces in header-only libraries

I understand why it doesn't make sense to use anonymous namespaces in header files... They aren't really anonymous... However, this begs the question: Is there an alternative idiom/mechanism to avoid polluting the global namespace when distributing a header-only library? EDIT: My typical usage o...
bremen_matt
1

votes
2

answer
41

views

How to delete the effect of a commit via PR?

TL;DR: I need to delete a commit from master, which must be done with a pull request. How is this done? There is a commit on master which needs to be removed because the changes it provides are bad. I cannot push a commit directly to master because of the branch policy. I have created a branch from...
Matt W
1

votes
1

answer
51

views

How to refactor React code to include less of 'this.state'

I have a class in a React project with 2 saved states: import SoundData from './sounds.json'; class SoundReading extends React.Component { state = { data: SoundData.sounds, index: 0 }... } Throughout the rest of my code, I'm constantly calling 'this.state.data...' and 'this.state.index'. I know...
Matt Brody
1

votes
3

answer
46

views

VBA Loop to update a hyperlink for each cell in a column

I have edited this question because I made a small mistake and decided not to dumb down the cell references I am using to simple ones. I have chosen to update a hyperlink in a specific cell by running a macro. Range('AB118').Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:='', SubAddre...
Matt Cann
1

votes
2

answer
57

views

Kotlin: Any performance impact on converting a “normal” function to a blocking suspend function?

I have a function that looks like this: fun map(block: (T) -> R): Result { ... } and I'd like to make a suspending version: suspend fun mapAsync(block: suspend (T) -> R): Result { ... } The logic in both bodies are identical, but one suspends and one doesn't. I don't want to have this duplicated l...
Matt Klein
1

votes
2

answer
3.6k

views

Rails: Validates uniqueness of scoped by date

I have a Rails model that should only allow saving/updating of a model once per day per user. I have a callback to do the Find by user and date then add to errors but this is ugly and feels un-rails-like. I have the typical created_at / updated_at columns (and the time portion is significant/I need...
Matt Rogish
1

votes
5

answer
14.5k

views

How can I overwrite an array of chars (AKA a string), with a new array of chars in C?

int main(void) { ... char A[32] = '00000000000000001111111111111110'; ... A = '11111111111111111111111111111111'; } This is erroneous c-code for what I want to do. I want the string in memory to be overwritten with a new string of the same length. I keep getting incompatible types -like errors.
Matt
1

votes
1

answer
2.9k

views

WPF listbox empty item template not showing

I am try to list some data in WPF listbox control. It is the first time I am using DataTemplate in WPF. Everything is working fine except when there is no data it is not showing 'No items to display'. Below is my code. No items to display And I am binding data source as shown below. itemsCtrl.ItemsS...
Matt
1

votes
1

answer
794

views

Python > Matplotlib > Animated live plot > framerate

this is my first question post. Im seeing a refresh rate of about 1 frame every 5 seconds in my live plot using the below code. I want to see something close to real-time updates. The serial rate of the data being plotted is sufficient to support at least 2 frames per second. I've built this sim...
Matt Bauer
1

votes
0

answer
239

views

tabbed activity not showing any tabs

If I try and create a new project with a tabbed activity, no tabs show. Call me crazy, but I'd actually like tabs on my 'tabbed activity'. I searched on Youtube and it seems tabs just come up for others. Did something change with the newest version of Android studio? How do I add actual tabs and...
Matt
1

votes
1

answer
61

views

Can I use javascript to retrieve the content header when setting the src on audio

I'm using the HTML5 audio control to play an mp3 file that is streaming from the server: And I am setting the src of that audio control dynamically, when a user clicks a button: $('#myBtn').on('click', function (e) { var audio = document.getElementById('audio'); audio.src = '/api/audio/f56i4gi8lh';...
Matt Spinks
0

votes
1

answer
6

views

How to get Task to call pendingIntent

I've been trying to pass a pendingIntent to the Activity Recognition Client as part of a Task, however the pendingIntent doesn't seem to be being called. I'm using Google's Activity Recognition Client (https://developers.google.com/android/reference/com/google/android/gms/location/ActivityRecognitio...
Matt
1

votes
1

answer
31

views

How do I correctly implement Android Viewport Spoofing?

I've recently built an app that uses a full screen web view to load a website I don't own. (Therefore, no control of site code) I need the webview to display a desktop version of the site, and desktop http header spoofing didn't do the trick. I found that it's the viewport size that determines wheth...
Matt Zabojnik
1

votes
1

answer
48

views

Counting words in html documents

I want to count words in html articles using R. Scraping data like titles works nice and i was able to download the articles (code below). Now i want to count words in all of those articles, for example the word 'Merkel'. It seems to be a bitcomplicated. I was able to make it work with the headlines...
matt
1

votes
0

answer
538

views

Chrome not trusting Fiddler certificates

Similar to this question: Chrome Doesn't Trust Fiddler Root Certificate But the upvoted answer (https://stackoverflow.com/a/33818661/1250301) doesn't seem to be working for me in fiddler v 5.0. If I load a site with https in chrome I get NET::ERR_CERT_AUTHORITY_INVALID message. If I 'reset all certi...
Matt Burland
1

votes
0

answer
34

views

Style SharePoint web part content to appear on same line

How do I style a list/announcement web part (currently set to Newsletter style) so that the Created By and Created Date fields appear on the same line? I don't have access to our company's Sharepoint files or Sharepoint designer so was hoping to achieve this through something like the content editor...
Matt Hall
1

votes
0

answer
611

views

pip list ImportError: libz.so.1: cannot open shared object file: No such file or directory

I have a virtual environment that has a python installation in it. I an running RHEL 6.8 and when I source the virtual environment on my RHEL machine and run most pip related commands I am seeing this. I was able to source this virtual environment on other machines that are running RHEL 6.7 and 6.6...
Matt

View additional