use command
pm2 start launch.py --name py-api --interpreter python3
use command
pm2 start launch.py --name py-api --interpreter python3
Q. pair from two sorted array having one element from each and sum is nearest to number X. Solve in O(n) time.
Solution:
Answer:
Create the backup (export):
crontab -l > /some/shared/location/crontab.bak
Import it from the new user:
crontab /some/shared/location/crontab.bak
Use below command to restore deleted file before commiting
git checkout HEAD <filename>
use below code:
expired_users = sorted(expired_users, key=lambda k: k['expiry_date'],reverse=True)
MongoDump
mongodump -d=pp -c=qq --query='{"expiredPremiumInfo":{"$exists":true}}'
mongorestore -d=pp -c=qq <path to bson file>
Stripo.email is amazing platform for managing Email templates. It has drag and drop email editor also.
find . -type f -size 2572c | xargs rm -rf
use find to list files
c==byte
use xargs to pipe and delete
RAKE-NLTK is a modified version that uses the natural language processing toolkit NLTK for some of the calculations.
Installation:


Import, Declare a RAKE-NLTK Object and Extract!
We again extract just the top 10 keywords.


Here’s the output for the same text passage using RAKE-NLTK. For the chosen passage, RAKE and RAKE-NLTK give the same output. But this isn’t always the case. Try it out for yourself on other passages!
crisp is customer chat application and they have widget for android apps as well.
appicon.co
This site is amazing the way it create app icons.
1. UI Callbacks
var uirefreshListener: (()->Unit)? = null
this.uirefreshListener={
showPostLoginUI()
}@JvmStatic
fun addCustomerPremiumInfo(context: Context, customer_id: Int, callbackUI: (() -> Unit)?) {}2. Static fields and methodscompanion object {
@JvmStatic
fun syncCustomerData(context: Context, name: String, email: String) {}3. Async and runonMainUI and co-routinesGlobalScope.async {
val ackPurchaseResult = withContext(Dispatchers.IO) {
billingClient.acknowledgePurchase(acknowledgePurchaseParams.build(),acknowledgePurchaseResponseListener)
}
}
Go to ~/.android
run below command
keytool -exportcert -list -v -alias androiddebugkey -keystore debug.keystore
python3 -m venv env
source env/bin/activate # On Windows use `env\Scripts\activate`
# Install Django and Django REST framework into the virtual environment
pip install django
pip install djangorestframework
# Set up a new project with a single application
django-admin startproject tutorial . # Note the trailing '.' character
cd tutorial
django-admin startapp quickstart
cd ..python manage.py createsuperuser --email admin@example.com --username admin
manage.py makemigrationmanage.py migratecreate token: python manage.py drf_create_token bholaGive MYSQL settings like below: DATABASES = {'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'xxx',
'USER': 'root',
'PASSWORD': 'xxxxxx',
'HOST': 'localhost', # Or an IP Address that your DB is hosted on
'PORT': '3306',
}
}
Django filters:pip install django-filter
filter_backends = [DjangoFilterBackend]
filter_fields = ["email"]
Below is amazing tutorial for setting Flask with uWSGI:
Key command is :
uwsgi --socket 0.0.0.0:5000 --protocol=http -w wsgi:app
https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uswgi-and-nginx-on-ubuntu-18-04
My firm HinKhoj has finally launched dedicated website for English learning for Hindi Medium students. In Namaste English, students will get below:
1. Online Live Video courses
2. Recorded classes from English Teacher
3. Grammar practice and spoken english practice
4. Games for increasing English Knowledge
So why wait, click on https://namaste-english.com to visit it.