Tuesday, May 21, 2024

Top AI Tools

Download and Install Python


Download and Install Pycharm


Install Jupyter

> pip install jupyter


Install Transformers

> pip install transformers

> pip install transformers[sentencepiece]


Install Pytorch (Preferred for dev)/TensorFlow (preferred for prod)

> pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118


Friday, May 17, 2024

MongoDb CheatSheet

CRUD Operations:

Create

db.products.insert({item:"TV",aqty:200,soldqty:1200,avail:true})

db.createCollection("Name")


Read:

db.products.find({<Condition>},{<Projection>})

Get single document - db.products.findOne()

Get all documents - db.products.find()

Get documents based on filters - db.products.find({aqty:0})

Get documents with particular fields - db.products.find({aqty:0},{item:1,soldqty:1})

Reading the data with limit(), sort(), skip() functions:

db.products.find().sort({aqty:1}).limit(5)

db.products.find().sort({aqty:1}).skip(5)


Operators: in, ne, nin, lt, gt, lte, gte, or, and

IN -  db.products.find({aqty:{$in:[0,200]}})

Less Than & And - db.products.find({aqty:{$lt:200},soldqty:1800})

OR - db.products.find({$or:[{aqty:200},{soldqty:3000}]}) 

        db.products.find({$or:[{aqty:{$lt:200}},{soldqty:{$gt:1800}}]})


Update:

add/update property - db.products.updateMany({},{$set:{price:100}})

remove property - db.products.updateMany({}, {$unset: {price: 0}})


Delete:

collection - db.test.drop()

single row - db.products.deleteOne({item:'TV'})

multiple row - db.products.deleteMany({prices:{$lt: 200}})

all rows - db.products.deleteMany({})


Indexes:

db.products.createIndex({price:1})


Aggregation:


https://www.mongodb.com/developer/products/mongodb/cheat-sheet/


Tuesday, May 14, 2024

Deep Dive in Asynchronous Programming in Javascript

JavaScript is single threaded language. 

Synchronous programming is execution of functions in order.

Asynchronous programming is executing a long running process outside the main thread. It does not block code execution on main thread. Although it is achieved usually by running asynchronous function on separate thread. Though javascript is a single threaded language it supports aysnchronous behaviour, to understand how we need to understand JS runtime.

 




Cybersecurity Essential: OpenSSL

In today’s digital landscape, securing data is paramount. Whether you’re building web applications, managing servers, or developing software...