pathfinder 1e – Acceptable background by level

Disclaimer: This has nothing to do with backgrounds from DND5.

It happens a lot that the story you create for your character sometimes is not as in point with what happens afterwards in-game. If you are a Lvl 1 Warrior you maybe can say you fought in the frontlines of a bloody war, and now are a retired mercenary.

Then you end-up losing to a bunch of rats the GM threw your way because the ceiling was too low and you forgot your matches.

What I want to know, is there a table/resource that has some indicator of what you may have accomplished when creating a character of a specific level?

That way I won’t embarrass myself narrating when I defeated a lich in my Lvl3 Ranger backstory, just to be inmediately destroyed by two goblins and their pet wolf in my first encounter.

I don’t mind DND/pathfinder responses, even when the power level may differ between the two, and even between versions, I’m more interested if the resource itself exists, or how to create one.

sql server – Is it acceptable to use the presence of a value in a NULLable column as a flag?

I have a stored procedure that processes rows in a table. The stored procedure is called by an external process (Jitterbit, though I don’t believe that is relevant). Occasionally the stored procedure throws an exception wchich is caught in a TRY CATCH block. My client wants this to work slightly differently; they want the error to be written back to the table (e.g. create a new column for the error information) which can then be periodically aggregated into a notification email. There will be another bit column (DEFAULT 0) that will be set to 1 when an error in that row is included in a notification email (so that the email is sent only once).

My question is this. If I make the column for the error message NULLable, and therefore do something like:

SELECT * FROM MyTable WHERE ErrorMessage IS NOT NULL AND EmailSent = 0;

is this an acceptable approach – to use the presence (or absence) of data in a column as a flag? My inner pedant thinks that another BIT column ought to be used – for example:

SELECT * FROM MyTable WHERE ErrorCreated = 1 AND EmailSent = 0;

Am I being pedantic?

magento2 – Is it acceptable to put lib folder inside module folder structure?

Before I used this code to include some packages:

require_once($this->dir->getPath('lib_internal') . '/vendor/module/nuevomailer/api.php');

