Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.
CS183: Startup—Notes Essay—The Challenge of the Future
Purpose and Preamble
| import sys, os, shutil | |
| def generateClass(directory, classNumber, methodsPerClass, mainPackage): | |
| className = "Foo" + str(classNumber) | |
| filePath = os.path.join(directory, className + ".java") | |
| with open(filePath,"w+") as f: | |
| f.write("package " + mainPackage + "." + directory + ";\n") | |
| f.write("public class " + className + " {\n") | |
| for i in xrange(0, methodsPerClass): | |
| f.write("public void foo" + str(i) + "(){\n") |
| <div class="navbar navbar-inverse navbar-fixed-top"> | |
| <div class="container"> | |
| <div class="navbar-header"> | |
| <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> | |
| <span class="icon-bar"></span> | |
| <span class="icon-bar"></span> | |
| <span class="icon-bar"></span> | |
| </button> | |
| <a class="navbar-brand" href="/">Brand</a> | |
| </div> |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>New Sails App</title> | |
| <!-- Viewport mobile tag for sensible mobile support --> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | |
| <!-- |
| <form action="/session/create" method="POST" class="form-signin"> | |
| <h2 class="form-signin-heading">Please sign in</h2> | |
| <% if (flash && flash.err) { %> | |
| <ul class="alert alert-success"> | |
| <% Object.keys(flash.err).forEach(function(error) { %> | |
| <li><%- JSON.stringify(flash.err[error]) %></li> | |
| <% }) %> | |
| </ul> | |
| <% } %> |
| /** | |
| * SessionController | |
| * | |
| * @description :: Server-side logic for managing sessions | |
| * @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers | |
| */ | |
| module.exports = { | |
| 'new': function(req, res) { | |
| req.session.authenticated = true; |
| <div class="container"> | |
| <h3>User Administration</h3> | |
| <table class='table'> | |
| <tr> | |
| <th></th> | |
| <th>ID</th> | |
| <th>Username</th> | |
| <th>Title</th> | |
| <th>Email</th> | |
| <th></th> |
Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.
CS183: Startup—Notes Essay—The Challenge of the Future
Purpose and Preamble
| <form action="/user/update/<%= user.id %>" method="POST" class="form-signin"> | |
| <h2> Hey, you're editing a user... </h2> | |
| <input value="<%= user.username %>" name="username" type="text" class="form-control"/> | |
| <input value="<%= user.title %>" name="title" type="text" class="form-control"/> | |
| <input value="<%= user.email %>" name="email" type="text" class="form-control"/> | |
| <input type="submit" value="Proceed" class="btn btn-lg btn-primary btn-block"/> | |
| <input type="hidden" name="_csrf" value="<%= _csrf %>" /> | |
| </form> |
| <div class="container"> | |
| <h3>User Administration</h3> | |
| <table class='table'> | |
| <tr> | |
| <th></th> | |
| <th>ID</th> | |
| <th>Username</th> | |
| <th>Title</th> | |
| <th>Email</th> | |
| <th></th> |
| <div class='container'> | |
| <h1><%= user.username %> </h1> | |
| <% if (user.admin) { %> | |
| <i class="fa fa-user-plus"></i>admin | |
| <% } else { %> | |
| <i class="fa fa-user"></i>user | |
| <% } %> | |
| <h3><%= user.title %> </h3> | |
| <hr> | |
| <h3>contact: <%= user.email %> </h3> |