machine learning – Is it bad design to pass around a dictionary of arguments to all your functions?

In my machine learning pipeline, I have all the arguments collected into a dictionary.

args = {'save_model': True,
'learning_rate': 0.01,
'batch_size': 4,
'model': 'my_model',
'momentum': 0.9,
'random_brighness': 0.5,
'random_flipping': 0.5,
...}

Then I have a bunch of functions that take the entire args dictionary as an input. Each of these only uses a small subset of all the arguments. Is there anything wrong with this design?

model = get_model(args)
data = get_data(args)
transformed_data = transform_data(data, args)

from the perspective of the function, it looks like:

def get_trainer(args):
loss_function = args('loss_function')
optimizer = args('optimizer')
class_weights = args('class_weights')
...

versus:

def get_trainer(loss_function, optimizer, class_weights)
...

Does anybody want to check my uni project? Enigma Machine Simulator

https://github.com/SAIEngineer/The-Enigma-Machine-Simulator
It is an Enigma Machine Simulator made by me.
If you have any thoughts about this project, please comment here.
Install requirements are in repository.

Thanks
for
help

I need to hand it out today. Thanks

Which Virtual machine is used in Android 11?

Every android application runs in a virtual machine. We know that Dalvik virtual machine is the one that is used by android. Next, They have changed to ART(Android Runtime machine). Just correct me if I am wrong. Android 11 uses which virtual machine? Dalvik or ART?

Why Does Time Machine Fail to Delete Old Backups?

This on a 2017 iMac running Catalina with a 500GB boot drive which has 180GB free.

The Time Machine backup is a 1TB partition on a WD MyBook 25EE 3TB drive.

This worked fine for a few years. Some time in the middle of last year TM stopped removing old backups, eventually filled up the partition and refused to do any more backups. I tried to use tmutil to delete old backups, but that didn’t work. I ended up erasing the partition and starting over. That was on November 11th of last year.

Now I find that none of the old backups (beginning November 11th) have been removed:

MrMuscle:~ mnewman$ ls -la /Volumes/TM/Backups.backupdb/MrMuscle
total 8
drwxr-xr-x@ 257 root  admin  8738 Jan 21 05:52 .
drwxr-xr-x@   6 root  admin   204 Nov 10 10:53 ..
drwxr-xr-x@   4 root  admin   136 Jan 20 15:13 2020-11-10-105328
drwxr-xr-x@   4 root  admin   136 Nov 11 18:43 2020-11-10-162243
drwxr-xr-x@   4 root  admin   136 Nov 11 21:16 2020-11-10-201658
<many lines snipped>
drwxr-xr-x@   4 root  admin   136 Jan 20 15:40 2021-01-20-081356
drwxr-xr-x@   4 root  admin   136 Jan 20 15:44 2021-01-20-121042
drwxr-xr-x@  13 root  admin   442 Jan 20 14:09 2021-01-20-140908
drwxr-xr-x@  13 root  admin   442 Jan 20 17:14 2021-01-20-171406
drwxr-xr-x@  13 root  admin   442 Jan 21 05:47 2021-01-21-054733
lrwxr-xr-x    1 root  admin    17 Jan 21 05:47 Latest -> 2021-01-21-054733

Note that ls shows a total of 8 items. That’s obviously incorrect:

MrMuscle:~ mnewman$ ls -la /Volumes/TM/Backups.backupdb/MrMuscle | wc -l
     259

TM preferences says that the oldest backup is Yesterday at 14:09. And, if I “Enter Time Machine” that’s the oldest backup that is accessible.

So, what’s going on here? Why is Time Machine not deleting old backups to free up space for new backups? How can if fix this?

licensing – Windows 10 Evaluation Re-Distribution on a virtual machine with other demo software

For a test lab and a talk, and probably latter on a website with a download link I need to prepare a virtual machine that will be running Windows 10 (could be a windows server too).

