Categories
Mastering Development

Recreate Excel formula in SQL

I am trying to recreate the below Excel formula/table and have True/False display but am stuck. Excel Formula: =ABS(ROUND(MEDIAN(C$2:C2),0)-ROUND(MODE.SNGL(C$2:C2),0))<[sample.xlsx]variables!$B$2 I have 200+ rows of data and I need the Median and the Mode only calculated from the first row to the current row. I can create the Median for all rows in SQL, but this […]

Categories
Mastering Development System & Network

How/Why installation of VPS server so fast

How can services that host virtual server’s for personal use, finish the installation of the os so fast? If I install a server version of any OS it’ll take at least a couple of minutes. But if I order a virtual server online, it only takes a couple of seconds to install. And I can […]

Categories
Mastering Development

Python speed up permutation of bits within 32Bit number

I’m interested in reordering the bits within a number, and since I want to do it several trillion times, I want to do it fast. Here are the details: given a number num and an order matrix order. order contains up to ~6000 lines of permutations of the numbers 0..31. These are the positions to […]

Categories
Mastering Development

Is it possible in Java to implement interfaces and their methods without using the keyword “implements”?

I have homework to do (actually my girlfriend :-D) and there are some restrictions on what I can and can’t do. In my NetBeans project folder there are two folders named "interfaces" and "homework". The folder "interfaces" contains interfaces and classes that are NOT allowed to edit, because said that to us xD. I am […]

Categories
Mastering Development

Calculating rolling correlations on time series

I have a tbl-df object and I need to calculate 22 days rolling correlations between the values in second and third column. This is the dput of my object: structure(list(date = structure(c(1568937600, 1569196800, 1569283200, 1569369600, 1569456000, 1569542400, 1569801600, 1569888000, 1569974400, 1570060800, 1570147200, 1570406400, 1570492800, 1570579200, 1570665600, 1570752000, 1571011200, 1571097600, 1571184000, 1571270400, 1571356800, 1571616000, 1571702400, 1571788800, […]

Categories
Mastering Development

Calculating rolling correlations on time series

I have a tbl-df object and I need to calculate 22 days rolling correlations between the values in second and third column. This is the dput of my object: structure(list(date = structure(c(1568937600, 1569196800, 1569283200, 1569369600, 1569456000, 1569542400, 1569801600, 1569888000, 1569974400, 1570060800, 1570147200, 1570406400, 1570492800, 1570579200, 1570665600, 1570752000, 1571011200, 1571097600, 1571184000, 1571270400, 1571356800, 1571616000, 1571702400, 1571788800, […]

Categories
Mastering Development

Age of Respondents using Bar Chart

I am trying to draw a Bar chart that looks like the one below, I am not sure how to set a percentage value in each column top, and a legend at the right side. My code snippets below. It’s working however missing the percentage value and legend. import matplotlib.pyplot as plt; plt.rcdefaults() import numpy […]

Categories
Mastering Development

pandas dataframe update based on date values in 2 dataframes

I have 2 dataframes, the section of which looks like this: year1 = {‘DAY’:[‘MON’, ‘MON’, ‘MON’, ‘TUE’, ‘TUE’, ‘TUE’], ‘TEMP’:[12, 13, 14, 15, 15, 18], ‘DATE’:[’01/01/20′, ’02/01/20′, ’03/01/20′, ’06/01/20′, ’07/01/20′, ’08/01/20′]} df1 = pd.DataFrame(year1) year2 = {‘DAY’:[‘MON’, ‘MON’, ‘MON’, ‘TUE’, ‘TUE’, ‘TUE’], ‘TEMP’:[15, 15, 15, 15, 14, 14], ‘DATE’:[’01/01/20′, ’02/01/20′, ’03/01/20′, ’06/01/20′, ’07/01/20′, ’10/01/20′]} df2 […]

Categories
Linux Mastering Development Ubuntu

Hard disk not showing up in ubuntu 16,18,20, linux mint versions while installing on preinstalled acer laptop

I bought a new laptop Acer Extensa 215-52 with predefined Windows 10 installed on it. I tried to dual boot with ubuntu 16,18,20 and linux mint 20 version. Some Bios settings are as searching on the internet to dual boot. secure boot: disabled fast boot : disabled SATA mode : AHCI Also I have reinstalled […]

Categories
CMS Drupal Mastering Development

Order quantity increment condition for payment method

I need to set order increment quantities in my Commerce 2 website. The website has two stores: retail and wholesale. Customers who are shopping in my "retail consumers" store must have increments of 6 products in their cart in order to check out (6, 12, 18, 24, etc). Customers in my "wholesale consumers" store must […]