Advice for alternatives to unit testing when no expected value is known

I am writing several functions that I want to test. But, I have no way of knowing the true expected value, so I guess unit testing can’t be done here.

Any alternatives/solutions, or just expect to write correct code?

Need some security advice for using a custom browser extension from a 3rd party developer

I'm in the market to hire a developer to help me out with a chrome browser extension that can read the content of web pages. Given that most extensions can read what your browse on the internet, what are the risks of going this route? Would a connection montitor/blocker like Little Snitch be successful in stopping any captured data from being transmitted to the 3rd party? I realize that I should ideally be able to trust a developer I'm working with, but I'm just trying to play it safe….

Need some security advice for using a custom browser extension from a 3rd party developer

9 – Need some directions and advice on starting a new generation of Drupal

I have a multi-questions on starting a new generation, so far I am using Drupal 7 and need to move forwarder to Drupal 8-9

I am currently running Drupal 7, multisite on Ubuntu on AWS, a normal multisite, manually instaled and working just fine.

In line with new and faster tools such as docker and Aegir, I believe it’s time to change.

My requirements are:

  1. Latest stable Drupal
  2. Work on AWS
  3. Multisite on the same computer (directly or multiple Dockers)
  4. Able to be protected by let’s encrypt SSL

So my questions are:

  1. Is Drupal 9 ready for production? Do the above mention tools support it? Do most modules and themes supports it?
  2. Should I use Aegir? Docker or both?
  3. Can I connect some of the sites to an external Database
  4. Can I connect some of the sites to external file storage such as AWS/S3

And if most answers will be positive (as I believe it will), I would like to get some recommendation on the best or most practical tools to use and if possible could I also be pointed to articles or youtube tutorials to get me started?

Thanks in advance and my apology on the multi questions.

malware – Advice on how to deal with botnet attacks

A family member of mine has received notification from their ISP (verizon) that the home network was targeted by a botnet, and soon afterwards received notification that a computer on the network was now acting as a malicious bot. I can’t go into details as to why I suspect this is a targeted attack, but to summarize, it be some extreme coincidence if it wasn’t a targeted attack for information computers on the network access. I have already disconnected and shut down the computer that verizon named as acting bot-like, but I don’t know exactly how to move from here.

How would I go about detecting and removing what is controlling the infected computer? My initial guess is to use something like snort? Or is this just completely over the head of anyone not a professional and I should just nuke the hard drives?

How would I figure out how it even got control of the computer in the first place?

And how can I protect against a (what I assume to be) targeted attack if it happens again in the future?

If it is of any help, I do have some, albeit limited, experience using kali linux and the tools in it

Help me, I need an advice!

Hi guys, please help me with an advice!

I have a question – are houses in Miami often sold? and how often are they rented? and how much is the monthly fee for a good apartment in Miami not far from the ocean?

Thanks

.

Python design advice: passing many of the same arguments to many functions in stack

I made this little tool for something I was trying to accomplish at work. It works as intended but a personal goal of mine is to improve my code design so it’s more simple, readable, and contributable.

Here is the repo but a snippet of relevant code is at bottom of the question.

The main thing I’m seeking help on is the passing of arguments through the whole stack. In the below code abstraction (or the repo, if you checked that out), you’ll notice that function definitions and calling the functions involve passing a ton of arguments repeatedly. I’d prefer to make that cleaner if possible. I’ve looked into *args and **kwargs but not sure that’s necessarily a best practice here. I’m also thinking about using Dataclasses or NamedTuples, perhaps. BTW, I’m leaning toward NamedTuples because they can be iterated on. I guess Dataclasses can’t so that might be too inflexible for me? I.e., if I created a NamedTuple called args out of the args from parse_args(), I would want to pass it to functions as *args, right? Only doable with a NamedTuple?

Code below is an abstracted and far more concise version of the real code…but should get the point across:

    
def primitive_1(arg1, arg2, arg3, arg4, arg5):
    <create primitive object '1'>

def primtive_2(arg1, arg2, arg3, arg4, arg5, arg6):
    <create primtive object '2'>

def set_of_primitive_1s(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8):
    <multiple calls to primitive_1(arg1, arg2, arg3, arg4, arg5)>

def set_of_primitive_2s(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8):
    <multiple calls to primitive_1(arg1, arg2, arg3, arg4, arg6)>

def final_object(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10):
    <multiple calls to set_of_primitive_1s(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)>
    <multiple calls to set_of_primitive_2s(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)>

final_object(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)