I couldn’t find much information from MS or Google on if I can re-distribute a windows 10 eval with a virtual machine.

My idea is to create the virtual machine using windows 10 eval iso. Install some software needed and give it in an USB drive to those who attend the class and probably put a download link on a website.

Any information regarding if I can re-distribute windows 10?

Does this Turing machine accept the following input: abcab

strong text
I’m trying to solve this Turing machine but so far I haven’t managed it. Does it accept the following input: abcab ?

Single tape Turing Machine that accepts string with at least five G’s and at most three T’s?

I am looking to create a single tape acceptor Turing machine acting upon the language of any ASCII string, that would only accept strings that contains at least five G’s and at most three T’s, and rejects any other ASCII string input. I am kind of stuck on how the machine would know that it had encountered greater than or equal to five G’s and less than or equal to three T’s.

c# – How to implement IPC at the local machine without parent-child model?

I’m trying to exchange some small data between my two apps. This two apps located at the same PC, so all exchange happens inside this machine. At first, I thought maybe to use sockets for it, cause I had some small experience with it, but then I read some articles that said that it’s not the best practice for it, cause all exchange happens at the same local machine, so don’t need to use network solutions for such task.

And then I learned about anonymous pipes. From descriptions and examples it’s looks liked the best for my case. But then turns out that this is all about parent-child model, so one(parent) app have to open another one(child) and pass data about pipe through constructor of child app. And this is not fit for my case, cause I want that my two apps would be totally independent, like they could close anytime separately, and then reopen again any time and after that continue data exchanging.

So how do you think, what would be the best for my case? Should I back to sockets? Or maybe anonymous pipes is also not always about parent-child model and maybe I just missed something?

Turing machine to find 10’s complement

Design a turing machine to find 10’s complement of a 7 digit decimal positive integer.The original positive integer may have some leading zero if necessary

iptables – OpenVPN – Accessing docker containers on the host machine

I’m having some issues accessing docker containers over my remote OpenVPN connection to my home Ubuntu Server 20.04 LTS.

My setup; I have a few docker containers (bridge mode) running on the same machine as the OpenVPN Access Server that I would like to access remotely without exposing access over the internet. I’ve successfully proved that the docker services can be accessed from outside the local network by temporarily exposing and forwarding those ports.

I am also able to successfully connect to other machines on the local subnet via the OpenVPN connection and access native service running on the OpenVPN host.

When attempting to access docker services running on the host machine, the request times out with no response.

My hunch is that IP tables on the host machine created by docker may be filtering out traffic from anything other than the local subnet (192.168.1.0/24 range), where VPN connections are assigned to a different subnet. This is the point I get a bit out of my depth!

I’ve listed below the OpenVPN config file (hopefully removing anything sensitive!), the relevant docker IP table rules and the results of the tests I have run so far. Hope you can help!

Timeout when attempting to access docker services on the host:

curl -sv http://192.168.1.x:8002 1> /dev/null
*   Trying 192.168.1.x:8002...
* TCP_NODELAY set
* connect to 192.168.1.x port 8002 failed: Connection timed out
* Failed to connect to 192.168.1.x port 8002: Connection timed out
* Closing connection 0

Successful response conecting to a native service on the same host:

