Categories
Mastering Development

Cannot move view matrix and direction view matrix is pointing in simultaneously

When I move around the scene (without moving my ‘head’, which is where my view matrix is pointing) everything works just fine. When I look around without moving, everything works just fine. But it is when I combine the two that my head (view matrix) starts going wild. I’m assuming the issue is in my […]

Categories
Ask Geographic Information System (GIS)

GEE slope: Tile error: Reprojection output too large (29005×28882 pixels)

I am trying to do linear regression between sentinel-1 SAR backscatter and NASA SMAP soil mositure, here are a couple of doubts i have regarding my code SAR nominal resolution is 10m and SMAP is around 27 km, I have resampled them to 1000 m for linear regression. I have written many functions to match […]

Categories
Mastering Development

from curl to HTTPS request

I have a problem to transform this cURL: curl -F email=myname@example.com -F file=@file.txt https://srv-file6.gofile.io/uploadFile (srv-file6.gofile.io is an example in reality is something like srv-store6.gofile.io , saw from request itself) into an HTTPS request on node.js. var xmlhttprequest = require (“xmlhttprequest”).XMLHttpRequest; var xhr = new xmlhttprequest(); xhr.open(‘POST’,’https://srv-store6.gofile.io/uploadFile’,false,null,null); xhr.setRequestHeader(‘Content-Type’,’multipart/form-data’); xhr.send(’email=test@test.com&file=C:\\Users\\marco\\Pictures\\programming\\Cattura.png’); xhr.onreadystatechange = function() { if (this.readyState == […]

Categories
Mastering Development

OpenSSL EVP_aes_128_cbc decryption got unexpected result

I encrypted a string with EVP_aes_128_cbc cipher, then changed the 1st byte of the ciphertext, and decrypt this changed ciphertext. Unexpectly, it didn’t decrypt error or get a fully wrong result, but got a wrong 1st 16 bytes and same string of rest. Here is the encrypt func: int do_crypt1(unsigned char *in, unsigned char *outbuf, […]

Categories
Database Development

Index Maintenance on Clustered PK Index

I know there are similar question to this one, but I couldn’t find one dealing with Index Maintenance… I have some PK Clustered Indexes [int (auto increment).] I always notice that these Indexes frequently have two issues: Fragmentation is quickly over 10% Fragmentation is sometimes over 90% Do I need to apply the same logic […]

Categories
Database Development

Index Maintenance on Clustered PK Index

I know there are similar question to this one, but I couldn’t find one dealing with Index Maintenance… I have some PK Clustered Indexes [int (auto increment).] I always notice that these Indexes frequently have two issues: Fragmentation is quickly over 10% Fragmentation is sometimes over 90% Do I need to apply the same logic […]

Categories
Database Development

How to rewrite IIF and dlookup function from Access in SQL Server as we have recently migrated from access to SQL Server

All I need is to rewrite the IIF and dlookup part of this query so its can work in SQL Server . I would preferably like the CASE and SELECT statement as SQL Server doesn’t have dlookup function so code is not working . SELECT ScopeHistory.ProjectReturnID, ScopeHistory.ProjectID, –IIf([ScopeDate] Is Null,Null, –DLookUp("QTR_ID","Quarters","QuarterNo = " & IIf(Month([ScopeDate])<4,4,IIf(Month([ScopeDate])<7,1, […]

Categories
Database Development

How to rewrite IIF and dlookup function from Access in SQL Server as we have recently migrated from access to SQL Server

All I need is to rewrite the IIF and dlookup part of this query so its can work in SQL Server . I would preferably like the CASE and SELECT statement as SQL Server doesn’t have dlookup function so code is not working . SELECT ScopeHistory.ProjectReturnID, ScopeHistory.ProjectID, –IIf([ScopeDate] Is Null,Null, –DLookUp("QTR_ID","Quarters","QuarterNo = " & IIf(Month([ScopeDate])<4,4,IIf(Month([ScopeDate])<7,1, […]

Categories
Ask Geographic Information System (GIS)

SDO_GEOM materialized view: Why is static field slower than dynamic field?

EGDB: Oracle 18c; ArcGIS 10.7.1 External system: Oracle 12c I have a materialized view in an EGDB that syncs data from an external system (on a schedule via a dblink). The materialized view has an SDO_GEOM column (since using SDE.ST_GEOMETRY isn’t possible due to an Oracle limitation here and here). create materialized view my_gis_schema.wo_mv –EGDB […]

Categories
Mastering Development

How to use threads with libev

I’m making a webcrawler and want to spawn a number of threads each with its own event loop to monitor network activity. Here is my code so far: static void my_cb(EV_P_ struct ev_io *w, int revents) { GlobalInfo *g = (GlobalInfo *)w->data; i = 0; if (g->concurrent_connections < MAX_CONNECTIONS) { while (i < MAX_LOAD && […]