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
var Col = require('react-bootstrap/lib/Col') | |
var PageHeader = require('react-bootstrap/lib/PageHeader') | |
var React = require('react') | |
var Row = require('react-bootstrap/lib/Row') | |
var {connect} = require('react-redux') | |
var {reduxForm} = require('redux-form') | |
var DateInput = require('./DateInput') | |
var FormField = require('./FormField') | |
var LoadingButton = require('./LoadingButton') |
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
# Make directory if it doesn't exist | |
directory = 'media/csvs/' | |
if not os.path.exists(directory): | |
os.makedirs(directory) | |
path = directory + 'student_data.csv' | |
csvFile = open(path, 'w') | |
csvFile.write('Name,Contact Number,email\n') | |
# Iterate through queryset or list and do the following for each iteration |
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
valid_contact = True | |
# Check if contact can be converted to integer (use regex match if chars like + are allowed) | |
# Although it is suggested to store coutry codes separately | |
try: | |
contact_number = int(data['contact_number']) | |
except ValueError: | |
valid_contact = False | |
# Change length according to needs, generally kept between 10 and 15, strictly 10 used here |
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.core.validators import ValidationError | |
try: | |
validate_email(email) | |
except ValidationError: | |
return Response({"status": "error", "message": "Provided email id is invalid."}) |
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
import os | |
directory = 'media/csvs/' | |
if not os.path.exists(directory): | |
os.makedirs(directory) |
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 coalib.bearlib.languages.Language import Language | |
@Language | |
class VB: | |
aliases = 'vb', | |
versions = 14.0, 15.0 | |
extensions = '.vb', | |
comment_delimiter = "'" | |
string_delimiters = {'"': '"'} |
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 coalib.bearlib.languages.Language import Language | |
@Language | |
class m4: | |
versions = 1.4, | |
extensions = '.m4', | |
comment_delimiter = '#' | |
multiline_comment_delimiters = {'/*': '*/'} | |
string_delimiters = {'`': "'", '"': '"'} |
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 coalib.bearlib.languages.Language import Language | |
@Language | |
class Tcl: | |
aliases = 'Tcl/Tk', | |
versions = 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6 | |
extensions = '.tcl', | |
comment_delimiter = '#' | |
string_delimiters = {'"': '"', '{': '}'} |
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
[WARNING][12:50:43] Implicit 'Default' section inheritance is deprecated. It will be removed soon. To silence this warning remove settings in the 'Default' section from your coafile. You can use dots to specify inheritance: the section 'all.python' will inherit all settings from 'all'. | |
Executing section LineLength... | |
Executing section CheckQuotation... | |
Executing section UnusedCode... | |
Executing section pep8... | |
Executing section SpaceCheck... | |
Executing section cli... |
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
import random | |
import sys | |
import time | |
def initialiseBoard(): | |
"""Set the grid dimensions according to the user. | |
Function returns grid_list containing the grid values. | |
Option to change the size of the board added. |
NewerOlder