Now Magento doesn’t allow to use require_once anymore so I thought that the simplest way without creating another packages just for third party libraries would be to just create lib folder inside existing vendorname/modulename folder and call it like this:

    class Subscriber extends MagentoFrameworkModelAbstractModel{
        protected $mailchimp;
        protected $phpmailer;
        ...
        public function _construct(
            VendornameModulenameLibMailchimp $mailchimp,
            VendornameModulenameLibPhpmailer $phpmailer,
            ...
        function subscribe(){
            $this->mailchimp->subscribe();
        }

Is that acceptable method? I checked Magento modul file structure (https://devdocs.magento.com/guides/v2.3/extension-dev-guide/build/module-file-structure.html) and I couldn’t find lib folder. Is it allowed to put any other folder into module directory?

naming – Is it acceptable to use “or” in the name of a boolean variable?

Say we have a boolean variable indicating whether an input array is 2D or 3D (just an example). Is it acceptable to name it is_2d_or_3d instead of is_2d, to make it clearer that if false, it indicates the input is 3D?

I’ve personally been doing this for quite some time. I don’t remember if I picked it up from some guidelines or just thought of it myself. Is there any conventions suggesting this? If not, are there any drawbacks of this approach (besides not being recommended by guidelines)?

opengl – Does an acceptable 3D engine only allow with SDL_ * functions?

I looked at Javidx9's 3D engine series and decided to create it with SDL because I had heard about it and seemed simple enough. I will not implement graphical functions that are too complex anyway. So I start writing code, draw my triangles with SDL_DrawLine (), fill my triangles with SDL_DrawLine, and upload the Utah teapot, and the frames stutter quite a bit. I'm pretty sure I already know the answer to this question, but I want to be sure: Is it unrealistic to try to build a 3D engine without using OpenGL functions? It would make sense that the frames are so bad because SDL would have to go through something like OpenGL, so I'm just calling an abstracted DrawLine function that just makes the computer do extra things and slow them down.

By the way, I know that SDL has OpenGL, but I (naively?) Thought it would just be easier to do without it.

Accommodation – Is a screenshot from booking.com acceptable for proof of accommodation?

I plan to stay in the UK for 4 months after the virus. I have to provide proof of accommodation to the immigration officer.
What are accepted methods of proving accommodation? Can I use a screenshot of my work phone?
How many days of accommodation do I normally have to provide?
If I'm going to couch surf 80 percent of my stay in the UK, how should I show it to immigration officials?

java – Is randomly generating a set of arrays for use with JUnit tests an acceptable way to test sorting algorithms?

I recently learned about unit tests in a SWE class and also participate in an algorithm class. The coverage of JUnit tests in my SWE class was pretty low, and I wonder what best practices / applications apply to using the technology.

Suppose I have one mergeSort(int a()) Function that I want to test with JUnit. I have manually written tests for some general edge cases that I can think of, but I want to test them on large arrays of random data to see if they catch anything.

I have put together the following test:

Class SortTest {
...
    @Test
    void mergeSort_2() {
        Random rand = new Random();
        int arrayLen;
        for (int i = 0; i < 10000; ++i) {
            arrayLen = rand.nextInt(10000);
            int() arrayToSort = new int(arrayLen);
            for (int j = 0; j < arrayLen; ++j) {
                arrayToSort(j) = rand.nextInt(1024) - 512;
            }
            int() arrayCopy = arrayToSort.clone();

            Arrays.sort(arrayCopy);
            Sort.MergeSort(arrayToSort);

            assertArrayEquals(arrayToSort, arrayCopy);
        }
    }
}

I am concerned that this could be an inadequate / inefficient route to unit testing, but it has been helpful for me to recognize this unlikely that a random array would cause the sort to fail. Of course, I am aware that running this test incurs real performance costs because it takes about 8 seconds on my computer, and I can imagine that any project of any size would suffer greatly from such tests. Is that the only reason to avoid them? Is there a better way to test for any input?

Thanks a lot

ubuntu – IKE authentication data is not acceptable

I have been trying for two days on my personal VPS (Ubuntu 19.10) to create an IKEv2 Strongswan VPN server (U5.7.2 / K5.3.0-42-generic) to do some tests before I use it on my Unifi devices Implement work (I hope this will be possible)

I used various tutorials and troubleshooting pages to create my conf

I use radius authentication (with a local freeradius server) for the users

And I'm facing this stupid problem, I hope one of you can take 2 minutes to help me 🙂

I will try to be as detailed as possible. Do not hesitate to request further information if necessary

My ipsec.conf:

config setup
  strictcrlpolicy=yes
  uniqueids=never
conn roadwarrior
  auto=add
  compress=no
  type=tunnel
  keyexchange=ikev2
  fragmentation=yes
  forceencaps=yes

  ike=aes256-sha1-modp1024,aes256gcm16-sha256-ecp521,aes256-sha256-ecp384
  esp=aes256-sha1,aes128-sha256-modp3072,aes256gcm16-sha256,aes256gcm16-ecp384

  dpdaction=clear
  dpddelay=180s
  rekey=no
  left=%any
  leftid=vps807542.ovh.net
  leftcert=vpn.example.com.crt.pem
  leftsendcert=always
  leftsubnet=0.0.0.0/0
  right=%any
  rightid=%any
  rightauth=eap-radius
  eap_identity=%identity
  rightdns=8.8.8.8,8.8.4.4
  rightsourceip=10.10.10.0/24
  rightsendcert=never

My ipsec.secrets:

vpsXXXXXX.ovh.net : RSA vpn.example.com.key.der

My ipsec.d / files:

~$ sudo ls /etc/ipsec.d/private/
vpn.example.com.key.der
~$ sudo ls /etc/ipsec.d/certs/
vpn.example.com.crt.pem
~$ sudo ls /etc/ipsec.d/cacerts/
vpnca.crt.der

I imported my vpnca.crt.der on my Mac, my Android (Strongswan client), my Windows 10 Enterprise and a Windows 10 standard from a friend

Everything works fine for my Mac and Android, but it is impossible to connect to Windows

In swanctl –log:

14(CFG) selected peer config 'roadwarrior'
14(IKE) initiating EAP_IDENTITY method (id 0x00)
14(IKE) peer supports MOBIKE
14(IKE) authentication of 'vpsXXXXXX.ovh.net' (myself) with RSA signature successful
14(IKE) sending end entity cert "C=FR, O=Test Company, CN=vpsXXXXXX.ovh.net"
14(ENC) generating IKE_AUTH response 1 ( IDr CERT AUTH EAP/REQ/ID )
14(ENC) splitting IKE message (1996 bytes) into 2 fragments
14(ENC) generating IKE_AUTH response 1 ( EF(1/2) )
14(ENC) generating IKE_AUTH response 1 ( EF(2/2) )
14(NET) sending packet: from XX.XX.XX.XX(4500) to YY.YY.YY.YY(4500) (1248 bytes)
14(NET) sending packet: from XX.XX.XX.XX(4500) to YY.YY.YY.YY(4500) (816 bytes)

The error displayed on the window side is the usual one:

"IKE authentication credentials are unacceptable"

In the event viewer:

CoId={6C88B9D2-54F0-4671-A12D-B506DE75630F}: The user MYWORKDOMAINmyuser dialed a connection named VPN Connection which has failed. The error code returned on failure is 13801.

What I did on the Windows side:

  • Import the CA certificate under Local Computer Certificates -> Trusted Root Certification Authorities -> Certificates
  • Create the VPN connection under VPN settings:
    • Server name or address: vpsXXXXXX.ovh.net
    • VPN type: IKEv2
    • Type of credentials: user and password
  • In the properties of the addcitor ncpa.cpl:
    • Safety:
      • Data encryption: Optional encryption
      • Authentication: Use the EAP (Extensible Authentication Protocol): Microsoft: Secure password (EAP-MSCHAPv2) (encryption enabled)
    • Network: IPv6 deactivated

My certificates were generated on the VPS server using the following commands:

ipsec pki --gen --type rsa --size 4096 --outform pem > vpnca.key.pem
ipsec pki --self --flag serverAuth --in vpnca.key.pem --type rsa --digest sha1 
    --dn "C=FR, O=Test Company, CN=TEST VPS CA" --ca > vpnca.crt.der
ipsec pki --gen --type rsa --size 4096 --outform pem > vpn.example.com.key.pem
ipsec pki --pub --in vpn.example.com.key.pem --type rsa > vpn.example.com.csr
ipsec pki --issue --cacert vpnca.crt.der --cakey vpnca.key.pem --digest sha1 
    --dn "C=FR, O=Test Company, CN=vpsXXXXXX.ovh.net" 
    --san "vpsXXXXXX.ovh.net" --flag serverAuth --outform pem 
    < vpn.example.com.csr > vpn.example.com.crt.pem 
openssl rsa -in vpn.example.com.key.pem -out vpn.example.com.key.der -outform DER

cp vpnca.crt.der /etc/ipsec.d/cacerts
cp vpn.example.com.crt.pem /etc/ipsec.d/certs
cp vpn.example.com.key.der /etc/ipsec.d/private

The certification body has the following attributes:

Verison:
V3
Serial Number:
73fbd6a8d90a33db
Signature algorithm:
sha1RSA
Signature hash algorithm:
sha1
Issuer:
CN = TEST VPS CA
O = Test Company
C = FR
Valid from:
‎Friday, ‎March ‎27, ‎2020 3:15:29 PM
Valid to:
‎Monday, ‎March ‎27, ‎2023 3:15:29 PM
Subject:
CN = TEST VPS CA
O = Test Company
C = FR
Pulic key:
RSA (4096 bits)
Pulic key parameters:
05 00
Subject key identifier:
214851f1fe79e3719be0139fab1799a9d4a08561
Enhanced Key Usage:
Server Authentication (1.3.6.1.5.5.7.3.1)
Basic Constraints:
Subject Type=CA
Path Length Constraint=None
Key Usage:
Information Not Available
Thumbprint:
78e8cc49ab508b8f477b419d369873036be488b4

.

The VPS certificate attributes:

Version:
3
Serial Number:
3611432227629166526
Signature Algorithm:
sha1WithRSAEncryption
Issuer:
C = FR, O = Test Company, CN = TEST VPS CA
Validity:
Not Before: Mar 27 14:15:31 2020 GMT
Not After : Mar 27 14:15:31 2023 GMT
Subject:
C = FR, O = Test Company, CN = vpsXXXXXX.ovh.net
Public Key Algorithm:
rsaEncryption
RSA Public-Key:
(4096 bit)
X509v3 extensions:
X509v3 Authority Key Identifier:
keyid:21:48:51:F1:FE:79:E3:71:9B:E0:13:9F:AB:17:99:A9:D4:A0:85:61
X509v3 Subject Alternative Name:
DNS:vpsXXXXXX.ovh.net
X509v3 Extended Key Usage:
TLS Web Server Authentication
Signature Algorithm:
sha1WithRSAEncryption

I hope you have enough information and can help me because I really don't understand why my Windows is not responding to the IKE_AUTH package …

Thanks for your help and take care!