macos – How to stop Mac OS from checking for and asking to install updates?

I am trying to stop my MacOS from periodically checking for updates and displaying these notifications:

enter image description here

enter image description here

I have unchecked seemingly all relevant checkboxes in App Store preferences:

enter image description here

And in System Preferences / Software Update as well:

enter image description here

Yet every time I open the latter it defiantly checks for updates:

enter image description here

How do I get it obey my directions? I am aware that some updates are required to actually fix security issues (as opposed to enhance the telemetry / data collection / spying etc. for the benefit of Apple). Yet I expect the OS to do what it apparently supposed to: not to check for updates if the checkboxes are unchecked (otherwise why would those checkboxes exist in the first place?). I am happy to take the risk to live without updates where I choose to, and I do not need Apple to override my decision.

This is Big Sur 11.3.1 (20E241).

python – Rigorously checking whether 2 floating point numbers are close in VBA – Exercise in Test Driven Development

cross-post from SO

I’m testing performance regression of some code I wrote (this is not that code) by timing its execution in Unit tests. I would like to see if execution time equals some expected value within a given degree of accuracy, e.g. <1% change. VBA doesn’t have this built in as far as I’m aware, so I wrote this function, inspired by Python’s math.isclose function (but translating to VBA may have introduced some bugs/ required a few nuances):

TestUtils.bas

'@NoIndent: Don't want to lose our description annotations
'@IgnoreModule UnhandledOnErrorResumeNext: Just noise for one-liners
'@Folder("Tests.Utils")

Option Explicit
Option Private Module

'Based on Python's math.isclose https://github.com/python/cpython/blob/17f94e28882e1e2b331ace93f42e8615383dee59/Modules/mathmodule.c#L2962-L3003
'math.isclose -> boolean
'    a: double
'    b: double
'    relTol: double = 1e-09
'        maximum difference for being considered "close", relative to the
'        magnitude of the input values
'    absTol: double = 0.0
'        maximum difference for being considered "close", regardless of the
'        magnitude of the input values
'Determine whether two floating point numbers are close in value.
'Return True if a is close in value to b, and False otherwise.
'For the values to be considered close, the difference between them
'must be smaller than at least one of the tolerances.
'-inf, inf and NaN behave similarly to the IEEE 754 Standard. That
'is, NaN is not close to anything, even itself. inf and -inf are
'only close to themselves. In keeping with existing VBA behaviour, 
'comparison with NaN will also raise an overflow error.
'@Description("Determine whether two floating point numbers are close in value, accounting for special values in IEEE 754")
Public Function IsClose(ByVal a As Double, ByVal b As Double, _
                        Optional ByVal relTol As Double = 0.000000001, _
                        Optional ByVal absTol As Double = 0 _
                        ) As Boolean
                        
    If relTol < 0# Or absTol < 0# Then
        'sanity check on the inputs
        Err.Raise 5, Description:="tolerances must be non-negative"

    ElseIf a = b Then
        'short circuit exact equality -- needed to catch two infinities of
        'the same sign. And perhaps speeds things up a bit sometimes.
        IsClose = True
        Exit Function
        
    ElseIf IsInfinity(a) Or IsInfinity(b) Then
        'This catches the case of two infinities of opposite sign, or
        'one infinity and one finite number. Two infinities of opposite
        'sign would otherwise have an infinite relative tolerance.
        'Two infinities of the same sign are caught by the equality check
        'above.
        IsClose = False
        Exit Function
    
    Else
        'Now do the regular computation on finite arguments. Here an
        'infinite tolerance will always result in the function returning True, 
        'since an infinite difference will be <= to the infinite tolerance.
         
        'This is to supress overflow errors as we deal with infinity.
        'NaN has already been filtered out in the equality checks earlier.
        On Error Resume Next                     
        Dim diff As Double
        diff = Abs(b - a)

        If diff <= absTol Then
            IsClose = True
            Exit Function
        End If
        
        'VBA requires writing the result of Abs(relTol * x) to a variable
        'in order to determine whether it is infinite
        Dim tol As Double
        
        tol = Abs(relTol * b)
        If diff <= tol Then
            IsClose = True
            Exit Function
        End If
           
        tol = Abs(relTol * a)
        If diff <= tol Then
            IsClose = True
            Exit Function
        End If
        
    End If

End Function

'@Description("Checks if Number is IEEE754 +/-inf, won't raise an error")
Public Function IsInfinity(ByVal Number As Double) As Boolean
    On Error Resume Next                         'in case of NaN
    IsInfinity = Abs(Number) = PosInf
