Michael Michael

26090 questions
1

votes
1

answer
343

views

Multiple Left Joins in MS Access using sub-queries

I'm trying to run a query with multiple left joins. I understand that MS Access has additional parameters requiring () around the joins, otherwise I get a 'Missing Operator' error, however I'm using sub-queries which adds even more complexity. I can't figure out the syntax. Can someone help? Here is...
Brian Michael
1

votes
3

answer
43

views

Render multiple elements based on a number rather than mapping through an array

I'm familair with mapping through and array to render something for each number in an array. But what is an effective way to accomplish the same thing using a number. I've found myself in a situation where I have an integer representing number of pages and a component which takes the prop pageNumbe...
Barry Michael Doyle
1

votes
1

answer
87

views

In Julia: initialize fields with nothing

I have a mutable struct with optional fields like this: mutable struct MyStruct field1::Union{Int, Nothing} field2::Union{String, Nothing} field3::Union{Int, Nothing} field4::Union{String, Nothing} # ... end I can now write a default constructor which initializes the fields with nothing: MyStruct()...
Michael
1

votes
1

answer
76

views

Expression not assignable (Calculator without using * or /)

I have to create a calculator but without using * or / within the code. I keep on getting an 'Expression not assignable' error while trying to loop using addition for conducting multiplication. Any suggestions? char op; int lhs, rhs; // stands for left-hand and right hand side of user input expr...
Michael Torres
1

votes
1

answer
32

views

HTML/CSS Issue with FA Icon & Text Wrapping

I am trying to find the correct way to write text next to an Font Awesome Icon. I would like the text to line up next to the icon, and when the text is lengthened (or the display width is shortened), I would like to to wrap next to the icon in multiple rows of text instead of under the icon. Title H...
1

votes
1

answer
127

views

Why is an “identifier” considered ambiguous with “identifier()” when they're used differently?

This is solely for example I happen to notice with! I'm using cout with operator
Michael D. Blake
1

votes
2

answer
41

views

Error in plotting time series data with plotly, truth value is ambiguous

I am trying to use plotly express to chart time series data. I am receiving this error.There isn't any boolean values in my code so I don't understand why it isn't able to crunch this code. ValueError: The truth value of a Index is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). I've...
Michael Holborn
1

votes
1

answer
59

views

Fails on encountering null

