design – Default value for constructor dependency injection

I have class A that depends on interfaces B & C. I use constructor injection to inject them into A:

class A {
    let b: B
    let c: C
    
    init(b: B, c: C) {
        self.b = b
        self.c = c
    }
}
    

This is mostly so I can inject mock objects for testing.

However, 80% of my use cases use the default implementations of B & C (let’s call them, BImpl and CImpl). There’s also some edge cases that make up 20% of my use cases.

Is it a good idea to create a “default” initializer where the constructor is parameterless and sensible defaults are created?

init() {
    self.init(b: BImpl(), c: CImpl())
}

The initializer delegates to the previous (parameterized) initializer, so I don’t lose my ability to inject my own (custom) dependencies if I wanted to. But this way, I can also choose to roll with the default values if I want to.

Does this have some unforeseen disadvantages?

Windows 10: Open file directories with a custom application by default

Since everything I see is “explorer.exe”, I labelled different parts of it in the screenshots at the bottom, to make it easy to understand.

TL;DR

  1. Can I make my own application open directories by default when I click a directory in “1” or “2”?
  2. With the change for the question above, can I still make double-clicking a directory in a manually-opened “3” open in the same “3”, not with my application?

Longer version

There are some incontinences for me in “3”. So I am trying to write a (simple) my own file listing application in C#. Now, what I want is that when I double click a directory on the desktop or clicking things like “Downloads” or “Personal Folder” (in “1” or “2”), my own application gets invoked (with the directory path as an argument), not “3”.

I have searched the web and found a way to “replace the shell” HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogonShell, but that completely replaced everything and the Start Menu/Taskbar were gone. Not that I do not have complaints about the Start Menu/Taskbar, but recreating Start Menu/Taskbar would be daunting, so I only want to replace “3” (or, if possible, “1” also.)

I thought that I could change the “Open” command that I see when I right-click a directory, but replacing the value of HKEY_CLASSES_ROOTFoldershellopencommand(Default) from explorer.exe to another exe did not work. How can I do this?

But after making my application to open directories by default, if I manually open directories in “3” (because I cannot reproduce every feature of “3” and sometimes need to use it), when I double-click a directory in “3”, is it possible to make it open in the same “3”, not with my application?

enter image description here
enter image description here

javascript – Js Crear multiple instancia en export default

Estoy teniendo un problema, funciona correctamente en la primera llamada a Paginator el problema es al volver a llamarla en un cambio de pagina.

Clase Paginator

const Paginator = {
  constructor() {
    this.data = ();
  },
  data(data) {
    this.data = data;
    return this;
  },
  page(number) {
    this.page = number;
    this.data = this.data(number - 1);
    return this;
  },
}

export default Paginator;

Import

import Paginator from '../../helpers/Paginator';

Llamada

const paginate = Paginator
        .data(challenges)
        .page(page);

      const { data } = paginate;

cuando intento cambiar a .page(2) me arroja lo siguiente

TypeError: _helpers_Paginator__WEBPACK_IMPORTED_MODULE_6__.default.data is not a function

networking – How do I change the Default Switch on Windows 10 from cable network interface to wifi interface?

I have 2 Windows 10 laptops connecting to the same home wifi, laptop1 and laptop2. I can ping from laptop1 to laptop2, but not vice versa.

On this wifi, laptop1 IP address is 192.168.1.44; laptop2 is 192.168.1.91.

Here is on laptop2:

C:WINDOWSsystem32>ipconfig

Windows IP Configuration


Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::c14d:dce0:8bbb:bc8c%24
   IPv4 Address. . . . . . . . . . . : 192.168.1.91
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

Ethernet adapter vEthernet (Default Switch):   **<=== This "Default Switch" is my suspicion**

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::39bb:75b6:d582:f39a%9
   IPv4 Address. . . . . . . . . . . : 172.26.205.49
   Subnet Mask . . . . . . . . . . . : 255.255.255.240
   Default Gateway . . . . . . . . . :

When I ping laptop1, ping times out.

My suspicion is, as you see from above, the “Default Switch” is another network and I do not connect at all.

So my question is how to change the “Default Switch”? Googling does not identify the answer. I did change the network priority between the 2 networks on laptop2, it does not help. Here is route output:

C:WINDOWSsystem32>route -4 PRINT
===========================================================================
Interface List
 24...20 16 b9 69 60 2c ......Intel(R) Dual Band Wireless-AC 8265
  9...62 15 11 43 ce 86 ......Hyper-V Virtual Ethernet Adapter
 12...0a 00 27 00 00 0c ......VirtualBox Host-Only Ethernet Adapter #2
 11...20 16 b9 69 60 2d ......Microsoft Wi-Fi Direct Virtual Adapter
  7...22 16 b9 69 60 2c ......Microsoft Wi-Fi Direct Virtual Adapter #2
 15...20 16 b9 69 60 30 ......Bluetooth Device (Personal Area Network)
  1...........................Software Loopback Interface 1
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      192.168.1.1     192.168.1.91     10
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    331
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    331
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    331
    172.26.205.48  255.255.255.240         On-link     172.26.205.49    271
    172.26.205.49  255.255.255.255         On-link     172.26.205.49    271
    172.26.205.63  255.255.255.255         On-link     172.26.205.49    271
      192.168.1.0    255.255.255.0         On-link      192.168.1.91    266
     192.168.1.91  255.255.255.255         On-link      192.168.1.91    266

Please help out.

Oracle database EXP default directory

I am trying to export a table under a user schema in oracle using the EXP command. I am doing this on the command line. This is the syntax that I used:

EXP scott/passcode TABLES=users STATISTICS=none INDEXES=n;

My export was successful with the result as follow:

enter image description here

However, I could not find where my table was exported to. I looked all over the internet, and I still don’t know the default path of oracle EXP command. Please do not tell me anything about EXPDP. EXPDP and EXP are very different.

Is it safe to delete the default Document content type that is created by default with a document library in SharePoint Online

I have a document library in a SharePoint Site where I have created my own custom content type that inherits from Document called “My Special Document”. (It has a few optional columns associated with it).

Is it ok if I delete the default “Document” content type and leave “My Special Document” as the only content type in this library?

Will this cause random issues in the future as new features roll out with Teams, OneDrive and SharePoint Online? (from what I can tell it should be fine, but want to double check).

Appreciate if I anyone with Microsoft contacts could further validate this.