geometry – Can you help me resolve a bug in mesh collision code?

I have entities which walk along a 3D mesh. I move the units along their x,z axis, and every frame I update their y-position according to the quad or triangle they are standing on, using Barycentric coordinates. They do walk along the mesh, however every time they enter a new quad or triangle, they “bob” up and down on the y-axis.

Height testing is done by finding the “bottom-left” vertex of a “sqaure” of four vertices made by converting the unit’s x,z position into a 1d index into an array of vertices.

They move smoothly until they enter a new part of the mesh, where it looks like their y-coordinate shifts once very noticeably and then keep moving smoothly. It happens both when testing against the square made by the four vertices around the unit, and with testing against triangles of mesh.

Here is the code to find y-coordinate on a square:

float px = batchTranslation( i ).Value.x;
float pz = batchTranslation( i ).Value.z;

int index = ( int ) ( ( math.floor( pz / MAP_SCALE ) ) * MAP_SIZE + ( math.floor( px / MAP_SCALE ) ) );

int bL = index;
int bR = index + 1;
int tL = index + MAP_SIZE;

float3 p1 = vertices( bL );
float3 p2 = vertices( bR );
float3 p3 = vertices( tL );

float3 normal = math.cross( ( p2 - p1 ) , ( p3 - p1 ) );

float py = ( normal.x * ( p1.x - px ) + normal.z * ( p1.z - pz ) + normal.y * p1.y ) / normal.y + HALF_HEIGHT;

batchTranslation( i ) = new Translation { Value = new float3( px , py , pz ) };

Here is the code for finding the y-coordinate on the triangles of the mesh:

float px = batchTranslation( i ).Value.x;
float pz = batchTranslation( i ).Value.z;

int index = ( int ) ( ( math.floor( pz / MAP_SCALE ) ) * MAP_SIZE + ( math.floor( px / MAP_SCALE ) ) );

int bL = index;
int bR = index + 1;
int tL = index + MAP_SIZE;
int tR = index + MAP_SIZE + 1;

float3 V1 = vertices( bL );
float3 V2 = vertices( bR );
float3 V3 = vertices( tL );
float3 V4 = vertices( tR );

float py = batchTranslation( i ).Value.y;

if ( IsInside( V1.x , V1.z , V2.x , V2.z , V3.x , V3.z , px , pz ) )
    py = CalcY( V1 , V2 , V3 , px , pz );
else if ( IsInside( V1.x , V1.z , V2.x , V2.z , V4.x , V4.z , px , pz ) )
    py = CalcY( V1 , V2 , V4 , px , pz );

batchTranslation( i ) = new Translation { Value = new float3( px , py , pz ) };

private float Area( float x1 , float z1 , float x2 , float z2 , float x3 , float z3 )
{
    return math.abs( ( x1 * ( z2 - z3 ) + x2 * ( z3 - z1 ) + x3 * ( z1 - z2 ) ) / 2.0f );
}

private bool IsInside( float x1 , float y1 , float x2 , float y2 , float x3 , float y3 , float x , float y )
{
    float A = Area( x1 , y1 , x2 , y2 , x3 , y3 ); // Calculate area of triangle ABC
    float A1 = Area( x , y , x2 , y2 , x3 , y3 ); // Calculate area of triangle PBC
    float A2 = Area( x1 , y1 , x , y , x3 , y3 ); // Calculate area of triangle PAC
    float A3 = Area( x1 , y1 , x2 , y2 , x , y ); // Calculate area of triangle PAB
    return ( A == A1 + A2 + A3 ); // Check if sum of A1, A2 and A3 is same as A
}

