Mike Mike

21930 questions
1

votes
2

answer
593

views

How to replace first characters in a file name with a string?

I've been working on a script to maintain the archive from my IP camera DVR. My recording software outputs filenames formatted so that the first character is the camera number, followed by a date and time stamp. ex. 1_2017-11-03_00-45-07.avi I want to replace the first character with a string that r...
Mike Kent
1

votes
1

answer
404

views

Listening for button click in PWA service worker

I am trying to follow the following example for PWA Push Notifications but have a general question regarding service workers https://developers.google.com/web/fundamentals/codelabs/push-notifications/ Within my Service Worker, I want to add a listener to a button/anchor tag My Service Worker is init...
Mike
1

votes
1

answer
766

views

Open modal from method in vuejs with dynamic content

I am building a component in VueJs where need to open modal if condition gets true and get the data from controller and display in the modal. I have looked online but could not find how to set up the dynamic content after receiving data using axios. Here is my ModalComponent.vue × Close export defa...
Mike Ross
1

votes
3

answer
61

views

No access to dynamically allocated array of 2 dimensions [duplicate]

This question already has an answer here: Dynamic memory access only works inside function 1 answer I'm experimenting with the dynamic memory allocation of variable sized arrays. The function 'ft_ultimate_range' seems to work, however, a problem arises when I try to access and print the values of e...
Mike
1

votes
3

answer
377

views

Can an anonymous lambda function be bound to an object to allow the code in the lambda to access the object's members?

