Posts

Node install and update

1 .          curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh    2.          curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash                       //install nvm  3.           source ~/.bashrc       // This will install the nvm script to your user account. To use it, you must first source your .bashrc file:  4.               nvm list-remote             //to check which latest version avliable  5.               nvm install v22.12.0        //install new version 6.           nvm alias default 20.14.0   //To set deualt the node virson    6....

prisma using in project idx 13.3

Okay, let's troubleshoot why you might be unable to use the Prisma schema in your Project IDX workspace. Here's a breakdown of common reasons and how to fix them: 1. Prisma is not installed Problem:  Prisma might not be installed in your IDX environment. Solution:  You'll need to add it to your  .idx/dev.nix  file, like this: nix { pkgs, ... }: { # ... other configurations packages = [ # ... other packages pkgs.nodePackages.prisma ]; # ... rest of your configuration } lua (auto) Once you add this line and  rebuild the environment  by clicking the popup message, IDX will install  prisma  and make it available in your workspace. 2. The Prisma CLI is not accessible Problem:  After installation, you might need to explicitly call the Prisma CLI using its full path or use  npx . Solution:  When running Prisma commands in your terminal (in IDX), use  npx prisma  (e.g.,  npx prisma migrate dev ) or ...

Project-13.1/ backend

A)      1) Create folder           2) npm create hono@latest   //initialize  hono           3) Target directory: you can give it what you want to give           4) Chouse ColudFlair Code B) 1) Get you neon.db OR avien.tech Connection String 2) Initialize prisma      >npx i prisma      >npx prisma init 3) Get your pool URL from the Prisma accelerator             > Copy the Database String OR Connection string           > Create a Prisma Accelerate Account > Create a personal project   > Click to Accelerate             > Click the Setup             > Paste on "Database Connection String"             > Select reign          ...

12.2 Advance typescript

 create a folder initialize it : npx init -y  now initialize it with typescript : npx tsc --init update ts config of "outdir" and "rootdir" to "./dits" and "./src" , code interface user {  name : string; age: number; }; function someOfAge (User1: user , User2: user) { return User1.age + User2.age; } const age = someOfAge({name: " dhrup sinha" , age: 20},  {name: " simran sinha" , age0: 205}) console.log(age); run the code command :  tsc -b  OR npx tsc -b  Pike:   The Pike general type in Script is a powerful feature that allow you to constructs new type by selecting a subset of properties from on existing type / Interface, enhance type safety and code readability without redundancy. syntax:- Pike < type key | 'key' | 'key' >; code Interface user( id :string; name: string; age: number; email: string; password: string; }; type UpdateProp = Pike< User, "name" | 'age' | 'email'...

week2 DSA 05/04, prefix, frequency Array

Image
problem statement: https://leetcode.com/problems/find-the-highest-altitude/description/ //highest altituade class Solutation { public: int largestAltitued (vecotr <int> & gain ) {  int n = gani.size(); vector<int>alt(int,0); for(int i = 1; i<= n; i++;) { alt[i] = alt [i-1] + gain[i-1]; } int max_el = *max_elemenet(alt.begin(), alt.end()); reutrn max_el; } };                                                      **normal way of for loops to count frequency** #include <iostream> #include <string> using namespace std; int main() {     string str = "hello";     int freq[26] = {0}; // Array to store frequency of each letter     // Calculate frequency of each character     for (char c : str) {         freq[c - 'a']++; // Increment the count f...

Week 1, DSA 02/04, array

 PPT:- https://projects.100xdevs.com/tracks/dsa/dsa1 DSA stands for data Structure and Algorithms. Data Structures:  means the way some data is stored for example: we can store data as lists or in a stack or as a tree, All of these are examples of data structures, Algorithms is a set of steps you need to follow to solve some problem. Either the set fo steps is known {example, sorting, DFS etc} or you derive the set of steps using first principles and logical thinking CP stands for Competitive Programing. it is a sport where competitors solve DSA ICPC IOI code jam local contests Array :  Collection of elements of some (any) type is called an array /list int f(int x, vector<int>& nums) { //count of all the pairs (i,x) where A[i] = A[x] and i != x and A is the prefix till x // A =  [nums[0], nums[1], ......, nums[x]] int count = 0; for(int i = 0 ; i< ; i++) { if (nums[i] = nums[x]) { count +=1; } } return count; } int numIdenticalParis(vector<int>...

week 15.1 docker, in project IDX setUp

/* create and setup as mention on step1,2,3,4,5 //if you want to create your won docker project      1) clone your prjoect or write your project      2) Dockerfile  //create a dockerfile in your root of project diricitory and write this inside your dockerfile. inside the Dockerfile mention all commands that will required before start you program. all snippet code mention bellow. a) FROM node:22-alpine   #base image which will retrive by docker registry.           a) FROM node:20   #base image which will retrive by docker registry. b) WORKDIR /app     # working diricitory c) COPY . .      #COPY OVER FILE d) RUN npm install  #run command to build the program d.1) RUN npm run build // e) EXPOSE 8080      # EXPOSE PORT #command to run the application              f)    CMD ["node", "dist/index.js" ]...