Does antivirus software detect screen grabbing functionality in a running program?

Screengrabs are not malicious in and of themselves. So, there is no need for anti-virus or anti-malware to be suspicious of that behaviour. Every OS has some sort of screenshot program. But unusual screengrabbing can increase the “score” for suspicion.

What anti-virus or anti-malware will do is look at the behaviour in context and comparison to all the other behaviour it has, or if it is a known bad binary, it will detect it.

I used to run a commercial, non-malicious PC spying package that took a screenshot every time someone hit the enter key or clicked the mouse. (This was a very specific use case for a specific threat on a single machine, and the machine had a poster informing users of this). I needed to whitelist the package’s processes in the anti-malware software we used because it was the combination of behaviours (screengrab hooked in the background to the keyboard and mouse actions in all processes and not just the screengrab program) that was suspicious.

How to convert a unit vector to quaternion for look-at functionality?

So far I got this:

local function fromTo(v1, v2)
    local a = Vector3.new()

    local xAxis = Vector3.new(1,0,0)
    local yAxis = Vector3.new(0,1,0)

    local dot = v1:Dot(v2)  

    if (dot < -0.999999) then
        a = xAxis:Cross(v1)     
        if (a.Magnitude < 0.000001) then
            a = yAxis:Cross(v1) 
        end
        a = a.Unit
        return CFrame.fromAxisAngle(a, math.pi)
    elseif (dot > 0.999999) then
        return CFrame.new()
    else
        a = v1:Cross(v2)    
        return CFrame.new(0,0,0, a.X, a.Y, a.Z, 1 + dot)
    end
end

where v1 is Vector3.new(1,0,0) (or any axis vector, depending how I want the object to be orientated when doing look-at) and v2 is the Unit (normal) vector from eye to target. My example is Roblox and LUA (CFrame.new >> position (x, y, z) and quaternion (qX, qY, qZ, qW)), but I think any language will do.