The entire set of arguments is generated from flags at the command line so I generate a Namespace of these args. I imagine there’s a much cleaner way to pass all these arguments through the stack of this application?

Thanks in advance to anyone willing to help out here!

schengen – Think I have overstayed in Denmark, as an EU citizen. But need to apply for residency. Advice appreciated

I am a British citizen so it’s fairly urgent (considering brexit). I was getting everything ready to apply for EU residency through the self-sufficiency option. Then I found out that I should have applied for this within 3 months of arriving in Denmark. I feel stupid, but I thought this applied to non-EU citizens.

I think I have overstayed over a year. I feel a lot of anxiety and guilt about it and don’t know the best way to deal with it. I can’t return to the UK and come back in a few weeks because of covid restrictions.

The document requires me to put a date of entry. It doesn’t say I need to provide proof but I assume they might ask for it. I am wondering whether to call and ask what my options are and admit that I have overstayed. However, I feel very concerned about what the punishment might be for overstaying as an EU citizen. I can only find examples for non-EU citizens overstaying.

I looked here: https://international.kk.dk/artikel/eu-residence-document
They explain about the 3 months rule but don’t mention any consequences or what to do, what will happen, if you have spent longer than 3 months before applying.

This EU website: https://europa.eu/youreurope/citizens/residence/documents-formalities/reporting-presence/index_en.htm
“In some EU countries, failure to report your presence might result in a fine, but you cannot be expelled just for this.”

I should add that while I have been in Denmark I have not claimed benefits, used any services etc.

Does Denmark impose fines for EU-citizens overstaying? And if so, how much might this be? Will it be a matter for police?

Will this overstay be a problem for me applying for residency?

Thank you.

I Need Advice

 

Seek advice to build file hosting

Dear all,

I want to build my own file hosting to store and stream my membership education videos so that all files are under my control.
Seek your advice on how to build a site like https://ddownload.com and https://clipwatching.com or any simple and friendly user hosting script.

Please share with me, thanks a lot guys.

How to organize logic for table-like feature set? Looking for architecture pattern advice

I have a table-like feature set in a game. What it means is I have 10 types of battle, and 10 types of features related to battles, like hints, start/end logic, rewarding/spending resources, statistic etcetera. For every type of battle each feature has it’s own unique conditions and outcomes, resulting in total of 100 individual logic pieces. I’m unable to come to any adequate arranging pattern for this logic. And I need this pattern for team of developers to follow, otherwise there is complete chaos. What’s really important, these logic pieces should be working somewhat independent in several different module-based projects, where each project can or cannot include some of features and battle types. And for the cherry on top: not all battle types should have implemented a logic for every feature.

1. Initially I had a swicth-case statement in every feature for each type of battle.

pros:

  • intuitive, easy to read (Clarity+)
  • quick to modify (Maintainability+)
  • every logic bit of a feature in one place (Clarity++)

cons:

  • all battle types listed in one place (Cohesion++)
  • necessity to modify code in every feature in case of adding new battle type (Extensibility–)
  • no code pattern, resulting in freedom to add anything anywhere (Maintainability–)

2. For my next iteration I’ve decided to mirror that scheme and list all feature logic bits inside controllers dedicated for each battle type. I’ve added one interface covering all features

pros:

  • everything considering one type of battle in one place (Clarity++)
  • adding new type of battle in easy, just need to implement one interface (Extensibility++)
  • adding new feature is easy, just add new method to interface and be forced by compiler to implement it everywhere (Extensibility++)

cons:

  • one class contains too much different logic of different features. (Cohesion+++)
  • it’s not clear where such controller should be located, considering module-based system of projects (???)

3. Now I’m planning to create a “table” of classes, each individual controller for each feature-battle crossing. For each feature there should be an interface, and for each battle type an implementation of such interface. Accessing such implementation would be through a special manager.

FeatureManager.Get<ISomeFeature>(BattleType.SomeBattle).DoLogic();

pros:

  • full abstraction. (Extensibility+++ Clarity-)
  • implementations can be placed inside module of a feature (Clarity+)

cons:

  • huge amount of tiny classes (Maintainability- Clarity-)
  • No compile errors in case of missing implementations. Need to develop new observer, to throw errors in case of some implementation missing, or existing when not expected, resulting in necessity to have small database with all feature settings. (Complexity++ Extensibility-)
  • nesseity to develop a special manager for accessing logic. All logic bit must be registered to it’s battle type by mentioning ID from enum BattleType. (Complexity+)

None of these solutions seems good enough. So, what’s the best course of action here? Thanks internet!