Categories
Development

Two-Way Repeated Measures ANOVA: Error in lm.fit()… 0 non-na cases (rstatix)

I am trying to run a Two-Way Repeated Measures ANOVA using the R Statix package based on the description from here however I am running into the subject error with my dataset. The data consist of 10 replicate biomass measurements recorded at each of 8 Locations across 5 months (10 reps x 8 locations x […]

Categories
Artificial Intelligence (AI) Development

In Python, how to combine 3D arrays into one 4D array?

I have N arrays of dimension (1080, 1920, 3). I wanna combine them into one array of dimension (N, 1080, 1920, 3). I code it, but not quite satisfied, could you help me?

Categories
Development

Excel Macro recording “Too many line continuations” error

I am writing a macro that, besides doing other things, should filter a long column of data that consists of positive and negative numbers. The numbers could be any value, and not necessarily all values between -4095 and 4095, but the entire column will vary in length up to over 800,000 rows. I want to […]

Categories
Development

SDL_ttf clearing all my prior and future renders

I’ve been struggling with getting SDL and SDL_ttf to work together. My minimal reproducible case (down below) works in VC++ but for the life of me I can’t get it to work in a MinGW environment. SDL version: 2.0.10 (latest at moment of writing) SDL_ttf version: 2.0.15 (latest at moment of writing) My set up […]

Categories
Development Google

Why isn’t Google App engine freeing memory using Node.js

So this post is a two-part related questions. I am testing out the Google app engine with instance class F4 (Memory: 1024 MB and CPU 2.4GHz with automatic scaling). This is the configuration file found on App engine: runtime: nodejs10 env: standard instance_class: F4 handlers: – url: .* script: auto automatic_scaling: min_idle_instances: automatic max_idle_instances: automatic […]

Categories
Development

How to use QPainter to draw lines on the QScrollArea?

I’m trying to use PyQt5 to create a data structure visualization simulator. There is a QWidget and a QScrollArea inside. class test(QWidget): def __init__(self): super().__init__() … … self.setUI() def setUI(self): self.setGeometry(250, 200, 1500, 750) self.setWindowTitle(‘data structure visualization simulator’) self.topFiller = QWidget() self.topFiller.setMinimumSize(1200, 2000) self.scroll = QScrollArea() self.scroll.setWidget(self.topFiller) self.vbox = QVBoxLayout() self.vbox.addWidget(self.scroll) self.setLayout(self.vbox) Now I need […]

Categories
Development

Applescript handler/subroutine not giving same results as normal code

I can’t seem to figure out why this code is working fine outside of a subroutine but giving me an error when copying it into a subroutine and running it. I’ve tried everything and googled for hours. Any help is appreciated. ORIGINAL CODE tell application “iTerm” if not (exists window 1) then reopen tell application […]

Categories
Development

Let ray automatically assign a GPU per task

I am using ray (https://ray.readthedocs.io/en/latest/) to run a task that feeds images into the Inception v3 net, loaded from tensorflow.keras. My task looks as follows (simplified): from tensorflow.keras.applications import InceptionV3 @ray.remote def predict(image): model = InceptionV3(include_top=False, pooling=’avg’, input_shape=(1920, 1080, 3)) return model.predict(image) My machine has 8 GPUs, but I don’t get ray to assign the […]

Categories
Development

Gaussian fit to histogram on python seems off. What could I change to improve the fit?

I have created a Gaussian fit to data plotted as a bar chart. However, the fit does not look right, and I don’t know what to change to improve the fit. My code is as follows: import matplotlib.pyplot as plt import math import numpy as np from collections import Counter import collections from scipy.optimize import […]

Categories
Development

Proxy Detection script PHP

Hello, I am trying to make a good IP logger to practice a little bit of PHP. I want to add a proxy detection to the logger. I found this script here: <?php function proxy_detect ($null) { $proxyports=array(80,8080,6588,8000,3128,3127,3124,1080,553,554); for ($i = 0; $i <= count($proxyports); $i++) { if(@fsockopen($_SERVER[‘REMOTE_ADDR’],$proxyports[$i],$errstr,$errno,0.5)){ $sockport=true; } } if( $_SERVER[‘HTTP_FORWARDED’] || $_SERVER[‘HTTP_X_FORWARDED_FOR’] […]