End Function

'@Description("IEEE754 -inf")
Public Static Property Get NegInf() As Double
    On Error Resume Next
    NegInf = -1 / 0
End Property

'@Description("IEEE754 signaling NaN (sNaN)")
Public Static Property Get NaN() As Double
    On Error Resume Next
    NaN = 0 / 0
End Property

'@Description("IEEE754 +inf")
Public Static Property Get PosInf() As Double
    On Error Resume Next
    PosInf = 1 / 0
End Property

As you can see, I’ve decided to handle +/- inf and NaN for (I think) more complete coverage, although for my purposes of timing code these values of course have no physical interpretation.

Usage is simple:

?IsClose(1, 1.1, 0.1)  '-> True; 10% relative tol
?IsClose(1, 1.1, 0.01) '-> False; 1% relative tol
?IsClose(measuredSeconds, expectedSeconds, absTol:= 1e-6) 'μs accuracy

Feedback on edge cases/ approach would be great – e.g. not sure if it’s better design to allow for overflow errors in the diff calculation Abs(b-a) since on the one hand IEE754 says that double overflow should result in infinity, and therefore IsClose will always be False since diff is infinite. But what if absTol is also infinite (or relTol>1 and a or b are inf)? Then we expect True regardless of diff.

Also line by line style things would be fantastic – especially comments, naming and other hard stuff.

Finally, here are my unit tests, I’d like feedback on these too if possible; I’ve lumped many into one, but the message is sufficient granularity to identify failing tests so I don’t think splitting tests up would help:

IsCloseTests.bas

Option Explicit
Option Private Module

'@TestModule
'@Folder "Tests.Utils.Tests"

Private Assert As Rubberduck.PermissiveAssertClass

'@ModuleInitialize
Private Sub ModuleInitialize()
    'this method runs once per module.
    Set Assert = New Rubberduck.PermissiveAssertClass
End Sub

'@ModuleCleanup
Private Sub ModuleCleanup()
    'this method runs once per module.
    Set Assert = Nothing
End Sub

'@TestMethod("Uncategorized")
Private Sub IsCloseTestMethod()
    On Error GoTo TestFail
    
    Assert.IsTrue IsClose(1, 1, 0), "Same zero relTol"
    Assert.IsTrue IsClose(1, 1, absTol:=0), "Same zero absTol"
    Assert.IsTrue IsClose(1, 1, 0.1), "Same positive tol"
    Assert.IsTrue IsClose(1, 1.1, 0.2), "Close within relTol for a"
    Assert.IsTrue IsClose(1, 1.1, relTol:=0.099), "Close within relTol for b not a"
    Assert.IsTrue IsClose(1, 1.1, absTol:=0.2), "Close within absTol"
    
    Assert.IsFalse IsClose(1, 1.1, 0.01), "Outside relTol"
    Assert.IsFalse IsClose(1, 1.1, absTol:=0.01), "Outside absTol"
    
    Assert.IsTrue IsClose(PosInf, PosInf, 0), "PosInf same zero tol"
    Assert.IsTrue IsClose(NegInf, NegInf, 0), "NegInf same zero tol"
    
    Assert.IsFalse IsClose(PosInf, 0, absTol:=PosInf), "Nothing close to PosInf"
    Assert.IsFalse IsClose(NegInf, 0, absTol:=PosInf), "Nothing close to NegInf"
    
    Assert.IsTrue IsClose(IEEE754.GetIEEE754SpecialValue(abDoubleMax), _
                          IEEE754.GetIEEE754SpecialValue(abDoubleMin), _
                          absTol:=PosInf), "Finite a, b with infinite diff still close when infinite tolerance"
                          
    Assert.IsTrue IsClose(IEEE754.GetIEEE754SpecialValue(abDoubleMax), _
                          IEEE754.GetIEEE754SpecialValue(abDoubleMin), _
                          relTol:=1.1), "Overflowing infinite relTol always close for finite a, b"
    
    'reversed a,b
    Assert.IsTrue IsClose(1.1, 1, 0.2), "Reversed Close within relTol for a"
    Assert.IsTrue IsClose(1.1, 1, relTol:=0.099), "Reversed Close within relTol for b not a"
    Assert.IsTrue IsClose(1.1, 1, absTol:=0.2), "Reversed Close within absTol"
    
    Assert.IsFalse IsClose(1.1, 1, 0.01), "Reversed Outside relTol"
    Assert.IsFalse IsClose(1.1, 1, absTol:=0.01), "Reversed Outside absTol"
        
    Assert.IsFalse IsClose(0, PosInf, absTol:=PosInf), "Reversed Nothing close to PosInf"
    Assert.IsFalse IsClose(0, NegInf, absTol:=PosInf), "Reversed Nothing close to NegInf"
    
    Assert.IsTrue IsClose(IEEE754.GetIEEE754SpecialValue(abDoubleMin), _
                          IEEE754.GetIEEE754SpecialValue(abDoubleMax), _
                          absTol:=PosInf), "Reverse Finite a, b with infinite diff still close when infinite tolerance"
                          
    Assert.IsTrue IsClose(IEEE754.GetIEEE754SpecialValue(abDoubleMin), _
                          IEEE754.GetIEEE754SpecialValue(abDoubleMin), _
                          relTol:=1.1), "Reverse Overflowing infinite relTol always close for finite a, b"
