This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_spiral_matrix(starting_row, starting_col, ending_row, ending_col, matrix): | |
up, down, right, left = [], [], [], [] | |
for c in range(starting_col, ending_col + 1): | |
up.append(matrix[starting_row][c]) | |
right.append(matrix[c][ending_row]) | |
down.append(matrix[ending_row][-(1 + c)]) | |
left.append(matrix[c][starting_row]) | |
result = up + right[1:] + down[1:] + left[1:-1] | |
if starting_row == ending_row and starting_row and ending_col: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const iterable = [1, 1]; | |
const [x, y] = iterable; | |
// x = 1; y = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const obj = { name: 'Taohid', age: '25' }; | |
const {name:myName,age:myAge} = obj; | |
console.log(myName,myAge); | |
//Taohid 25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const obj = { name: 'Taohid', age: '25' }; | |
const {name,age} = obj; | |
console.log(name,age); | |
//Taohid 25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const obj = { name: 'Taohid', age: '25' }; | |
const {name,age} = obj; | |
console.log(name,age); | |
//Taohid 25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.urls import path | |
from api.views import book | |
from core.views import index | |
urlpatterns = [ | |
path("book/", book, name="book"), | |
path("", index, name="index") | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.shortcuts import render | |
def index(request): | |
return render(request, "build/index.html") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STATIC_URL = '/static/' | |
STATICFILES_DIRS = ( | |
os.path.join(BASE_DIR, 'book-frontend', "build", "static"), # update the STATICFILES_DIRS | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TEMPLATES = [ | |
{ | |
'BACKEND': 'django.template.backends.django.DjangoTemplates', | |
'DIRS': [os.path.join(BASE_DIR, 'book-frontend')] #Look, we have added the root folder of frontend here | |
, | |
'APP_DIRS': True, | |
'OPTIONS': { | |
'context_processors': [ | |
'django.template.context_processors.debug', | |
'django.template.context_processors.request', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Django settings for book project. | |
Generated by 'django-admin startproject' using Django 2.2. | |
For more information on this file, see | |
https://docs.djangoproject.com/en/2.2/topics/settings/ | |
For the full list of settings and their values, see | |
https://docs.djangoproject.com/en/2.2/ref/settings/ |
NewerOlder