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
std::string text = "Hello sweet world" | |
// Create cmatch object to match `match_results` objects into string literals | |
std::cmatch matchStore; | |
// Create a regex object to contain the strings that are going to be matched against | |
std::regex reg("([A-z]+)[\\s]+([A-z]+)[\\s]+([A-z]+)"); | |
// `regex_search` will go through the string and store any matchings into `cm` | |
std::regex_search(text.c_str(), matchStore, reg); |
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
std::string text = "Hello sweet world" | |
// Create cmatch object to match `match_results` objects into string literals | |
std::cmatch matchStore; | |
// Create a regex object to contain the strings that are going to be matched against | |
std::regex reg("([A-z]+)[\\s]+([A-z]+)[\\s]+([A-z]+)"); | |
// `regex_search` will go through the string and store any matchings into `cm` | |
std::regex_search(text.c_str(), matchStore, reg); | |
for(int i = 1; i < matchStore.size(); i++) { | |
std::cout << "[" << matchStore[i] << "]" << std::endl; |
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
; THIS PROGRAM MULTIPLIES A NUMBER BY 2 | |
; Made by Jose Salvatierra | |
; University of Dundee | |
VAR 0 ; Fill space | |
START: LDN NUM1 ; Copy variable negated | |
SUB NUM1 ; Subtract itself (multiply by 2) | |
STO MYSUM ; Store it in accumulator | |
LDN MYSUM ; Negate the answer (make it positive) | |
STO MYSUM ; Store to variable | |
STP ; Stop the processor |
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
/* | |
This document has been created with Marked.app <http://markedapp.com>, Copyright 2011 Brett Terpstra | |
Please leave this notice in place, along with any additional credits below. | |
--------------------------------------------------------------- | |
Title: Blank/Code Theme | |
Author: Jose Salvatierra &c 2013-4 jslvtr.com | |
Description: A very simple theme with Garamond as a main font. Titles are in Crimson Text, and the code in Source Code Pro or Consolas. | |
*/ | |
body |
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
; THIS PROGRAM MULTIPLIES A NUMBER BY 2 | |
; Made by Jose Salvatierra | |
; For a further explanation go to | |
START: LDN NUM1 ; Copy variable negated into the accumulator (this is the value we are working with in the processor) | |
SUB NUM1 ; Subtract from the value in the accumulator the value of NUM1 (this is essentially multiplying by 2) | |
STO MYSUM ; Store to variable (copy the value we're working with to the variable MYSUM) | |
LDN MYSUM ; Get the value of the variable multiplied by -1 (negated) into the accumulator | |
STO MYSUM ; Store to variable (copy the value we're working with to the variable MYSUM) | |
STP ; Stop the processor (ends the program) | |
NUM1: VAR 750 ; Declare 32-bit variable with value 750 |
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 datetime | |
import os | |
import sys | |
__author__ = 'Jose Salvatierra' | |
path = os.path.dirname(os.path.realpath(__file__)) | |
def write_section(content, current_id, last_end_time): |
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
""" | |
This file defines a User model and a Flask application, and implements authentication using encryption. | |
For more information, visit http://tecladocode.com/blog/learn-python-password-encryption-with-flask | |
""" | |
from flask import Flask, request, jsonify | |
from werkzeug.security import generate_password_hash, check_password_hash | |
import sqlite3 |
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 smtplib | |
from email.message import EmailMessage | |
email = EmailMessage() | |
email['Subject'] = 'Test email' | |
email['From'] = '[email protected]' | |
email['To'] = '[email protected]' |
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 unittest import TestCase | |
from typing import List | |
def has_mixed_types(list_: List): | |
first = type(list_[0]) | |
return any(not isinstance(t, first) for t in list_) | |
def reverse_list(original: List) -> List: | |
if has_mixed_types(original): | |
raise ValueError("The list to be reversed should have homogeneous types.") |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Personal finance</title> | |
<link rel="stylesheet" href="./style.css" /> | |
</head> | |
<body> | |
<h1>Add transaction</h1> | |
<form> |
OlderNewer