TestExit:
    Exit Sub
TestFail:
    Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description
    Resume TestExit
End Sub

'@TestMethod("Bad Inputs")
Private Sub IsCloseNaNraisesOverflowErr()
    Const ExpectedError As Long = 6
    On Error GoTo TestFail

    '@Ignore FunctionReturnValueDiscarded: Just testing error raising
    IsClose NaN, 0

Assert:
    Assert.Fail "Expected error was not raised"

TestExit:
    Exit Sub
TestFail:
    If Err.Number = ExpectedError Then
        Resume TestExit
    Else
        Resume Assert
    End If
End Sub

'@TestMethod("Bad Inputs")
Private Sub NegativeTolRaisesArgError()
    Const ExpectedError As Long = 5
    On Error GoTo TestFail

    '@Ignore FunctionReturnValueDiscarded: Just testing error raising
    IsClose 1, 1, -1

Assert:
    Assert.Fail "Expected error was not raised"

TestExit:
    Exit Sub
TestFail:
    If Err.Number = ExpectedError Then
        Resume TestExit
    Else
        Resume Assert
    End If
End Sub

… which uses a modified version of the GetIEEE754SpecialValue function given in this answer – link to modified version not for review. This was retrospective test driven development as I already had most of the code written from python, however a few additions were made to make it more VBA-idiomatic (e.g. throw error on NaN, python does not).

list – Duplicate files – SharePoint – Checking for same content

I’m building a small form for what is to be a simplified document system. I’m working with two lists, where the first is a list of all documents in a directory each with a unique ID and the other list is used to add some metadata to it.

My challenge is, how do I ensure that once I upload a file it checks my repository if the same content already exists (for example, if I try to upload fileB.docx but it is a duplicate of a file that already exists in there called file123.docx, only different name), and if file already exists (even under different name) it returns me the ID of that file, if not it creates a new file.

Any tips?

I thought about using MD5 hash, but I don’t know if there are any drawbacks on proceeding as such.

Will putting prescription bottles in a ziploc bag minimize the risk of TSA agents checking it?

Suppose I am traveling with medications in prescription bottles, within the USA.

Should I put the bottles in a ziploc bag (inside of carry on luggage) to minimize the risk of TSA agents checking it?

How can I make an APK stop checking for updates? It’s not downloaded from Google play

There’s this music app (Fildo 4.2.9) that for a certain reason I don’t want to use the latest version of, is there a possible way i can stop it from checking for updates? i literally can’t use it because it displays a box that won’t go unless it’s updated.

https – Errors when checking eligibility for HSTS preload

I have this website set up:
http://website1.com/ – returns 301 Moved Permanently and redirects to http://www.website1.com/.

http://www.website1.com/ – returns 301 Moved Permanently and redirects to https://www.website2.com/.

https://www.website2.com/ – returns 200 OK and has this in the response:

strict-transport-security: max-age=31536000; includeSubDomains

I have this subdomain running a web app:
https://subdomain.website1.com/
This also has the following header in the response:

Strict-Transport-Security: max-age=31536000; includeSubDomains

I want to have preload functionality for all sub domains of website1.com/.
However, I get the following errors when checking eligibility:

Error: No HSTS header
Response error: No HSTS header is present on the response.

Error: HTTP redirects to www first
http://website1.com (HTTP) should immediately redirect to https://website1.com (HTTPS) before adding the www subdomain.
Right now, the first redirect is to http://www.website1.com/.
The extra redirect is required to ensure that any browser which supports HSTS will record the HSTS entry for the top level domain, not just the subdomain.