// Returns y coordinate of point on triangle given point x and z coordinates
private float CalcY( float3 p1 , float3 p2 , float3 p3 , float x , float z )
{
    // determinant
    float det = ( p2.z - p3.z ) * ( p1.x - p3.x ) + ( p3.x - p2.x ) * ( p1.z - p3.z );

    float l1 = ( ( p2.z - p3.z ) * ( x - p3.x ) + ( p3.x - p2.x ) * ( z - p3.z ) ) / det;
    float l2 = ( ( p3.z - p1.z ) * ( x - p3.x ) + ( p1.x - p3.x ) * ( z - p3.z ) ) / det;
    float l3 = 1.0f - l1 - l2;

    return l1 * p1.y + l2 * p2.y + l3 * p3.y;
}
```

magento2 – Whats the best way to resolve requireJS conflicts in 3rd party modules

I have 2 modules, Cart2Quote and a Swissup Ajax module. Both have requireJs configs that override the catalogAddToCart mapping.

Siwssup_Ajaxpro
Siwssup_Ajaxpro

Cart2Quote
Cart2Quote

So the Cart2Quote modules init function is never called.

I’ve searched but can’t find any advice for resolving issues like this.

Microsoft Exchange Server Updates Resolve 0-Day Vulnerabilities

Users of Microsoft Exchange Server 2013, 2016, and 2019 should update as a priority.

How do I resolve `Missing shims for Node.js built-ins` in an electron rollup app?

I’m trying to create a sqlite3 db using knex from inside an electron app built with rollup.

import knex from 'knex';
import 'sqlite3';

const database = knex({
    client: 'sqlite3',
    connection: {
        filename: './games.sqlite'
    },
    useNullAsDefault: true
});

database.schema.hasTable('games').then(exists => {
    if (!exists) {
        return database.schema.createTable('games', t => {
            t.increments('id').primary();
            t.string('name', 100);
        });
    }
});

export default database;

As soon as this code is run I see the following warnings:

(!) Missing shims for Node.js built-ins
Creating a browser bundle that depends on 'util', 'events', 'stream', 'assert', 'timers', 'url', 'path', 'os' and 'buffer'. You might need to include https://github.com/ionic-team/rollup-plugin-node-polyfills
LiveReload enabled
(!) Missing global variable names
Use output.globals to specify browser global variable names corresponding to external modules
util (guessing 'util$6')
events (guessing 'require$$0$1')
stream (guessing 'require$$1')
assert (guessing 'assert')
timers (guessing 'timers_1')
url (guessing 'url')
fs (guessing 'fs')
path (guessing 'path$1')
child_process (guessing 'require$$0$2')
os (guessing 'os')
buffer (guessing 'buffer')

My read of this is that knex and/or sqlite3 is using a bunch of node built-ins and rollup needs to know how to bundle those. The suggested rollup-plugin-node-polyfills plugin sounds like it has been deprecated a few times over and is now replaced by @rollup/plugin-inject, but I don’t understand what I’m supposed to do with it in my rollup.config.js.

My guess would be

 plugins: (
    inject({
      util: <<<<something>>>>,
      events: <<<<something>>>>
      etc etc
    })
  )

but none of my guesses for what those values should be have done much of anything.

rollup-plugin-node-polyfills also sounded promising but didn’t seem to work.

sql server – Unable to resolve column level collations

Getting below error from after executing the query from the –Adding missing headers into the file—-

error:
SQLState = 22008, NativeError = 241
Error = (Microsoft)(SQL Server Native Client 10.0)(SQL Server)Conversion failed when converting date
and/or time from character string.
SQLState = S1000, NativeError = 0
Error = (Microsoft)(SQL Server Native Client 10.0)Unable to resolve column level collations

please do the needfull

ALTER PROCEDURE (dbo).(GenerateCDR)
AS
Begin
DECLARE @sqlCommand varchar(8000)
DECLARE @filePath VARCHAR(125)
DECLARE @fileName VARCHAR(125)
DECLARE @todaysDateFormatted VARCHAR(30)
DECLARE @ServerName varchar(50)

— generate the dynamic file name based on the date and time
SELECT @todaysDateFormatted = CONVERT(VARCHAR, GETDATE(), 112) + ‘‘ + CAST(DATEPART(HOUR, GETDATE())
AS VARCHAR) + ‘
‘ + CAST(DATEPART(MINUTE,GETDATE()) AS VARCHAR) + ‘‘ + CAST(DATEPART(SECOND,
GETDATE()) AS VARCHAR)
— ALTER the file name
SET @fileName =’Tansactions
‘+ @todaysDateFormatted + ‘.csv’;

SET @ServerName = ‘TRUSTACCTEST’;

DECLARE @cmd varchar(8000)

—–Copy the table records into TransactionsData folder with .csv file—-
Select @cmd = ‘BCP ‘+
‘”Select * From (LinkVisaCard).(dbo).(Transaction)”‘
+ ‘ QUERYOUT C:TransactionsData’ +@fileName +’ ‘+ ‘/c /t”|” /T’+@ServerName
PRINT @cmd
EXEC master..xp_cmdshell @cmd;
PRINT @cmd

——Adding missing headers into the file———-
DECLARE @columnHeader VARCHAR(8000)
SELECT @columnHeader =
”’RecordID”,”MSISDN”,”Amount”,”ReferenceID”,”SessionID”,”Action”,”RequestDate”,”ResponseD

ate”,”StatusID”,”Channel”,”CallBackRequestDate”,”CallBackResponseDate”,”CallBackReferenceID”’

  Select @cmd = 'BCP '+'"Select '+ @columnHeader +' UNION ALL SELECT convert(varchar(20), 
  (RecordID)),convert(varchar(20),(MSISDN)),convert(varchar(20),(Amount)),convert(varchar(20), 
  (ReferenceID)),convert(varchar(20),(SessionID)),convert(varchar(20), 
  (Action)),RequestDate,ResponseDate,convert(varchar(20),(StatusID)),convert(varchar(20), 
  (Channel)),CallBackRequestDate,CallBackResponseDate,CallBackReferenceID From (LinkVisaCard).(dbo). 
  (Transaction)"'+ ' QUERYOUT C:TransactionsData' +@fileName +' '+ '/c /t"|" /T'+@ServerName
  PRINT @cmd
  EXEC master..xp_cmdshell @cmd;
  END

log – Oracle 19c with SAP System – ORA-12154: TNS:could not resolve the connect identifier specified After Configuring Database Vault

I configured database vault and create policy on Oracle 19c + SAP system. After this operation, on primary side I have a problem when transporting logs to Data Guard side.

Outputs from primary side:

SQL> select status, error from v$archive_dest where dest_id=2;                                                                                                                                      
                                                                                                                                                                                                    
STATUS    ERROR                                                                                                                                                                                     
--------- -----------------------------------------------------------------                                                                                                                         
ERROR     ORA-12154: TNS:could not resolve the connect identifier specified


SQL> show parameter log_archive_dest_2

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_2                   string      SERVICE=DRSIDE NOAFFIRM ASYNC V
                                                 ALID_FOR=(ONLINE_LOGFILES,PRIM
                                                 ARY_ROLE) DB_UNIQUE_NAME=DRSIDE

SQL> show parameter log_archive_dest_state_2                                                                                                                                                        
                                                                                                                                                                                                    
NAME                                 TYPE        VALUE                                                                                                                                              
------------------------------------ ----------- ------------------------------                                                                                                                     
log_archive_dest_state_2             string      ENABLE

Alert log:

TT00 (PID: a number): Error 12154 received logging on to the standby
2021-02-20T15:48:51.144500+03:00
TT00 (PID: a number): Error 12154 received logging on to the standby
2021-02-20T15:53:51.946941+03:00
TT00 (PID: a number): Error 12154 received logging on to the standby
2021-02-20T15:58:52.744327+03:00
TT00 (PID: a number): Error 12154 received logging on to the standby
2021-02-20T16:03:53.549161+03:00
TT00 (PID: a number): Error 12154 received logging on to the standby

I did not make any changes to the tnsnames.ora or listener.ora files.

Best regards,

video – Looking for guidance to resolve a difference of opinion – play button on image that is not clickable

Consider that users come to your site with expectations from all the other sites they visit.

An extremely common interaction when a user clicks a ‘Play’ icon, is that a video will begin playing. It’s interaction, not navigation to a collection of items.

A good heuristic here is Jakob’s Law

Users spend most of their time on other sites. This means that users prefer your site to work the same way as all the other sites they already know. Design for patterns for which users are accustomed.

Rather than have users tricked into thinking they’re getting a video, you could overlay a clearly visible button that could say View lessons > or something equivalent.

Then the play button is reserved for content that plays directly.

dnd 5e – How do you resolve the damage and effects of Eldritch Claw Tattoo’s “Eldritch Maul” ability on a hit that is beyond your weapon’s normal melee range?

The Eldritch Maul ability says:

each of your melee attacks with a weapon or an unarmed strike can reach a target up to 15 feet away from you, as inky tendrils launch toward the target. In addition, your melee attacks deal an extra 1d6 force damage on a hit.

So, let’s say that I’m using the Eldritch Maul ability with a normal shortsword to melee attack a target that is 15 feet away. Is it only the inky tendrils that hit the target, dealing just 1d6 force damage, or should I also factor in the 1d6+STR/DEX piercing damage of the shortsword as if it hit the target as well?

Follow-up question: If the weapon was magical, would its magical properties factor into the attack?

For example: Would your attack with the Eldritch Maul ability benefit from a +1 weapon?

In another example: Would a Dagger of Venom’s poison property proc on a melee hit from 15 feet away while using the Eldritch Maul ability?

Dagger of Venom says:

You can use an action to cause thick, black poison to coat the blade. The poison remains for 1 minute or until an attack using this weapon hits a creature.

dnsmasq – EdgeOS – Resolve local DHCP hostnames as DNS

I’ve got an EdgeRouterX and I’m trying to get its built-in DNS server to resolve local hostnames by DHCP lease.

For instance: gitlab.home.internal.

I’ve enabled the dns server and the domain on the DHCP server. I’ve tried querying it using dig but it always seems to return the external IP.

Any ideas?