This code kind of works, but doe’s unwanted Rolling, where it should just Pitch and Yaw (https://upload.wikimedia.org/wikipedia/commons/thumb/c/c1/Yaw_Axis_Corrected.svg/1280px-Yaw_Axis_Corrected.svg.png).. and I have no idea how to fix that.

Any help appreciated!

mouseposition – Disabling the “scroll when middle mouse button is pressed” functionality

(Mathematica 12.1 and Windows 10)

If the middle mouse button is kept pressed and the mouse is moved, Mathematica will scroll. Is it possible to disable this functionality?

I looked for mouse entries in KeyEventTranslations.tr but there are none. I also tried modifying the ScrollingOptions in the Options Inspector, setting the max scrolling speed to 0, but it had no effect. Also checked some answers related to ControllerInformation() from What is the middle mouse button called in Mathematica’s code?, but no controllers appear for Windows, as remarked in those answers.

On Windows my middle mouse button is set to do a middle click, not scrolling, so I assume this scrolling behaviour comes from Mathematica itself.

What Is The Full Functionality Of Webmaster Tool?

 

What is the idiomatic Swift way to add general functionality via protocol/extension?

I am a scala developer new to swift. In scala we can share implementation across a variety of classes by “extending” a trait that has default implementations for the methods. I would like to see how to do that in swift. Here is my shot at it.

Let’s consider an Alerting mechanism to be added to many application classes

protocol Alerting {
    func sendWarning(_ msg: String)
    func sendAlert(_ msg: String)
}

extension Alerting {
    func phoneHome(_ msg: String) { print(msg) }
    func sendWarning(_ msg: String) { phoneHome("WARN: (msg)") }
    func sendAlert(_ msg: String)  { phoneHome("ALERT: (msg)") }
}

Now let’s add that Alerting to a couple of App classes:

class MyAppClass : Alerting {
    func myFunc(somethingHappened: Bool) {
        if (somethingHappened) { sendWarning("Something happened in MyAppClass.myFunc") } 
    }
}

class AnotherAppClass : Alerting {
    func anotherFunc(somethingHappened: Bool) {
        if (somethingHappened) { sendAlert("Something _bad_ happened in AnotherClass.anotherFunc") } 
    }
}

Is this a common pattern /idiom in Swift? Is there a different / more preferred approach, and why is it preferred?

Objectives for the approach:

  • Horizontally – focused functionality can be shared across disparate application classes. Think aspect oriented programming.
  • The functionality can be implemented in one place yet overridden in classes inheriting the behavior as needed
  • The behaviors are mix-ins ie they can be combined with other behaviors and do not require a rigid inheritance hierarchy

Taking a look at how my attempted implementation meets those objectives:

  • Alerting was added to two App classes that have no inherent relationship
  • The extension provides default implementations of the required behavior
  • Other unrelated protocol/extension could be added without restrictions: they meet the mix-ins goal

But I would note that my approach comes from a scala centered world and may not reflect what swift folks would prefer.

The website is blacklisted by Antivirus. Firefox has no access, but Tor has little functionality

I have had Firefox access to this website (a government website) all of the last month and it worked normally. Since yesterday, when I try to access it with Firefox, Avast Antivirus notifies me that it is blacklisted. However, when I tried to use Tor, the website was accessible, but without the full functionality (search, etc.).

Why could this happen?


Remarks

  • I have the same extensions in Firefox and Tor.
  • This happens in Windows 7 and 10

Dependency injection – Is coupling functionality desirable when the use of a function can be predicted with almost perfect certainty?

I have a function whose job is to search a string that contains the content of a post and to find certain parts:

public static function findInsidePostContent( $post = Null )
{

    //post_content comes from a WP_Post object.
    $post_blocks = parse_blocks( $post->post_content );
    //Look inside, do some things.

}

The function has an absolute truth that we can always rely on: it only works with a WP_Post Object.

But of course, since the parameter is NullSince there is a clear contradiction here, we try to solve it by adding a certain line right at the beginning of the function:

$post = Utils::getPostObject( $post ); if( is_wp_error( $post ) ) return $post;

Great, this function should always return a WP_Post Object unless something wrong happened.

But we just linked two seemingly unconnected pieces of code together, and that's usually bad. We also hid a dependency. But what if we can predict that you will always work with one in all cases? WP_Post Object? You always have to work to solve that WP_Post Object somewhere before:

$post = Utils::getPostObject( 21 );
Utils::findInsidePostContent( '', (), $post );

This "call path" will never change.

Wouldn't the coupling be justified?

Driver – No USB 3.0 functionality

I am fairly new to Ubuntu and got into it because I had a fairly old, but still very powerful tower that failed completely under Windows and didn't even recognize the hard drives that were directly connected to the BIOS motherboard. With some luck and black magic I was able to revive it with Ubuntu 18.04.4.

Once resuscitated, I remembered that the USB 3.0 ports (2 front, 2 rear) never worked and still didn't. After checking, the front connectors are properly connected to the motherboard and the two rear are firmly connected to the motherboard.

When I try lsusb -v I only see USB 2.0 and 2.1 devices. When I checked the PCI devices, I only saw two "… chipset USB2 Enhanced Host Controller # …". Lots of PCI bridges and things I'm not familiar with. When you connect a USB 2.0 device to the 3.0 port, no drive is occupied, so it doesn't even function as a USB 2.0 port.

So drivers seem to be the most common answer when I search (although I'm still not sure how to manage it), but I'm not sure if this is the solution because I can't find USB 3.0 anywhere in the system .

Here are the system statistics as far as I know:

  • Lenovo ThinkStation D30
  • BIOS: A3KT36AUS (2014)
  • Processor: Intel Xeon E5-1660 v2 3.7
  • Motherboard: LGA2011-0 dual socket (I think that's correct, but I'm not entirely sure … it's printed on the MB, I'm just not sure if this is the correct identifier).
  • Is there any other information that would be helpful?

I searched the forums before posting as well as Google and some long-time Ubuntu friends, but haven't found anything yet, maybe because this is not an Ubuntu problem but a Lenovo problem. Still, if anyone has any insight, I would really appreciate it.

Data tables – Save the functionality with inputs with multiple data types

I apologize if the title of the question appears unclear. I have a business application with multiple input / data types on the same screen:

  1. A couple of "basic" text entry and dropdown menus. These fields are
    Usually it is set / saved first and everything else can be filled in
    later. Users have the option to go back and change the values.
  2. A single long text area (for which a WYSIWYG is required)
  3. An editable table in which one of the column fields contains a 500
    Characters max text area

Given the different data types, what would you recommend for handling the storage function?

My first thought was editable popups for the table rows (# 3) because inline editing wouldn't work well with the text area field. In a similar way, would it make sense to first display the long text (No. 2) as a read-only paragraph with an edit button that calls up a WYSIWYG popup? If so, would automatic saving be considered in such a field?
Since the last two parts are popups, I am very tempted to edit popups for basic fields (No. 1).

Would that make sense? Am I making things too complicated?