The first error is easy, I can just add the HSTS header.
But why does it matter that there’s a redirect?
All I want is for http://subdomain.website1.com/ to make an internal redirect to https://subdomain.website1.com/.

Can’t http://website1.com make an internal redirect to https://website1.com, regardless of the fact that it redirects to www.website1.com/?

c – Checking and creating a directory tree

int CheckDir(const char *const Dirs()) {
    struct stat Stat;
    const char *const Dir = *Dirs? *Dirs : HomeDir();
    return (stat(Dir, &Stat) || !S_ISDIR(Stat.st_mode)) && (!*Dirs || CreateDir(Dirs+1) || mkdir(Dir, 0755))? -1 : 0;
}

I made HomeDir() to simply return the users home directory. The purpose of this function is to create a directory at a given location, and automatically creating any missing directories in the path of the directory being created. The function will fail if the home directory is not existent. The function would be used like this:

CheckDir((char *()){"/users/me/a/b/c", "/users/me/a/b", "/users/me/a", NULL});

While trying to create C, if B or A were missing, they would be automatically created. However the structure of the function is confusing, and *Dirs is being checked twice. Any suggestions for improvement?

single responsibility – Should a Car object be responsible for checking if it is able to run on certain Road objects?

I’m guessing that you’re actually not writing a racing simulation, so I’m going to disregard this talk of cars and roads.

So, your question is this. You have two kinds of objects: C objects and R objects. Given a C object and an R object, how should your software determine whether or not the objects are compatible with each other?

And the answer is that there is no general answer. The best design is going to depend on a lot of details about how your software works.

If a C object is a parser, and an R object is a document, then the parser should probably be able to determine for itself whether or not it’s capable of parsing the document. Therefore, all of the logic for determining that should probably be in the implementation of the C objects, not in the implementation of the R objects.

If a C object is some type of client object and an R object represents a connection to a server, then the process of determining whether or not the client object is compatible with the server may be a complex process involving several rounds of communication between the client and the server.

If you really are implementing a racing simulation, and a C object represents a car and an R object represents a road, then it may not matter a whole lot which object contains the logic for determining what will happen. If roads only have a few distinguishing properties, but cars react to roads in complex ways, then it would be reasonable to put all of the logic inside of the car objects. If cars only have a few distinguishing properties but roads are complex, it would be reasonable to put all of the logic inside of the road objects. And if neither of those is the case, maybe the logic for determining what happens shouldn’t be in either object.

There are too many possibilities for me to be able to write an answer covering all of them.

javascript – Typescript type checking of hierarchical types

I want to create a hierarchy of Typescript interfaces because I think classes would be an overkill in my case. The main obstacle is checking if an object has a specific type. I solved it this way:

enum AnimalId {
  Mammal = 1,
  Fish = 3,
}

interface BaseAnimal {
  id: number
  categoryId: AnimalId
  name: string
}

interface Fish extends BaseAnimal {
  categoryId: AnimalId.Fish
  fins: number
}

interface Mammal extends BaseAnimal {
  categoryId: AnimalId.Mammal
  speed: number
}

type Animal = Fish | Mammal

const fish1: Fish = {
  id: 1,
  categoryId: AnimalId.Fish,
  name: 'trout',
  fins: 5,
}

const fish2: Fish = {
  id: 2,
  categoryId: AnimalId.Fish,
  name: 'salmon',
  fins: 8,
}

const mammal1: Mammal = {
  id: 3,
  categoryId: AnimalId.Mammal,
  name: 'lion',
  speed: 80,
}

const animals: Animal() = (fish1, fish2, mammal1)

/* eslint-disable no-case-declarations */
for (const animal of animals) {
  let score = 0
  switch (animal.categoryId) {
    case AnimalId.Fish:
      score += animal.fins
      break
    case AnimalId.Mammal:
      score += animal.speed
      break
    default:
      break
  }
}

There are two things I don’t like with the current approach:

  1. I have to create a Union type Animal with all specific Animal types. I would rather just use BaseAnimal instead.

  2. If I want to create a new specific Animal e.g. of type Fish I also have to set categoryId: AnimalId.Fish. It would be great if this is done implicitly:

const fish2: Fish = {
  id: 2,
  name: 'salmon',
  fins: 8,
}

search – Checking a company

search – Checking a company – Webmasters Stack Exchange

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies 5000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive.com Proxies-free.com New Proxy Lists Every Day Proxies123.com Buy Cheap Private Proxies; Best Quality USA Private Proxies