Posts

Showing posts from August, 2020

HTTP Status Codes

  Informational 100 - Continue A status code of 100 indicates that (usually the first) part of a request has been received without any problems and that the rest of the request should now be sent. 101 - Switching Protocols HTTP 1.1 is just one type of protocol for transferring data on the web, and a status code of 101 indicates that the server is changing to the protocol it defines in the "Upgrade" header it returns to the client. For example, when requesting a page, a browser might receive a status code of 101, followed by an "Upgrade" header showing that the server is changing to a different version of HTTP. Successful 200 - OK The 200 status code is by far the most common returned. It means, simply, that the request was received and understood and is being processed. 201 - Created A 201 status code indicates that a request was successful and as a result, a resource has been created (for example a new page). 202 - Accepted The status code 202 indicates that the se...

MongoDB Basic & Statements

  Difference Between Terms and Syntax SQL Terms/Syntax MongoDB Terms/Syntax Database Database Table Collection Row Document Column Field Index Index Table $lookup or embedded docs Primary key Primary key Transactions Transactions Contrast Between SQL and MongoDB Statements CREATE and ALTER SQL Schema Statements MongoDB Schema Statements CREATE TABLE employee ( id MEDIUMINT NOT NULL AUTO_INCREMENT, user_id Varchar(30), age Number, status char(1), PRIMARY KEY (id) ) db.employee.insertOne { { id: "john25", name: john, status: "A" } ) However, you can also explicitly create a collection: db.createCollection (“employee”) ALTER TABLE employee ADD join_date DATETIME db.employee.updateMany( { }, {$set: {last_name: Adam}} ) ALTER TABLE employee DROP COLUMN join_date db.employee.updateMany( { }, {$unset: {“Age”: “”} } ) INSERT SQL INSERT Statements MongoDB insertOne() Statements INSERT INTO employee(user_id, age, status) VALUES ("test001", 45, "A") db.empl...

ERR: error parsing query: found influx, expected SELECT, DELETE, SHOW, CREATE, DROP, EXPLAIN, GRANT, REVOKE, ALTER, SET, KILL at line

I execute the influxdb query like this in CMD SELECT LAST(node) as node, last(node_name) as node_name, last(location) as location," \ " last(shuntVoltage) as shutVoltage, last(loadVoltage) as loadVoltage, " \ "last(current) as current, last(busVoltage) as busVoltage from powers where time>=now()-15m and time<=now()-15m  and node=" getting error: ERR: error parsing query: found influx, expected SELECT, DELETE, SHOW, CREATE, DROP, EXPLAIN, GRANT, REVOKE, ALTER, SET, KILL at line 277 Resolved? SELECT LAST(node) as node, last(node_name) as node_name, last(location) as location," \ " last(shuntVoltage) as shutVoltage, last(loadVoltage) as loadVoltage, " \ "last(current) as current, last(busVoltage) as busVoltage from powers where time>=now()- '15m' and time<=now()-'15m' and node="

How to Reslove Last(*) error in Influxdb ( expected field argument in last())

  SELECT LAST(*) FROM powers   Getting an error like: ERR: error parsing query: expected field argument in last() You can pass Instanceof last(*) this one. SELECT LAST(node) as node, last(node_name) as node_name, last(location) as location," \ " last(shuntVoltage) as shutVoltage, last(loadVoltage) as loadVoltage, " \ "last(current) as current, last(busVoltage) as busVoltage from powers where time>=now()-'15m' and node="

How to Find Max Reaped Values In List using Python

1)  Using counter we can get a count of list elements in dictionary formate from collections import Counter  List = [2, 1, 2, 2, 1, 3]  print(Counter(List)) output- {2: 3, 1: 2, 3: 1} 2) Using Max and Set method List = ['Cat','Dog','Dog','cat','cat'] res = max(set(List), key = List.count) print(res) 3) We can find using Mode import statistics  from statistics import mode  List = [2, 1, 2, 2, 1, 3]  print(mode(List))

Map with Clicked Respected stateid and State zoom

https://codepen.io/team/amcharts/pen/e3fd144dcf886d29d27b7f47df73f565/?editors=0111

How To Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu 18.04

https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04

How to Use Static Authentication Token In Vuejs

1) if you stroed Token in Localstore  then get token from Localstoreage and use in your application. axios.defaults.headers = {  Authorization: `Bearer ${localStorage.getItem('token')}`, 'Content-Type': 'application/json' } 2) You can added static token instated of your_token place. axios.defaults.headers = {  Authorization: `Bearer + 'your_token'`, 'Content-Type': 'application/json' } Note: you need to add above links before calling of Axios funtion.