#Compilng You need g++ 4.9 to compile this code. Follow these steps to install g++-4.9
After installing run the following command to compile
/usr/bin/g++-4.9 -std=c++11 lambda.cpp
#Running
./a.out
| import sys | |
| import email | |
| import dateutil.parser | |
| import sqlite3 | |
| mail = sys.stdin.read() | |
| msg = email.message_from_string(mail) | |
| datetime = dateutil.parser.parse(msg["DATE"]) | |
| thedata = { | |
| "subject" : msg["SUBJECT"], |
| import urllib.request | |
| filename, headers = urllib.request.urlretrieve('http://api.icndb.com/jokes/random') | |
| response = open(filename) | |
| json = eval(response.read()) | |
| print(json['value']['joke']) |
| #My opening explanation | |
| print(""" | |
| Welcome to the Green Room. Where you can have | |
| coffee but not tea, a muffin but not cake, and | |
| pet a giraffe but not a cat. | |
| Please ask me about an object and I'll tell you | |
| if it is allowed. Tell me "quit" to stop the game. | |
| You'll have to decide for yourself when you've won. | |
| """) |
| birthday = input('What is your birthday (yyyy/mm/dd)? ') | |
| print("You entered:",birthday) |
| x = 2 * (4 + 12) | |
| y = x + 8 | |
| z = y * y | |
| w = "hi" | |
| u = w * 3 | |
| print(x,y,z,w,u) |
| #include<iostream> | |
| std::string prompt_user(std::string input_prompt){ | |
| std::string reply; | |
| std::cout << input_prompt << std::endl; | |
| //std::getline(std::cin, reply); | |
| std::cin >> reply; | |
| return reply; | |
| }; |
| #include<iostream> | |
| using namespace std; | |
| string prompt_user(string input_prompt){ | |
| string reply; | |
| cout << input_prompt << endl; | |
| cin >> reply; //only use one of these two lines. | |
| //getline(cin, reply); | |
| return reply; | |
| }; |
#Compilng You need g++ 4.9 to compile this code. Follow these steps to install g++-4.9
After installing run the following command to compile
/usr/bin/g++-4.9 -std=c++11 lambda.cpp
#Running
./a.out
| var mongoose = require('mongoose') | |
| , Schema = mongoose.Schema | |
| var personSchema = Schema({ | |
| _id : Number, | |
| name : String, | |
| age : Number, | |
| stories : [{ type: Schema.Types.ObjectId, ref: 'Story' }] | |
| }); |
| var mongoose = require('mongoose'); | |
| mongoose.connect('mongodb://localhost/schematest'); | |
| var animalSchema = new mongoose.Schema({ | |
| type: {type: String, required: true}, | |
| age: Number, | |
| lastInspected: {type: Date, default: Date.now}, | |
| name: {type: String, required: false} | |
| }); |