Tom Tom

16697 questions
1

votes
1

answer
92

views

Java Spark: com.mongodb.spark.config.writeconfig issue

I am trying to connect with MongoDB via java spark connector and I am getting an error 'com.mongodb.spark.config.writeconfig', when I submit the jar and run the jar in spark shell. Here the error screenshot: Could you please help me to resolve this issue. I have tried this as well, but no success. $...
Tom Swayer
1

votes
0

answer
55

views

Does Realm respects “Writable and Executable Segments (Enforced for API level >= 26)”

According to Android 8.0 Behavior Changes there was a change in NDK that has the following statement In apps targeting Android 8.0 (API level 26), native libraries no longer load if they contain any load segment that is both writable and executable. I am not sure what it means, but I am curious if...
Tom Koptel
1

votes
0

answer
388

views

How to set, Laravel Queue Payload format

How to set, Laravel Queue Payload format. I don't want to change the source code. source code: File Path: vendor\laravel\framework\src\Illuminate\Queue\Queue.php /** * Create a payload for an object-based queue handler. * * @param mixed $job * @return array */ protected function createObjectPaylo...
tom lee
1

votes
3

answer
720

views

How to handle deadlock in Doctrine?

I have a mobile application and server based on Symfony which gives API for the mobile app. I have a situation, where users can like Post. When users like Post I add an entry in ManyToMany table that this particular user liked this particular Post (step 1). Then in Post table I increase likesCounter...
Tom
1

votes
1

answer
64

views

How do I manipulate python numpy values in a separate C++ plugin

I'm trying to send the data of a numpy array in Python to a separate C++ plugin. Is it correct to just send the address I get from __array_interface__['data'][0] to a C++ plugin, and create a double pointer from it there? I'm assuming that since it's a flattened array, all the values are aligned w...
Tom
1

votes
1

answer
334

views

C# Take window/desktop screenshot using SlimDX

I am new to SlimDX and I've heard that there is a way to capture screenshots using this library. The reason I want to use SlimDX is that I want to capture screenshots much faster than Graphics.CopyFromScreen() so that I can make a livestream app running at higher framerates. I have some code I foun...
Tom Lenc
1

votes
2

answer
44

views

How to access the contents of a directory passed in the URL parameters passed to a browser

First off, for Chromecast reasons, I want to, currently, limit the solution to the Chrome browser. What I'd like to do is package up a directory of images, with a launcher batch file (cmd or sh) and an html file. The html file is to be completely self contained, with no imports. The bat file would c...
Tom Kimpton
1

votes
1

answer
1.9k

views

IDX10214: Audience validation failed. ADFS .Net

I'm validating against my ADFS server and am getting the following error message. 'IDX10214: Audience validation failed. Audiences Did not match: validationParameters.ValidAudience' This link shows my code--its a very simple proof-of-concept for authenticating within the visual studio IDE. It tak...
Tom McDonald
1

votes
1

answer
299

views

Create a random bijective function which has same domain and range

Create a random bijective function which has same domain and range. By random bijective function I mean a function which maps the elements from domain to range using a random algorithm (or at least a pseudo-random algo), and not something like x=y. The domain and range can be a very small set someti...
tom
1

votes
0

answer
279

views

plupload - issue with chunk size

I've just starting out using plupload and have tried the basic example and the PHP chunked example. These seem to work fine when I keep my chunk_size to 2048kb However, if I increase this value the webpage shows the file has uploaded correctly but the upload folder either doesn't show the file or on...
Tom
1

votes
2

answer
295

views

Code analysis changes if SonarQube full analysis report enabled in VSTS

I've been setting up SonarQube analysis for one of our builds in VSTS, and I've noticed that there's a difference in the code analysis / build warnings if the advanced option 'include full analysis report in build summary' is enabled in VSTS. We have a custom ruleset enabled for our local builds in...
Tom Anderson
1

votes
0

answer
43

views

Refactoring PHP script for adding new SELECT query for insert

I have a working PHP script that currently runs SQL queries to pull data from different tables in INSERT/UPDATE one single table. It's working fine but I now need to add a new select query to it and after a bit of refactoring I'm only needing to use one sql server connection now which helps me in te...
Tom N.
1

votes
3

answer
41

views

Issue with searching for strings in text in Powershell

I am building a script to monitor backups with Ahsay in PowerShell and have run into an issue with identifying backup types, it works by checking for certain keywords in the first few lines of the log file, and I want to have it so that if it contains the word 'File List' but also contains the word...
Tom Halverson
1

votes
0

answer
70

views

Scipy.stats binned_statistic_dd for 3D closest-to-centroid per bin

Action Select closest to centroid for each bin in binned 3D point set. Attempts Using binned_statistic_dd from scipy.stats I tried to take the binned mean of this 3D pointset. However, it will only compute the mean for one of the dimensions at a time. import numpy as np from scipy.stats import binne...
Tom Hemmes
1

