Categories
Mastering Development

Custom loss function depending on batch (Tensorflow, pytorch)

This is a general Question. I know how to write a custom loss function for Tensorflow that works the following way. Lets say we have a custom loss function L(y_true,y_pred) , a Neural Network NN(x) and some batch {x_1,…,x_n} with and ground truth {y_true_1,…, y_true_n}. Now Tensorflow would minimize the following objective with gradient descent: […]

Categories
CMS Magento Mastering Development

Getting error in downloading repository Magento 2 via composer

I am using windows 10 and node js command prompt with latest composer version. The xampp already install with supporting magento2 PHP directives. When i am trying to install a new magento 2 version 2.4.x and type the command this composer create-project –repository-url=https://repo.magento.com/ magento/project-community-edition <mydirectory> I got the following error: Problem 1 – Root composer.json […]

Categories
Mastering Development

Anomaly foundd using UNION ALL, GROUP BY, using subquery

Well, I’m pretty new on teradata, but I’m pretty sure I can understand this simple logic, except I took the logic wrong, so here’s the case : I have one table in Teradata database with some records in it, this record was imported daily from txt file given by userA, for some reason I decided […]

Categories
Mastering Development

Counting spatial points within a polygon according to a temporal window

Overview Using R, I would like to count the number of points within a polygon according to a specific criterion (a temporal window). I have the following data: Geo-located survey data that include the date of the survey interview. Thus, I am able to pinpoint exactly when and where each survey was conducted and to […]

Categories
Mastering Development

Why are format codes “%-m” and “%-d” not working when parsing dates using the datetime module?

my_dates = [[‘y’, ‘d’, ‘t’, ‘d’, ‘2/1/2021’, ”], [‘v’, ‘d’, ‘t’, ‘t’, ‘7/2/2020’, ”], [‘v’, ‘d’, ‘t’, ‘t’, ’10/1/2020′, ”], [‘d’, ‘t’, ‘t’, ‘t’, ’12/1/2023′, ”]] my_dates.sort(key=lambda date: datetime.strptime(date[4], "%-m/%-d/%y")) print(my_dates) I am trying to sort the dates in my list of lists from oldest to newest using a lambda function. I was reading the […]

Categories
Mastering Development System & Network

AutoSSH through Firewall – Best practice for many devices on network?

My team is trying to find a solution to remotely access and update multiple Linux devices behind a firewall at several locations with their own firewalls. Traditionally, we would visit the business’ physical site and update the devices with Ansible running from within their network, or make changes via RDP and individual SSH access. Port […]

Categories
Mastering Development

Looping ASCII characters and decrypting the message

My teacher gave me a homework: – You are given a string (of at most 100 characters) consisting of lowercase characters, terminated with a # symbol. The string is the "encrypted" form of an original string as follows – each character in the original string has been shifted by a fixed integer n (where 1<= […]

Categories
Mastering Development System & Network

AutoSSH through Firewall – Best practice for many devices on network?

My team is trying to find a solution to remotely access and update multiple Linux devices behind a firewall at several locations with their own firewalls. Traditionally, we would visit the business’ physical site and update the devices with Ansible running from within their network, or make changes via RDP and individual SSH access. Port […]

Categories
Database Development

Database design for companyCode and branchCode

I’m using JPA, hibernate and mariadb and I’ve come across a db design situation like this: There are two entities Company and Branch with one to many relationship, each company has many branches. Company will have companyCode in the format of "A01", "A02"..,"A99", "B01", "B02",…,"B99",…"Z01",…,"Z99". And Branch will have branchCode with format companyCode + "-" […]

Categories
Mastering Development

Hashing example and description for given answer

Example: Suppose H:{1,…,n}–>{1,..,n} be a uniform hash function. for input x, z is equal to number of trailing zero in the right side of H(x). for 0<=c<=1 what is the order of probability z >=c log n is constant here. Answer: O(1/(n^c)) I see this answer but question and answer seems strange to me! is […]