This code is part of a Shopify Sync utility. Never has failed, until we encountered a product with no value in the CompareTo Shopify field, not that we have a product with no CompareTo value. private Decimal? GetComparePrice(long? productId, long? variantId, List products) { var product = products....
Michael Conner
1

votes
2

answer
41

views

rowMeans() and mean() return different values?

I'm not sure why these two methods for getting the average return different values. The second bit of code is convoluded, I know. This question isn't about making the code better but finding out what the difference is, why they're returning different results. Thanks! data(iris) sepal_avg % rowMeans(...
Michael
1

votes
2

answer
43

views

static uint8_t variable changes to incorrect value when using += on Mac

I had a colleague today ask me a question regarding his code that I could not answer. He is writing a C unit test on Mac that makes use of a static uint8_t variable (initialized to 0) for holding the current read position from a test buffer across invocations of a seemingly simple read function in t...
Michael Cress
0

votes
2

answer
68

views

Ruby DSL used across multiple <% %> tags or multiple lines

I am writing a helper DSL to make it easier to craft a nice menu ui within a view. The view's erb is producing an error undefined method 'safe_append=' for nil:NilClass when I break the block across multiple erb tags but it works fine if I stick it in one tag. I want to understand why -- it should...
Michael K Madison
0

votes
0

answer
7

views

NPoco. Many to Many

I have two tables in my db and to c# models: public class Address { public int Id { get; set; } public string Name { get; set; } public string City { get; set; } } public class Customer { public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } } Als...
0

votes
1

answer
11

views

How to Add Active Class to Nav Link Through Pug or JS

I can't get an active class for my nav links based on which url is currently active. I had a mentor help me write this code and it was working: if filename.replace('.pug', '.html').indexOf(pageLink) > 0 a.active-nav-link= pageName else a(href=pageLink)= pageName but I came back to the project and th...
Michael Lawinger
-2

votes
0

answer
14

views

Windows Form that allows user to create buttons and manipulate their grid location, content, and filepath

I need to essentially have a predefined grid and allow the user to add and remove buttons that open executable files based on user input. Originally I created a grid containing 14 buttons (2 rows and 7 columns) that open executable files using an absolute filepath. However, I need to make a progra...
Michael Webb
1

votes
4

answer
2.3k

views

Regex to strip all punctuation except '

I'd like to strip all punctuation from a block of text that I import except for ', such as the ' in doesn't. I currently have $words = preg_replace('/[^a-z]+/i', '', $words); Which strips all the punctuation, but I'm unsure of how to include '. How can I achieve this?
Michael N
11

votes
3

answer
3.7k

views

create-react-app + nodejs (express) server

I am using NodeJs + React in my application. I am using express in NodeJs. I created my sample app using 'create-react-app' npm. I used NodeJs for calling the oauth token from react app. I mentioned this approach in this post Calling a secured REST api from Javascript without user login screen . I...
Michael Sync
0

votes
0

answer
6

views

Embed Matplotlib into HWND

After scouring the web for a while now, it seems its possible to embed Python into tkinter, qt5, etc. however, I am wondering if it is possible to simply embed it into a Windows application. Similar to how Jupyter embeds with %matplotlib inline, I am wondering if a similar functionality is possible...
Michael Choi
0

votes
0

answer
7

views

How can I connect Domo data tables to R Studio?

I am trying to connect directly to a Domo data set within my datawarehouse in Domo. Is there a way I could make a direct connection to the Domo dataset in R? I simply want to have a connection directly to the dataset so as to avoid having to download a CSV and then import manually.
Michael Lopez
1

votes
0

answer
7

views

How to exclude a path from <Route> using react-router-dom?

This code will render only when the path is '/' ? But what would do the opposite? That is, what is the best way to render always EXCEPT for '/'? Is there an 'else' equivalent?
Michael Schade
7

votes
1

answer
117

views

Converting Javascript datatables to use Opal in Rails app

I am using the ajax-datatables-rails. Below is the JS for my datatable. I want to convert the javascript into equivalent Opal.rb. jQuery(document).ready(function() { var table = $('#organizations-datatable'); var token = $('meta[name=csrf-token]').attr('content'); table.DataTable({ 'processing':...
Michael K Madison
0

votes
0

answer
9

views

getSession not working in Angular 6 & Spring Boot

I 'm working on an Angular 6 and Spring boot project. I 'm setting a server-side custom session in spring boot in @RestController @RequestMapping(value = '/movies',method = RequestMethod.GET) public ResponseEntity getAllMovies( HttpServletRequest request) { try { final HttpSession session = request...
michael
1

votes
1

answer
2.7k

views

How to create a histogram of 2D arrays in ipython

I have use the random number generator create a 1000*1000 2d arrays. How can i create a histogram of those 2D arrays? s1=np.random.rand(1000,1000)
Michael Ji
-1

votes
1

answer
79

views

Simplify/Optimize Regex in Java

I am using a Java-based machine learning library. The library provides a method called readInstances to input data, preprocess it and then classify it. For its parameters, the method readInstances takes FileReader, Pattern and an array of integers which are the indices of fields of interest in each...
Michael
0

votes
0

answer
23

views

Sum calculation in a Form

I'm creating a form that outputs to a HTML Document. The user as some options which affect the discount to be applied. I have the Subtotal Working but the Discount and Grand total don't work properly. The Discount will output some values but others don't display. The grand total only displays as NaN...
Michael Alcock
1

votes
1

answer
3.6k

views

PKCS#11 engine for openSSL

I'm trying to setup openSSL under Windows 7 to use a vendor specific security module. From the vendor I got a PKCS#11 API dll (lets say vendor.dll). The PKCS#11 engine has been created according to https://github.com/OpenSC/libp11 As described in the link, for testing, I start openssl engine pkcs11...
michael
1

votes
2

answer
446

views

Angular Router Module ActivatedRoute returns null firstChild when one exists

Following one of Todd Motto's excellent guides (https://toddmotto.com/dynamic-page-titles-angular-2-router-events) I came across a situation that I can't explain. Here's some code: this.router.events .filter((event) => event instanceof NavigationStart) .map(() => this.activatedRoute) .map((route) =>...
Michael D Johnson
0

votes
0

answer
7

views

parameterized console character positioning

I'm not sure how to dynamically adjust characters in a function I'm using to write to a console where there are strict locations necessary in addition to dynamic scalability that you could get from 'format table', but I'm looking to do things a little differently so I can get away from needing an fi...
1

votes
1

answer
71

views

Rewrite Recursive Function in Typescript Cannot Find Name

I have the following recursive function written in JavaScript: function getNestedChildren(arr, parent) { let out = []; arr.forEach(function (item) { if (item.Parent == parent) { let children = getNestedChildren(arr, item.ID); if (children.length) { item.children = children; } out.push(item); } }); r...
Michael
1

votes
2

answer
1.1k

views

How to add support for PDF files with Vue Cli 3?

I need to configure Webpack to accept and handle PDF files with url-loader via the Vue Cli (latest). vue.config.js module.exports = { configureWebpack: { rules: [ { test: /\.(pdf)(\?.*)?$/, use: [ { loader: 'url-loader', options: { name: 'files/[name].[hash:8].[ext]' } } ] } ] } } Does the above loo...
1

votes
2

answer
1.3k

views

Azure function C#: Create or replace document in cosmos db on HTTP request

I'm trying to build an Azure function in C# that creates a new document object in Azure cosmos DB using SQL API if an id doesn't already exist and updates a document object if it already exists. The context behind this is logging chatbot conversation history to unique user sessions. Input: HTTP GET...
Michael
1

votes
2

answer
293

views

R Error in today() : could not find function “today”

I have an R script that just prints todays date. It runs just fine in Rstudio but when set as a task within a batch file it produces the following error Warning message: package 'dplyr' was built under R version 3.4.4 Loading required package: NLP Warning message: package 'tm' was built under R ver...
Michael T Johnson
1

votes
1

answer
389

views

Angular 7: Access list element in an array

I'm trying to get one component of a list. The list is in an array. How do I get one specific component of the list? In this case I'm trying to get the 'source' element of hierarchialGraph.links. Code: Typescript of the array (just a snippet): showGraph() { this.hierarchialGraph.nodes = [ { id: '1',...
Michael
1

votes
3

answer
86

views

How do I call a built-in Dyon function from Rust?

I'm trying to call a Dyon built-in function (sin) from Rust: use dyon::{Module, Runtime, Variable}; use std::sync::Arc; fn main() { let mut dyon_runtime = Runtime::new(); let module = Module::new(); let dyon_module = Arc::new(module); let v = dyon_runtime.call_str_ret('sin', &[Variable::f64(0.0)], &...
Michael Anderson
1

votes
2

answer
41

views

Checking if first 3 characters of UI TextField are numeric in Swift

I want to check if the first three characters entered in the UI Textfield are numbers. I could do this easily in Python, but for some reason in Swift it's a pain. Here's my python if statements (which I want to 'translate' into swift as it works): str = '123abc'...
Michael Manfield
1

votes
1

answer
51

views

Catch numpy ComplexWarning as Exception

Consider the following example: >>> import numpy as np >>> a = np.array([1.0, 2.1j]) >>> b = np.array(a, dtype=np.float64) /Users/goerz/anaconda3/bin/ipython:1: ComplexWarning: Casting complex values to real discards the imaginary part #!/Users/goerz/anaconda3/bin/python How can I catch the ComplexW...
Michael Goerz
1

votes
1

answer
40

views

does snprintf() use root memory by format specifier? [duplicate]

This question already has an answer here: Identical string literals are considered equal? [duplicate] 3 answers Addresses of two char pointers to different string literals are same 10 answers Why is “a” != “a” in C? 11 answers For instance, I have 10 of these calls in a function, snprintf...
Michael Tran
1

votes
2

answer
27

views

Deploy/Reload code from python pyramid project in production

I use ...\pserve development.ini --reload in my dev environment to restart my API when code change. The doc says: Auto-template-reload behavior is not recommended for production sites as it slows rendering slightly; it’s usually only desirable during development. But the doc has no proposition for...
Michael
1

votes
1

answer
41

views

Set Backgroud color Button for different buttons

I have 3 Button and i want to click on one button and change it color from the button i click, if i click on another button set back to it original background color and put it background color on the other button. html code - Call's the css and make button function myFunction() { document.getElemen...
Michael Luis
1

votes
1

answer
16

views

How to import JS in TS with noImplicityAny and without allowJs

I'm using Webpack and @babel/typescript to compile a mixed TypeScript and JavaScript project. I'm using --noImplicitAny to encourage taking advantage of typing. I'm not using --allowJs because my project is so big that it chokes the TypeScript compiler, and it destroys Visual Studio highlighting/Int...
Michael Crenshaw
1

votes
1

answer
2.2k

views

How resize Tab control programmatically?

I want programmatically resize tab Control on my winform. tabCtrl.Size.Width = Convert.ToInt32(numericUpDown1.Value); tabCtrl.Size.Height= Convert.ToInt32(numericUpDown2.Value); But I get error: Cannot modify the return value of 'System.Windows.Forms.Control.Size' because it is not a variable Any id...
Michael

View additional