i want auto generate id like “DC” + yaer + mounth + 4 digit in nodejs. I am using node js to create an api to connect to the database which I use phpmyadmin I want to create an id like AB22020001 But now all I can do is create an ID like AB2202. I don’t know how to make
Regex match any js number
So as an exercise I wanted to match any JS number. This is the one I could come up with: This however doesn’t match the new syntax with underscore separators (1_2.3_4). I tried a couple of things but I couldn’t come up with something that would work. How could I express all JS numbers in one regex…
On login screen layout keeps showing – React & React router
As I mentioned I have MUI Theme Provider with Layout which includes Dashboard, Order screens … When user hits ‘/’ endpoint it should return Login Screen but Layout keeps showing itself. -App.js ); -Layout.js …AppBar,Sidebar etc Answer As-is, the code is unconditionally rendering a Layo…
Function parameter is not defined in callback
I am trying to get the location of the user and using that I am trying to get the city. I don’t why but when I call the query function, the city parameter is having some value but it is not reflected in the callback function’s if condition. However, if I replace the city variable in the If conditi…
How do I merge two Javascript Objects into one?
I Have two Array of Objects : salesLabelData – salesAPIData : ] I need to merge these, to eventually get this array (Basically the Datasets have to be merged into one) : Expected Result – I have tried the following and other various permutations/combinations, checked out many answers on this site …
How to type a generator function with typscript
I would like to send a value back to the generator function using next which seems to complicate typing this function DEMO In my VSCODE I get the following error for Line A And In Stackblitz/demo I get an error for Line B So my question is, how can I type the value I provide with next? Answer TypeScript 3.6
Memory Leak when Drawing Video to Canvas using requestAnimationFrame
I am trying to do a dual monitor screen recording by combining screen1 and screen2 in Canvas. I am using vue and electron to do this. But I always got a memory leak, after I troubleshoot my code and narrow the problem. I found that this simple code causes a memory leak, but until now I could not find out
How to make floating text onclick like cookie clicker?
When clicking the “big cookie” in cookie clicker, there is a popup showing how many cookies you earned (+276.341 septillion in this image), which slowly moves upward and fades out. I wanted to implement a similar feature in my game, I sucessfully made the moving up and fading out part with css ani…
Test an onlyOwner function in Javascript
I have this situation in my smart contract: I’m using truffle and his test suite and then I wrote this case, that fails maybe because I’m not using the only owner method in the right way: Can someone help me? Answer Assuming that you properly set the owner in the contract, write a getter for the o…
fleissner grille javascript
Can I use a function that allows me to get the hidden message? If so, could you enlighten me, how can I do it? Using fleissner grille 6 x 6, decipher the hidden message: “lróaon. sg sdersoildsu.:.cc kiomamii”. For this, it must be rotated 90° clockwise. The open grids are at positions [1,1],[4,1],…