votes
2

answer
39

views

Issues with validating fields in constructor of a subclass

I am now learning about Java's inheritance. I have total of 3 questions, and thank you for your support. 1st question: Can I validate a class's fields in its constructor? 2nd question: Some people recommended me to throw an exception for validation. Does it mean throwing an exception to the calle...
Tom_the_cat
1

votes
1

answer
137

views

How to use the get method with multiple hosts in fabric v2?

I have a fabfile that run several tasks on the hosts. This results in the creation of a file result.txt in each of the hosts. Now I want to get all these files locally. This is what I tried: from invoke import task @task def getresult(ctx): ctx.get('result.txt') I run with: fab -H host1 host2 host3...
Tom Cornebize
1

votes
0

answer
35

views

Find the source file of a function in Firefox DevTools

In Chrome Devtools console, if I output a Function object, it shows the top few lines of the function. I can click on the function name in the output and it takes me to the file and line where the function were loaded from (or from the original source if theres a source map): In the new Firefox Devt...
Tom A. Vibeto
1

votes
0

answer
638

views

How to load a .pickle file on python from google cloud storage

My problem is the following: I have two .p (pickle files) in my bucket in the google cloud storage and I would like to load them on my jupyter notebook (where I run my code on the VM instance). I tried the following url = 'http:\\\tree\storage.googleapis.com\' data_x = pickle.load(open(url + '\.p'...
Tom
1

votes
2

answer
40

views

Eclipse IDE Double Clicking Java File In Project Explorer Expands It

This may seem very small thing but it annoys me much since I'm used to code in Eclipse. When I double click a java source file in Eclipse it shows classes inside the file (expanding contents of java file) as marked by red circle in the image below. I wanna disable this behavior, I have used Eclipse...
Tom Milberg
1

votes
0

answer
31

views

Data Source Name overrides Data Source Definition

My Microsoft Office 365 ProPlus subscription updated over the weekend to Version 1708 (Build 8431.2153) and all of my MS Access external links to Salesforce data broke. I am using the Progress DataDirect 7.1 drivers and I had created a USER DSN named 'Salesforce'. It seems that the updated Microsof...
Tom Stluka
1

votes
1

answer
554

views

PHP 7.1 'A non-numeric value encountered' with Twig 1.35

I am using the Twig template engine and I have just upgraded my PHP version to 7.1. I now get the following warning when rendering any page: A PHP Error was encountered Severity: Warning Message: A non-numeric value encountered Filename: Twig/Environment.php(469) : eval()'d code Line Number: 91 Bac...
Tom
1

votes
0

answer
635

views

pyotp OTP secret key format

I'm trying to programmatically generate OTP codes with pyotp, to login with headless browser, but I'm not sure how to handle the format of the shared secret key. Usually the shared secret key is formatted like: ABCDEFGHIJKLM123 But for the site I'm trying to login to the format is: ABCD EFGH IJKL MN...
Tom
1

votes
1

answer
37

views

Attaching click event to certain links within a div

I have navigation divs with a number of links to both internal content and external pages. We are creating a vanilla javascript to intercept any clicks, determine the content required and insert it in the page, rather than reloading the entirety of the page everytime. Creating a script that uses a...
Tom
1

votes
0

answer
227

views

Java code returns an empty error message in Eclipse even though the same code works in TextEdit & Terminal (Mac OS)

