typescript instanceof return false

class Department { name: string; constructor(n: string) { this.name = n; } describe(this: Department){ console.log(‘department: ‘ +this.name); } } const frontend = new Department(‘frontend’); frontend.describe(); const frontendCopy = {name: ‘Jay’, describe: frontend.describe}; frontendCopy.describe(); console.log(frontendCopy instanceof Department); console.log(frontend instanceof Department); Hello, I’m a junior frontend engineer I wonder why console.log(frontendCopy instanceof Department); print false. shouldn’t frontendCopy.describe()…

Details

Spring compatible scrypt password with python passlib

How can I generate Spring compatible passwords from python? I’ve got a spring application creating scrypt passwords that look like this in the db: {scrypt}$e0801$QAqC0fvhY6iJPysiQsFnrcUg205njHo/6o+IDXDn33lxmZOCVBhb4NAqdafhuGmykCxQtMI5xP5zb7MYMUrU3Q==$sBeXCHOm6zQuGdSDKs+HeXnNQGg3bhRidmL+HU/ZTMM= I’m trying to update the database directly with new passwords using python and passlib but cannot divine the correct setting_kwds for passlib from $e0801$: >>> from passlib.hash import scrypt >>>…

Details

Adding lines in the middle of the file using shell script

I have an xml file where I need to insert a few lines at random places. I am trying to use sed/awk but running into some issues. Here’s what I am trying to do. <?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?> <Manager name=”Manager1″ exportDate=”2020-01-13-05:00″ comment=” configuration from 0.0.0.0″> <ChannelSet> <ChannelEntry> <ChannelAttributesEntry name=”/Pub/Sub/commands” TTL=”0″ capacity=”0″ EID=”15″ clusterWide=”true” jmsEngine=”true” mergeEngine=”false”…

Details