I want to allow a lambda function to access members of an object. There are 2 classes involved here: The class I want to access class D { public: void doIt() {}; }; An initializer class for management template class I { public: I(std::function f) { someManager->register(this); _func = f; } void run(...
Mike Lischke
1

votes
2

answer
67

views

Way to extract positive and negative numbers from one array to another two (positive and negative)

I'm studying c# and I was wondering if there is any way to extract positive and negative numbers (integers) from one array to others two, one that contains the positive numbers and the other negative ones I've tried something like public static void Main(string[] args) { int[] num = new int[50]...
Mike_b
1

votes
1

answer
221

views

In Symfony2 what is the best way to use a multi word name and get a good RESTful url

I'm using the FOSRestBundle to build my symfony2 API. I have entities called things like SupportRequestTemplate, which I would like to see in the API end point but when I create the Actions with names like getSupportRequestTemplateAction(Request $request, $id) {} FOSRest treats each camel case word...
mike
1

votes
2

answer
331

views

How to automatically update migration file based on updated model in Laravel

Can we update our migration file based on model where we have updated? I know we have command php artisan make:model modelname --m to create model and migration in same time. But when i updated the model, the migration still same (cannot updated automatically)?
Mr. Mike
1

votes
1

answer
1k

views

Lazy Loading Routes in React With Typescript AsyncComponent

I'm trying to lazy load routes in React by implementing the AsyncCompoment class as documented here Code Splitting in Create React App. Below is the es6 asyncComponent function from the tutorial: import React, { Component } from 'react'; export default function asyncComponent(importComponent) { clas...
Mike Lunn
1

votes
1

answer
971

views

React-Native: AsyncStorage crashes Android app

I'm writing an App for Android and iOS using react-native. The iOS version works perfectly but the Android version crashes every time it try to calls a AsyncStorage function. When my App launches, it checks if there are some user-information stored on the device. It uses this function here: static a...
Mike_NotGuilty
1

votes
1

answer
30

views

SQL Server : returning a cost based on a date range between 2 tables

I have 2 tables, one for transactions of inventory and one for standard cost history. I am trying to get the standard from the cost table by using the dates to determine what standard to select between the 2 tables. So as an example: ProductID Trans.Date ----------------------- P001 12/26/...
Mike Mirabelli
1

votes
3

answer
22

views

how to filter already retrieved data from firebase?

I have a list of posts under the '/posts/' , I have retrieved all posts and store it in an array all_posts: get_all_posts(){ this.all_posts = []; firebase.database().ref('/posts/').once('value').then(snapshot => { foreach.snapshot{ let tmp_data = { post_id: snapshot.key, title: snapshot.val().title...
mike
1

votes
4

answer
82

views

How do I assign to a variable in a for loop in C?

Noob, working on an encryption problem, and I want to iterate through combinations in an array in C, i.e. aaa, aab, aac, aba, etc. and then pass each combination to a function (to check whether that combination is the correct code). I can print what I want to console no problem, i.e. aa, ab, ba, b...
Mike
1

votes
3

answer
52

views

Convert a string with operation to int using sql query

persons is a tinytext field and can contain '4 + 2', '4+2', '4 +2', '5' or '' and so on. I would like to select and int like 6, 6, 6, 5 and 0 from that MySQL 5.6 Table. Tried this without success: SELECT CAST(persons AS INT) FROM Table SELECT CONVERT(INT, persons ) FROM Table
Mike
1

votes
2

answer
44

views

Kotlin: equal comparison seems OK on nullable, but greater than comparison is not

I am new to Kotlin. I am following along a tutorial where the GUI portion involves this code snippet: sampleList.addMouseListener(object: MouseAdapter() { override fun mouseClicked(mouseEvent: MouseEvent?) { if (mouseEvent?.clickCount == 2) { launchSelectedSample() } } }) mouseEvent is obviously som...
Mike Williamson
1

votes
2

answer
59

views

How to randomly get an attribute

I know how to get the type attribute of the first input element: document.getElementById('button').addEventListener('click', function() { var type = document.querySelectorAll('input')[0].type; document.getElementById('p').textContent = type; }); Get it Is there a way to randomly get a type attri...
Mike
1

votes
3

answer
40

views

How to convert chars to lines in Python using read method

Noob here. I need to read in a file, using the read (rather than readlines()) method (which provides the input to several functions), and identify all of the lines in that file (i.e. to print or to append to a list). I've tried join, split, appending to lists, all with little to show. # Code I'm stu...
Mike
2

votes
0

answer
27

views

Function that compares two objects and assigns old object prop value to new object prop value if the new value is empty or null?

I'm trying to ensure that any existing, non-null or empty values are not overwritten with empty or null values from an API call. For example, assume that, originalReference['data']['articleTitle'] = 'Something or other'; and reference['data']['articleTitle'] = '';, where originalReference is the...
Mike K
7

votes
1

answer
140

views

How to turn off TCP PSH flag in the POSIX function send()?

I am sending commands to a stepper motor system using Ethernet. The commands get the motor to move, or respond with drive status, or configure the drive, etc... The stepper motor system sometimes hangs, or fails to execute the command, and the manufacturer having looked over everything I supplied ha...
Mike
1

votes
1

answer
557

views

Multiple-line example in openapi v3 response body [duplicate]

This question already has an answer here: How to add multiple example values in swagger propertise? 1 answer Is there a way to code a multiple-line example in a request body? If possible I'd like my OpenApi document to display as follows when running under Swagger-UI. So far, all I've been able to...
Mike
1

votes
1

answer
53

views

Codeception cleanup vs. depends

When working with Codeception Acceptance tests i got to realise the best way is to cleanup the database before every test and make every test independent. But some Cest Tests depend on each other. So if i write: /** * @depends createObjectBase * @___skip */ public function createObjectMore(A...
Mike
1

votes
1

answer
39

views

Express OAuth Authorization for Different Access Methods

I am looking to figure out best practices for the following scenario. I am a relatively new/hobby programmer. I am developing a chat bot that is using Dialogflow. I want users to be able to use different messaging apps to be able to access the data and information in a backed database, but that I...
Mike Nelson
1

votes
0

answer
159

views

LinkedIn's shareArticle Dialog Window Bug

I'm hoping to connect with someone from LinkedIn or someone that is familiar with their http://linkedin.com/shareArticle popup. I've added a 'Share on LinkedIn' button on my website that uses LinkedIn's shareArticle parameterized URL to create a share popup dialog. I'm supplying OpenGraph parameters...
Mike B.
1

votes
1

answer
221

views

Linqpad - Linq to Sql Ambiguous table and linked server name

Using Linqpad & Linq to Sql, I am trying to join some data from a table in the database to data that which is contained on a linked server. I have followed the instructions to create a connection with the linked server (http://www.linqpad.net/FAQ.aspx#cross-database) My problem seems to be that I ha...
Mike B
1

votes
1

answer
176

views

Using jQuery with Visual Studio SPA template

I've created a project using the Visual Studio SPA template. This project is using ASP.NET Core template, Vue.js and Webpack. I'm having issues using jQuery within the project. Within the package.json file, it has 'devDependencies': { '@types/webpack-env': '^1.13.0', 'aspnet-webpack': '^2.0.1', 'aw...
Mike Walker
1

votes
0

answer
68

views

TSQL from 2012 to 2016, lost all performance on same query

I face this issue when same query performed at least 30 times slower on 2016v, and that was only for sample data, in real life it never finish, I ran it 24hr+, I see that inflation rate is very high, having 2 rec on input produces 200K rows. This query produce pretty complex Execution Plan and they...
Mike S
1

votes
1

answer
70

views

SQL Server create database dynamically and use the database in the script

I have a script that can be represented by the following: DECLARE @DatabaseNamePart VARCHAR(50) = 'Part1' DECLARE @DataBaseName VARCHAR(70) = 'MyDataBase_' + @DatabaseNamePart IF NOT EXISTS (SELECT * FROM master..sysdatabases WHERE [name] = @DataBaseName) BEGIN DECLARE @SqlQuery NVARCHAR(150) = 'CRE...
L.Mike
1

votes
1

answer
53

views

Different behavior between Jupyter kernel and Python

I've been working on a Jupyter notebook on my local, and have recently migrated it to an Ubuntu Linux VM located on a remote server. I've install Python and Jupyter on the remote server successfully, and am accessing it via SSH portforwarding. I have been able to run other scripts and files successf...
Mike
1

votes
0

answer
507

views

Angular4+ decode route parameters

I have such URL in my app: http://example.com/page/payments;offerId=5 After exploring the page (going back and forth, reloading page) sometimes this url gets encoded to http://example.com/page/payments;offerId%3D5 and breaks my page because I use route.snapshot.params... somewhere in the code. Aft...
Mike
1

votes
0

answer
81

views

how to save value from POST method into parameter of Java class?

I'm new in Java, and currently try to create my own project, but have a problem with displaying information about user in his main page. Now I need to save a value from my JSP page (/login) which use method POST into parameter of my Java class('Controller'). login.jsp Log in with your account Log in...
Junior Java Mike
1

votes
1

answer
75

views

Azure CLI 2.0 Export Error

I have a resource group called log-rg. I want to generate a deployment script and tried using: az group export --name log-rg and I get: The schema of resource type 'Microsoft.EventGrid/topics' is not available. Resources of this type will not be exported to the template. This is the same error I get...
Mike W
1

votes
1

answer
140

views

Installing wkpdtothtml on google cloud platform

I created a node express application that acts as a print api based on the wkhtmltopdf plugin. I am trying to deploy it to Google Cloud Platform, but I will need to install the wkhtmltopdf binaries on Google Cloud Platform first. How do I go about this? I am using Google App Engine service.
Mike Axle
1

votes
1

answer
60

views

How is Linux dealing with blocking I/O processes

I have a system that does a lot of blocking network calls. Based on that the CPU idle time is relatively high as well as the overall system load. When I add more CPUs to the system idle time remains the same but system load drops. Why is that happening? Is the following what is happening behind the...
mike
1

votes
0

answer
324

views

fontspec (xetex/luatex) and fontconfig

LuaTeX and XeTeX are passing on a warning on from the fontspec package, and I'm not sure whether I should worry. The following minimal code will generate the warning: \documentclass{report} \usepackage{fontspec} \setmainfont[Script=Cyrillic]{Arial} \begin{document} \end{document} The warning is fon...
Mike Maxwell
1

votes
0

answer
279

views

ffmpeg - Take Frame Accurate Screenshot

trying to find a way to take frame accurate screenshots with ffmpeg WITHOUT re-encoding the video. When I use: ffmpeg -ss -i input -vframes 1 -q:v 2 output.jpg with -ss being hh:mm:ss.ms, not matter how I specify the milliseconds, it is never frame accurate with this command. it seems to be landing...
mike
1

votes
1

answer
74

views

Shared Object is statically linked against boost program_options; application links shared

I'm working on a library that is statically linking our boost dependencies so that we do not have to worry about conflicting with users. Our library statically links date_time system thread regex filesystem program options We then have an executable that also needs program_options and links against...
Mike K.
1

votes
0

answer
317

views

Spring Framework and encode/decode of public key

I am trying to create a new RsaVerifier to check a public key: JwtHelper.decodeAndVerify(token, verifier); I do believe it's a valid public key. I'm copying it correctly from my browser. It does begin with a return character though. It actually has them in several places: -----BEGIN PUBLIC KEY-----\...
Mike
1

votes
1

answer
82

views

Use csv file with multiple newline characters in Python 3

I'm trying to import a csv file which has # as delimiter and \r\n as line break. Inside one column there is data which also has newline in it but \n. I'm able to read one line after another without problems but using the csv lib (Python 3) I've got stuck. The below example throws a Error: new-line...
Mike Nathas
1

votes
1

answer
23

views

In excel can anyone show me how to concatenate strings and variables to make a cell reference?

If I manually reference a cell in another spreadsheet (by typing = in the destination cell and then clicking in the source spreadsheet), excel creates a formula like this: ='H:\excel\data\[source_file.xls]Sheet1'!$C$5 I am wanting to create that formula from the cell and path which are stored in cel...
Mike Avison
1

votes
1

answer
105

views

Groovy: Mockito UnfinishedStubbingException using verify (and inline mocks)

I'm trying to verify the calling of a method on a FileChooser. I'm coding in Groovy, and this appears to be the problem. I'm using the 'incubating' Mockito feature which enables you to mock even a final class. Code is: FileChooser mockFC = mock(FileChooser.class) doReturn(mockFC).when(spyCH).getFile...
mike rodent

View additional