# Category Archives: Question and Answer

## Out-of-sample Neural Networks or One-Step Forecasting RNN

I’ve been doing quite a bit of research on forecasting with machine learning models, specifically with multi-input neural networks. How does one predict (or forecast in this context) y+1 in the test set, when y+1 does not exist? Below, I have Jan 1st through Jan 10th. How do I predict Jan 11th? I’ve tried the… Read More »

## How can I use the up/down history keys in the SWI-Prolog console?

When I press up/down, I should get – just like unix – the previous commands, but instead I get: Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version 6.0.0) Copyright (c) 1990-2011 University of Amsterdam, VU Amsterdam SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.… Read More »

## javafx transparent window background with decorations

I’m having a hard time figuring out how to make a transparent background for an application window in javafx. scene.setFill(null) seems to only work with stage.initStyle(StageStyle.TRANSPARENT). Doc for setFill says Both a null value meaning paint no background and a Paint with transparency are supported, but what is painted behind it will depend on the… Read More »

## Can I calculate the product over the primes efficiently and with high precision?

I want to calculate the following product : \$\$prod_{p prime , ple 10^{10}} 1-frac{1}{p}\$\$ I know the approximation formula \$\$frac{e^{-gamma}}{ln(10^{10})}\$\$ where \$gamma\$ is the Euler-Mascheroni-constant. The result should be good to \$12\$ decimal digits. Is there an efficient way (not brute force by determining all primes, which takes long with PARI/GP) to calculate this product… Read More »

## How to prove that an angle is 90 degrees without using a protractor or having reciprocal slopes as a proof?

So the question I have to answer is this: An enlarged view of the daycare patio is shown below that contains two congruent triangles, one of which has been rotated. Using this image, prove that perpendicular lines have opposite and reciprocal slopes. I know that the slopes are reciprocals, but how do I prove that… Read More »

## What is boilerplate code?

A coworker had never heard of this, and I couldn’t provide a real definition. For me, it’s always been an instance of ‘I-know-it-when-I-see-it’. Bonus question, who originated the term?

## How to mock an SqlDataReader using Moq – Update

I’m new to moq and setting up mocks so i could do with a little help. How do I mock up an SqlDataReader using Moq? Update After further testing this is what I have so far: private IDataReader MockIDataReader() { var moq = new Mock(); moq.Setup( x => x.Read() ).Returns( true ); moq.Setup( x =>… Read More »

## How fast does a matrix expression go to zero?

With \$0 This is coming from a Markov chain problem which I solved up to here. We can see that \$X_nleq X_{n-1}\$ and \$Y_nleq Y_{n-1}\$. I am thinking of using the results of this, but it does not seem easy. Any idea how to continue?

## Does \$K\$ form a vector space? [on hold]

Does \$K\$ form a vector space? \$\$K =left{f:[0,1] rightarrow mathbb R text{ and } f text{ has a local maximum at } x = frac12 text{ over } mathbb Rright}\$\$ I think yes if we take \$fleft(frac 12right) = 0 \$ as zero function.

## How can I plot this nonlinear system using MATLAB

I am trying to plot this servomechanism system in MATLAB. The system is shown in figure. \$V\$(voltage) is input of the system and \$theta_L\$ is output of the system. How can I plot \$V(t)\$ and \$theta_L(t)\$ ? Equations of the system is shown below. \$\$dot{omega}_L=-512θ_L-25θ_M-10omega_L\$\$ \$\$dot{omega}_M=V-10omega_M-128θ_L-6θ_M \$\$ \$\$\$\$ So, \$\$ theta_L”=-512theta_L+25theta_M-10theta_L’ \$\$ \$\$theta”_M=V-10theta’_M+128theta_L-6theta_M \$\$ So… Read More »