I tried to run the following simple Java code in Eclipse. There is no indication of a bug. However, every time I try to run it, it returns an empty error message (see the screenshot). Pls advise! public class CallingStringClass2 { public static void main(String[] args) { String greeting = 'Hello W...
Tom Yoritaka
1

votes
0

answer
97

views

Symfony 3 form data on edit page has null field for file upload field

I have a fully working file upload which works when a user creates a course. I use a service which contains the following code to upload the files and to update the form data with the image paths that need to be persisted. public function handleCourseUploads($request, $formData, $originalCourse) {...
tom Bannister
1

votes
1

answer
51

views

java code to run a method when a searchview query is submitted

I have a searchView called mySearchView. How can I run a method when the search is sent? This method will also use the text from the searchView. I have the xml for the activity, searchView and a java file with a onCreate method.
tom j
1

votes
1

answer
117

views

Cosmodb, why is this update not working?

I am trying to query orders and update them. I have been able to isolate my problem in a unit test: [Fact(DisplayName = 'OrderDocumentRepositoryFixture.Can_UpdateAsync')] public async void Can_UpdateByQueryableAsync() { var order1 = JsonConvert.DeserializeObject(Order_V20170405_133926_9934934.JSON);...
Tom
1

votes
1

answer
70

views

Operator overloading, definition/header for all operators

How best to split the following iterator code into a header and definition. // std::iterator example #include // std::cout #include // std::iterator, std::input_iterator_tag class MyIterator : public std::iterator { int* p; public: MyIterator(int* x) :p(x) {} MyIterator(const MyIterator& m...
Tom Shaw
1

votes
2

answer
30

views

python regular expression handling bracket

string = '1f23wsedrfth 567tgyh112' expectedChecksum = re.search( '[0-9a-f]{5}',string ).group(0) Traceback (most recent call last): File '', line 1, in AttributeError: 'NoneType' object has no attribute 'group' Why is it caused an error? I thought the expectedChecksum should be '1f23w' I tried the...
Tom Wang
1

votes
1

answer
320

views

Angular 2 *ngFor recreates components on every change check

I have two nested *ngFor loops, one iterates through libraries and the other one iterates through all items of this library, there is an angular component dedicated to each item. Now the problem is, that these item components get recreated on every change check of angular, which I noticed by placing...
Tom Doodler
1

votes
1

answer
35

views

Elasticsearch: Generating an aggregate field during search query

new to ES here. I'm trying to implement a search engine from a source with the following schema in 1 index: index:paper { 'title': string, 'author': string, 'id': string, 'references': [string:another_paper.id, string:another_paper.id, ...], 'pubDate': date } Let's say I want to perform a search for...
Tom
1

votes
1

answer
328

views

Is a primary key necessary to replicate inserts using pglogical?

I tried to setup a simple master > slave replication using pglogical. The pglogical docs mention that one needs a primary key for replicating updates and deletes. Since I don't need neither one, I set up a replication set at the provider as follows: SELECT pglogical.create_replication_set( set_name...
Tom
1

votes
0

answer
156

views

dotnet core 2.0 - programmatically attach the VS2017 debugger to a process

In my dotnet core 2.0 application I re-launch the same application in a different process (with some different arguments) at a certain point. I want to be able to programmatically attach the current Visual Studio (2017) debugger to the new process. Here is an example of how it is done in full framew...
Tom
1

votes
0

answer
48

views

Looping query result by user id and totalling in spreadsheet

I'm trying to create a spreadsheet within a php script that selects data from a mysql query. The query works and my below script works in the sense that it inserts my entire result set into my spreadsheet like so: The only thing I can't figure out is how to modify the array loop so that I can sum to...
Tom N.
1

votes
1

answer
458

views

How to reuse LSTM layer and variables in variable scope (attention mechanism)

I have an issue in my code where I would like to share weights in my lstm_decoder (so essentially just use one LSTM). I know there are a few resources online on that but I am still unable to understand why the following does not share weights: initial_input = tf.unstack(tf.zeros(shape=(1,1,hidden_si...
Tom
1

votes
2

answer
666

views

RegWrite to HKLM isnt working. Any ideas?

Hi overflow community, I am trying to create a key and a value which will reside in the HKEY_Local_Machine folder. Every time I try and run the below code I get the error 'Invalid Root in registry key'. Dim WshShell, bKey Set WshShell = WScript.CreateObject('WScript.Shell') WshShell.RegWrite 'HKLM\...
Tom J
1

votes
1

answer
266

views

UIPrintPageRenderer paper size not changing

I am trying to convert some HTML into a PDF document to save on my back end. However, I am unable to set the paper size of the print renderer. The paper size always remains A4 even when I change the 'paperRect' - I need the paper size to be A6. Any ideas? let pageFrame = CGRect(x: 0.0, y: 0.0, width...
Tom Fox
1

votes
0

answer
61

views

MySQL migrate data from one table to another

I'm attempting to move data from one table to another, as part of a restructure to the database architecture. I'm using PHPMyAdmin and MySQL to do so. The SQL is meant to, for each emergency_contacts.id, move e_c.id and e_c.activity_id to activities_emergency_contacts, where the pair will form a com...
Tom Barden
1

votes
1

answer
255

views

MariaDB MySQL Optimisation

I stuck a bit with setting the best performance of MariaDB on my VPS. I have: 6 cores; 16GB RAM; 300GB SSD; CloudLinux; LiteSpeed >> MySQLTuner 1.7.0 - Major Hayden >> Bug reports, feature requests, and downloads at http://mysqltuner.com/ >> Run with '--help' for additional options and output fi...
Tom R
1

votes
0

answer
310

views

Mamp Pro Nginx 502 Bad Gateway in WordPress admin-ajax.php

I've recently migrated a WordPress site: From: Mamp Pro / Apache / PHP 5.6.32 / MySQL 5.5.38 To: Mamp Pro / Nginx / PHP 7.0.14 / MySQL 6.5.38 One issue I've been having is in the WP 'Add New Post' screen, I'm getting a 502 (Bad Gateway) error in the console log coming from wp-admin/admin.ajax.php. D...
Tom

View additional