Tom Tom

16721 questions
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
1

votes
1

answer
75

views

large data shuffle causes timeouts

I'm trying to read a 100000 data records of about 100kB each simultaneously from 50 disks, shuffling them, and writing it to 50 output disks at disk speed. What's a good way of doing that with Dask? I've tried creating 50 queues and submitting 50 reader/writer functions using 100 workers (all on dif...
Tom
1

votes
1

answer
18

views

how to stop skipping 1100 frames

I have 2 below that run a search functionality but Im skipping anywhere between 200-1100. it uses the openLibrary Search API as well as referencing my own SQL server on AWS, its fully functional but is just skipping so many frames package tk.bookpass.bookpass; import java.sql.*; import android.conte...
tom j
1

votes
0

answer
95

views

Default read-only user for MsSql database

We're currently using a tool (no way to change this as it is tied to a larger machine) which creates databases (not tables) on a SQL server (MSSQL 2014) on a weekly basis. These are named: RESULT_201801 RESULT_201802 ... Over the course of one week, those databases will get filled with data until th...
Tom L.
1

votes
1

answer
36

views

Stopping 'stepdown' effect in responsive mode

I'm having trouble aligning 3 sets of image and text in a sidebar on a WordPress site. I've created a custom CSS class to float the images left as I wanted the accompanying text to wrap around the image using: .floatLeft{float:left; margin-right:5px} This works fine in desktop mode: But when in res...
Tom Waterfall
1

votes
0

answer
35

views

Driving simulation:overtaking, im having an issue with lane changing in my netlogo

In my project i am writing a semi-autonomous car simulation, as a beginner i have used a basic version of a driving simulation and aiming to expand it, whist expanding the coding i was trying to mimic lane centring, so have made each lane or a road three patches thick, in doing so i'm struggling to...
Tom Best
1

votes
0

answer
117

views

Rx.js, handling Chrome Extension webrequest API callback functions

I'm trying to use Rx.js to handle the flow of Chrome extension webrequest API. Each webrequest addListener() call takes a mandatory callback function as the first parameter. This sends request objects to the function. However, the callback can return a webRequest.BlockingResponse that determines th...
Tom
1

votes
2

answer
45

views

checking for nullability before assigning to array

I have multiple destination arrays defined and reading multiple source arrays and adding them to the destination array in my angular 4 application. I need to check for nullability before adding them as getting an error. Destination arrays public remainingCapInsPremiumPaid: number[] = []; public rema...
Tom
1

votes
2

answer
54

views

how to change a dimension of array in python?

I am a newbie in python. I have a question about the dimension of array. I have (10,192,192,1) array which type is (class 'numpy.ndarray'). I would like to divid this array to 10 separated array like 10 * (1,192,192,1). but I always got (192,192,1) array when I separate. How can I get separated arra...
Tom
1

votes
1

answer
28

views

$scope.$apply cannot update view for child directive when compile recursion prevented on parent

I need some help with an app I am trying out. I am trying to modify the app found here https://github.com/mfauveau/angular-query-builder to a specific need. A child directive isolated scope does not populate the view correctly/ child directive scopes are getting mixed because of parent directive rec...
Tom
1

votes
0

answer
149

views

Error Running f2py, Symbol table not found

I have been trying to get f2py to work on my windows 10 64-bit machine. I am using mingw32 and gnu95 compiler. When I run this command in command prompt python f2py.py -c -m Test2 Test2.f95 --fcompiler=gnu95 --compiler=mingw32 I get the following message produced running build running config_cc unif...
Tom Heeley
1

votes
1

answer
15

views

Trouble filtering out geoJSON undefined properties in .bindPopup

I'm having a lot of trouble filtering a geoJson layer with sample data. This is a leaflet map showing locations where soil has been tested for lead. Some locations have been sampled up to five times and others only one. I would like to only display a value if one exists. The GeoJson separates these...
Tom
1

votes
0

answer
397

views

Pass Component as background image styled components

I Have 2 active buttons and onClick I would like to be able to display my svg component when the button state is active, so I have 2 problems, If I attempt to pass in my svg component as a background prop then I get the error 'Uncaught TypeError: Cannot convert a Symbol value to a string' Also I nee...
tom harrison
1

votes
1

answer
34

views

getmousestate function Open BGI library

I am currently using the out of date open BGI library for C as that is what my uni wants us to do but I can't figure out how to use this function. extern void getmousestate(g_mousestate *state); Definition: void getmousestate(g_mousestate * state) { CHECK_GRAPHCS_INITED state->x = sharedStruct->mous...
Tom
1

votes
1

answer
161

views

WordPress meta query where key/value does not exist

My custom post type order has a meta key 'status'. A post can have multiple statusses e.g. ordered, paid, completed. I would like to query all unpaid orders. These don't have a meta key/value pair of status/paid. I can query all paid orders with ... array( 'key' => 'status', 'value' => 'paid', 'comp...
Tom Broucke
1

votes
3

answer
1.4k

views

Symfony 4 debug production environments

how to debug Symfony 4 project on production environment? I mean in a way that only I from particular IP can do it. In Symfony 2/3 I have app_dev.php controller. How to do this with Symfony 4 and Apache? If I change in .env or via VirtualHost APP_ENV to dev then all app users will see debug toolbar...
Tom
1

votes
0

answer
40

views

Time.sleep() zeroes photo resistor readings on Raspberry Pi

I have a Raspberry Pi 3 and a photoresistor, LEDs, resistors, breadboard etc. Now, I have observed a strange occurrence. When I run the following code all of the readings from the light sensor are zeroed. import RPi.GPIO as GPIO from time import sleep class lightSensor(): def __init__(self, min_ligh...
Milan Tom

View additional