curl -sv http://{host IP}:{native service port} 1> /dev/null
*   Trying 192.168.1.x:xxxx...
* TCP_NODELAY set
* Connected to 192.168.1.x (192.168.1.x) port xxxx (#0)
> GET / HTTP/1.1
> Host: 192.168.1.x:xxxx
> User-Agent: curl/7.65.3
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 401 Unauthorized
< Content-Length: 193
< Content-Type: text/html
< Connection: close
< Cache-Control: no-cache
< Date: Wed, 13 Jan 2021 01:39:12 GMT
<
{ (193 bytes data)
* Closing connection 0

Successful request to the docker service from the local subnet (no OpenVPN connection) :

curl -sv http://192.168.1.x:8002 1> /dev/null
*   Trying 192.168.1.x:8002...
* TCP_NODELAY set
* Connected to 192.168.1.x (192.168.1.x) port 8002 (#0)
> GET / HTTP/1.1
> Host: 192.168.1.x:8002
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
***
<
{ (6324 bytes data)
* Connection #0 to host 192.168.1.x left intact

OpenVPN Config:

# OpenVPN AS 1.1 configuration file

# enable AS Connect functionality
AS_CONNECT=true

# temporary directory
tmp_dir=~/tmp

lic.dir=**REMOVED**

# run_start retries
run_start_retry.give_up=60
run_start_retry.resample=10

# enable client gateway
sa.show_c2s_routes=true

# certificates database
certs_db=**REMOVED**

# user properties DB
user_prop_db=**REMOVED**

# configuration DB
config_db=sqlite:**REMOVED**

# configuration DB Local
config_db_local=sqlite:**REMOVED**

# cluster DB
cluster_db=sqlite:**REMOVED**

# notification DB
notification_db=sqlite:**REMOVED**

# log DB
log_db=sqlite:**REMOVED**

# wait this many seconds between failed retries
db_retry.interval=1

# how many retries to attempt before failing
db_retry.n_attempts=6

# bootstrap authentication via PAM -- allows
# admin to log into web UI before authentication
# system has been configured.  Configure PAM users
# allowed to access via the bootstrap auth mechanism.
boot_pam_service=openvpnas
boot_pam_users.0=openvpn
# boot_pam_users.1=
# boot_pam_users.2=
# boot_pam_users.3=
# boot_pam_users.4=

# System users that are allowed to access the server agent XML API.
# The user that the web server will run as should be in this list.
system_users_local.0=root
system_users_local.1=openvpn_as

# The user/group that the web server will run as
cs.user=openvpn_as
cs.group=openvpn_as

# socket directory
general.sock_dir=~/sock

# path to linux openvpn executable
# if undefined, find openvpn on the PATH
#general.openvpn_exe_path=

# source directory for OpenVPN Windows executable
# (Must have been built with MultiFileExtract)
sa.win_exe_dir=~/exe

# The company name will be shown in the UI
# sa.company_name=Access Server

# server agent socket
sa.sock=~/sock/sagent

# If enabled, automatically generate a client configuration
# when a client logs into the site and successfully authenticates
cs.auto_generate=true

# files for web server (PEM format)
cs.ca_bundle=~/web-ssl/ca.crt
cs.priv_key=~/web-ssl/server.key
cs.cert=~/web-ssl/server.crt

# web server will use three consecutive ports starting at this
# address, for use with the OpenVPN port share feature
cs.dynamic_port_base=870

# which service groups should be started during
# server agent initialization
sa.initial_run_groups.0=web_group
#sa.initial_run_groups.1=openvpn_group

# use this twisted reactor
sa.reactor=epoll

# The unit number of this particular AS configuration.
# Normally set to 0.  If you have multiple, independent AS instances
# running on the same machine, each should have a unique unit number.
sa.unit=0

# If true, open up web ports on the firewall using iptables
iptables.web=true

vpn.server.user=openvpn_as
vpn.server.group=openvpn_as

IPTables Relevant Docker rules:

Chain FORWARD (policy DROP)
target     prot opt source               destination
DOCKER-USER  all  --  anywhere             anywhere
DOCKER-ISOLATION-STAGE-1  all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere

Chain DOCKER (2 references)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             172.18.0.5           tcp dpt:http-alt
ACCEPT     tcp  --  anywhere             172.18.0.6           tcp dpt:http
()

Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target     prot opt source               destination
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere
RETURN     all  --  anywhere             anywhere

Chain DOCKER-ISOLATION-STAGE-2 (2 references)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere
DROP       all  --  anywhere             anywhere
RETURN     all  --  anywhere             anywhere

Chain DOCKER-USER (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere