Merge branch 'master' of https://github.com/aarongut/cdb into mplamann
3
.gitignore
vendored
@@ -35,3 +35,6 @@ node_modules
|
||||
#nodejs things
|
||||
node_modules
|
||||
npm-debug.log
|
||||
|
||||
#vim swap files
|
||||
*.swp
|
||||
|
||||
BIN
instructions/adding-labels-cropped.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
instructions/adding-labels.png
Normal file
|
After Width: | Height: | Size: 839 KiB |
BIN
instructions/assign-to-developer-cropped.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
instructions/assign-to-developer.png
Normal file
|
After Width: | Height: | Size: 848 KiB |
BIN
instructions/clickin-new-issue-cropped.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
instructions/clickin-new-issue.png
Normal file
|
After Width: | Height: | Size: 793 KiB |
BIN
instructions/finding-issues-page-cropped.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
instructions/finding-issues-page.png
Normal file
|
After Width: | Height: | Size: 836 KiB |
BIN
instructions/image-1.png
Normal file
|
After Width: | Height: | Size: 145 KiB |
BIN
instructions/image-2.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
instructions/image-3.png
Normal file
|
After Width: | Height: | Size: 107 KiB |
BIN
instructions/image-4.png
Normal file
|
After Width: | Height: | Size: 130 KiB |
BIN
instructions/image-5.png
Normal file
|
After Width: | Height: | Size: 109 KiB |
BIN
instructions/image-6.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
instructions/instr.pdf
Normal file
160
instructions/instr.tex
Normal file
@@ -0,0 +1,160 @@
|
||||
\documentclass[11pt]{article}
|
||||
|
||||
\usepackage{graphicx}
|
||||
|
||||
\oddsidemargin0cm
|
||||
\topmargin-3cm
|
||||
\textwidth16.0cm
|
||||
\textheight24.5cm
|
||||
|
||||
\newcommand{\step}[2] {\vspace{.25in} \hrule\vspace{0.5em}
|
||||
\noindent{\bf Step #1: #2} \vspace{0.5em}
|
||||
\hrule \vspace{.10in}}
|
||||
|
||||
\begin{document}
|
||||
\thispagestyle{empty}
|
||||
|
||||
\noindent Aaron Gutierrez \& Mitchell Plamann\hfill{15-221}\\
|
||||
amgutier@andrew.cmu.edu \& mplamann@andrew.cmu.edu \hfill{Spring 2015}\\
|
||||
Section A \hfill{Team 9}
|
||||
|
||||
\vspace{\fill}
|
||||
\begin{center}
|
||||
Writing Assignment 3
|
||||
Instructions
|
||||
|
||||
\today
|
||||
\end{center}
|
||||
\vspace{\fill}
|
||||
|
||||
\newpage
|
||||
|
||||
\pagenumbering{arabic}
|
||||
\begin{center}
|
||||
{\Huge Creating and Closing GitHub Issues}
|
||||
\end{center}
|
||||
\section{Overview}
|
||||
GitHub provides a great tool for multi-user collaboration on software projects.
|
||||
On top of the version control features, GitHub offers sophisticated issue
|
||||
tracking integrated right in with all of your repositories. Tracking issues
|
||||
makes it easy to keep track of bugs, new feature ideas, and feedback from
|
||||
testers, all of which help keep your project organized. In the next five
|
||||
steps, you will learn how to create a new issues, assign an issue to a
|
||||
contributor, and mark an issue as resolved.
|
||||
|
||||
This tutorial is for GitHub users who know how to create and use repositories,
|
||||
but are unfamiliar with GitHub's issue tracking features. You need to have an
|
||||
existing GitHub repository, a web browser, and a git client on your computer.
|
||||
Once you're done, you'll be able add, manage, and close issues for every project
|
||||
you have on GitHub.
|
||||
|
||||
\section{Steps}
|
||||
|
||||
\step{1}{Open your repository's Issues page}
|
||||
{\bf In this step, you will access the Issues page for your repository.}
|
||||
|
||||
\begin{enumerate}
|
||||
\item Open your GitHub repository in your web browser.
|
||||
\item Click ``Issues'' (Fig \ref{fig:issues_button})
|
||||
\item You should now see the ``Issues'' page, which you will use in Step 2.
|
||||
\end{enumerate}
|
||||
|
||||
\begin{figure}[h]
|
||||
\includegraphics[width=\linewidth]{finding-issues-page-cropped.png}
|
||||
\caption{Opening the Issues page}
|
||||
\label{fig:issues_button}
|
||||
\end{figure}
|
||||
|
||||
\pagebreak
|
||||
|
||||
\step{2}{Create an issue}
|
||||
{\bf In this step, you will create a new issue associated with your repository and
|
||||
fill in necessary information}
|
||||
|
||||
\begin{enumerate}
|
||||
\item Click the ``New Issue'' button (Fig \ref{fig:new_issue})
|
||||
\item Enter in a title for the issue (1, Fig \ref{fig:issue_info})
|
||||
\item Enter in a description for the issue (2, Fig \ref{fig:issue_info})
|
||||
\item Click ``Submit new issue'' (3, Fig \ref{fig:issue_info})
|
||||
\item Continue to step 3, where you will add a label to your newly-created issue.
|
||||
\end{enumerate}
|
||||
|
||||
\begin{figure}[h]
|
||||
\includegraphics[width=\textwidth]{clickin-new-issue-cropped.png}
|
||||
\caption{Creating a new issue}
|
||||
\label{fig:new_issue}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[h]
|
||||
\includegraphics[width=\textwidth]{new-issue-info-cropped.png}
|
||||
\caption{Entering issue information}
|
||||
\label{fig:issue_info}
|
||||
\end{figure}
|
||||
|
||||
\pagebreak
|
||||
|
||||
\step{3}{Assign labels to an issue}
|
||||
{\bf In this step, you will label your issue, indicating what type of issue it is.}
|
||||
|
||||
\begin{enumerate}
|
||||
\item Click the ``Labels'' button (1, Fig \ref{fig:labels})
|
||||
\item Click each label that applies to your issue (2, Fig \ref{fig:labels})
|
||||
\item Click the X button (3, Fig \ref{fig:labels})
|
||||
\item In step 4, you will assign this issue to a developer.
|
||||
\end{enumerate}
|
||||
|
||||
\begin{figure}[h]
|
||||
\includegraphics[width=\textwidth]{adding-labels-cropped.png}
|
||||
\caption{Adding labels to an issue}
|
||||
\label{fig:labels}
|
||||
\end{figure}
|
||||
|
||||
\pagebreak
|
||||
|
||||
\step{4}{Assign an issue to a developer}
|
||||
{\bf In this step, you will assign this issue to a developer who will fix the issue.}
|
||||
|
||||
\begin{enumerate}
|
||||
\item Click the ``Assignee'' button (1, Fig \ref{fig:assign})
|
||||
\item Click the name of the developer who will fix the issue (2, Fig \ref{fig:assign})
|
||||
\item At this point, the issue has been assigned to the deveoper.
|
||||
Once the developer has fixed the issue, proceed to step 5 to mark the issue as resolved.
|
||||
\end{enumerate}
|
||||
|
||||
\begin{figure}[h]
|
||||
\includegraphics[width=\textwidth]{assign-to-developer-cropped.png}
|
||||
\caption{Assigning an issue to a developer}
|
||||
\label{fig:assign}
|
||||
\end{figure}
|
||||
|
||||
\pagebreak
|
||||
|
||||
\step{5}{Marking an issue as resolved}
|
||||
{\bf In this step, you will mark the issue as resolved,
|
||||
indicating that the developer assigned to the issue has fixed it.}
|
||||
|
||||
\begin{enumerate}
|
||||
\item On the issue web page, you can see the issue number.
|
||||
For our example, it is \#3 (Fig \ref{fig:issue_number}).
|
||||
\item Using your git client on your computer, make a commit as you normally
|
||||
would including the changes that fix the issue. In the commit message,
|
||||
include the text ``Resolves \#{\it N}'', replacing {\it N} with your issue number. In
|
||||
the example issue, the commit message would be ``Resolves \#3''.
|
||||
\item GitHub detects this commit and marks the issue as closed (Fig \ref{fig:resolved}).
|
||||
At this point, you have successfully created a GitHub issue, fixed the problem in the repository,
|
||||
and marked the issue as resolved.
|
||||
\end{enumerate}
|
||||
|
||||
\begin{figure}[h]
|
||||
\includegraphics[width=\textwidth]{issue-number-cropped.png}
|
||||
\caption{Finding the issue number}
|
||||
\label{fig:issue_number}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[h]
|
||||
\includegraphics[width=\textwidth]{issue-resolved-cropped.png}
|
||||
\caption{The issue has been resolved}
|
||||
\label{fig:resolved}
|
||||
\end{figure}
|
||||
|
||||
\end{document}
|
||||
BIN
instructions/issue-has-been-assigned-cropped.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
instructions/issue-has-been-assigned.png
Normal file
|
After Width: | Height: | Size: 844 KiB |
BIN
instructions/issue-number-cropped.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
instructions/issue-resolved-cropped.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
instructions/issue-resolved.png
Normal file
|
After Width: | Height: | Size: 858 KiB |
BIN
instructions/label-has-been-added-cropped.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
instructions/label-has-been-added.png
Normal file
|
After Width: | Height: | Size: 840 KiB |
BIN
instructions/new-issue-info-cropped.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
instructions/new-issue-info.png
Normal file
|
After Width: | Height: | Size: 795 KiB |
@@ -28,5 +28,5 @@ nav {
|
||||
}
|
||||
|
||||
.btm-btn {
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ ByteStream.prototype.get_u4 = function() {
|
||||
ByteStream.prototype.get_i4 = function() {
|
||||
var unsigned_val = this.get_u4();
|
||||
var sign_mult = (unsigned_val & 0x80000000) ? -1 : 1;
|
||||
return (unsigned_val & 0x7FFFFFFF) * sign_mult;
|
||||
return (unsigned_val & 0x7FFFFFFF) + (unsigned_val & 0x80000000);
|
||||
}
|
||||
|
||||
ByteStream.prototype.get_bytes = function(n) {
|
||||
|
||||
@@ -72,10 +72,11 @@ var Bc0File = function (filename) {
|
||||
for (var i = 0; i < this.string_count; i++) {
|
||||
var c = stream.get_u1();
|
||||
if (c == 0) {
|
||||
this.string_pool.push(current_string);
|
||||
current_string = "";
|
||||
// this.string_pool.push(current_string);
|
||||
// current_string = "";
|
||||
this.string_pool.push(0);
|
||||
} else {
|
||||
current_string += String.fromCharCode(c);
|
||||
this.string_pool.push(String.fromCharCode(c));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +94,15 @@ var Bc0File = function (filename) {
|
||||
}
|
||||
}
|
||||
|
||||
Bc0File.prototype.string_from_index = function (i) {
|
||||
var result = "";
|
||||
while (this.string_pool[i] !== 0 && i < this.string_pool.length) {
|
||||
result += this.string_pool[i];
|
||||
i++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function parse(filename) {
|
||||
return new Bc0File(filename);
|
||||
}
|
||||
|
||||
28
src/c0vm.js
@@ -16,6 +16,13 @@ function c0_memory_error(val) {
|
||||
throw ("c0 memory error: " + val);
|
||||
}
|
||||
|
||||
function num_to_i32(num) {
|
||||
log("num is 0x" + num.toString(16));
|
||||
log("num & 0x7FFFFFFF is " + (num & 0x7FFFFFFF));
|
||||
log("neg factor is " + ( (num & 0x80000000)));
|
||||
return (num & 0x7FFFFFFF) + ((num & 0x80000000));
|
||||
}
|
||||
|
||||
function i32_to_array(i32) {
|
||||
return [(i32 & 0xFF),
|
||||
((i32 >> 8) & 0xFF),
|
||||
@@ -154,19 +161,20 @@ ProgramState.prototype.step = function() {
|
||||
var y = this.pop();
|
||||
var x = this.pop();
|
||||
log("Adding " + x + " and " + y);
|
||||
this.push((x+y) % 0x100000000);
|
||||
this.push(num_to_i32(x+y));
|
||||
break;
|
||||
case op.ISUB:
|
||||
this.frame.pc++;
|
||||
var y = this.pop();
|
||||
var x = this.pop();
|
||||
this.push((x-y) % 0x100000000);
|
||||
log("Subtracting " + x + " and " + y);
|
||||
this.push(num_to_i32(x-y));
|
||||
break;
|
||||
case op.IMUL:
|
||||
this.frame.pc++;
|
||||
var y = this.pop();
|
||||
var x = this.pop();
|
||||
this.push((x*y) % 0x100000000);
|
||||
this.push(num_to_i32(x*y));
|
||||
break;
|
||||
case op.IDIV:
|
||||
this.frame.pc++;
|
||||
@@ -231,7 +239,9 @@ ProgramState.prototype.step = function() {
|
||||
case op.VSTORE:
|
||||
this.frame.pc += 2;
|
||||
var index = this.frame.program[this.frame.pc-1];
|
||||
this.frame.variables[index] = this.pop();
|
||||
var val = this.pop();
|
||||
this.frame.variables[index] = val;
|
||||
log("Set variable " + index + " to value " + val);
|
||||
break;
|
||||
case op.ACONST_NULL:
|
||||
this.frame.pc++;
|
||||
@@ -251,7 +261,7 @@ ProgramState.prototype.step = function() {
|
||||
var c2 = this.frame.program[this.frame.pc-1];
|
||||
var index = (c1 * 0x1000) + c2;
|
||||
|
||||
this.push(this.file.string_pool[index]);
|
||||
this.push(this.file.string_from_index(index));
|
||||
break;
|
||||
|
||||
// Control flow
|
||||
@@ -330,6 +340,8 @@ ProgramState.prototype.step = function() {
|
||||
};
|
||||
console.log("Unknown native function index " + f.function_table_index);
|
||||
}
|
||||
log("Calling native function with index " + index + " with arguments " +
|
||||
arg_array);
|
||||
this.push(native_function(arg_array));
|
||||
break;
|
||||
|
||||
@@ -385,7 +397,7 @@ ProgramState.prototype.step = function() {
|
||||
var array_length = this.heap[index];
|
||||
var elt_size = this.heap[index+1];
|
||||
if (elt_index >= array_length) c0_memory_error("Array index out of bounds.");
|
||||
this.push(this.heap[index + 2 + elt_size*elt_index]);
|
||||
this.push(index + 2 + (elt_size*elt_index));
|
||||
this.frame.pc++;
|
||||
break;
|
||||
|
||||
@@ -457,6 +469,8 @@ function execute(file, callbacks, v) {
|
||||
|
||||
var state = new ProgramState(file, callbacks);
|
||||
|
||||
if (verbose) log(file);
|
||||
|
||||
log("Beginning execution");
|
||||
|
||||
while (true) {
|
||||
@@ -469,7 +483,7 @@ function execute(file, callbacks, v) {
|
||||
console.log(" Stack: " + state.frame.stack);
|
||||
console.log(" PC: " + state.frame.pc);
|
||||
console.log(" Vars: " + state.frame.variables);
|
||||
console.log(" Code: " + state.frame.program);
|
||||
// console.log(" Code: " + state.frame.program);
|
||||
console.log(" Heap: " + state.heap);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,5 +48,5 @@ B0 # return #
|
||||
|
||||
00 01 # native count
|
||||
# native pool
|
||||
00 01 00 09 # printint
|
||||
00 01 00 10 # printint
|
||||
|
||||
|
||||
@@ -7,14 +7,17 @@ var printout = "";
|
||||
|
||||
callbacks[c0ffi.NATIVE_PRINT] = function(args) {
|
||||
printout += args[0];
|
||||
return 0;
|
||||
}
|
||||
|
||||
callbacks[c0ffi.NATIVE_PRINTINT] = function(args) {
|
||||
printout += args[0];
|
||||
return 0;
|
||||
}
|
||||
|
||||
callbacks[c0ffi.NATIVE_PRINTLN] = function(args) {
|
||||
printout += (args[0] + "\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
function doTest(filename, expected_result) {
|
||||
@@ -57,11 +60,20 @@ exports.testDSQUARED = doTest("dsquared.c0.bc0", 17068);
|
||||
|
||||
exports.testArrays = function(test) {
|
||||
test.throws(function () {
|
||||
c0vm.execute(parser.parse("arrays.c0.bc0"), callbacks, true)
|
||||
c0vm.execute(parser.parse("arrays.c0.bc0"), callbacks, false)
|
||||
});
|
||||
test.done();
|
||||
}
|
||||
|
||||
exports.testMoreArray = function(test) {
|
||||
printout = "";
|
||||
var result = c0vm.execute(parser.parse("moreArrays.c0.bc0"), callbacks, false);
|
||||
test.ok(printout == "2312",
|
||||
"moreArrays.c0.bc0 - Did not print to screen correctly, result was " +
|
||||
printout);
|
||||
test.done();
|
||||
}
|
||||
|
||||
exports.testStructs = function(test) {
|
||||
printout = "";
|
||||
var result = c0vm.execute(parser.parse("structs.c0.bc0"), callbacks, false);
|
||||
@@ -71,3 +83,18 @@ exports.testStructs = function(test) {
|
||||
test.done();
|
||||
}
|
||||
|
||||
exports.testAbort = function(test) {
|
||||
test.throws(function () {
|
||||
c0vm.execute(parser.parse("abort.c0.bc0"), callbacks, false);
|
||||
});
|
||||
test.done();
|
||||
}
|
||||
|
||||
exports.testArith = function(test) {
|
||||
printout = "";
|
||||
var result = c0vm.execute(parser.parse("arith.c0.bc0"), callbacks, false);
|
||||
test.ok(printout == "-2147483648 2147483647 -375 -2147483648 -9 -1 12 \n-12 12 Modulus testing 11-1 5 1 Testing constants -251 Testing inequalities \ny1 y2 y3 n4 n5 n6 y7 Testing bitwise operators \n992000 1045310 53250 -12083 Testing bit shifting\n-2147483648 736 0 588088 -31 -19 \n0\n",
|
||||
"arith.c0.bc0 - Did not print to screen correctly, result was " +
|
||||
printout);
|
||||
test.done();
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ block body
|
||||
form
|
||||
.form-group
|
||||
label(for="inputCode") Code
|
||||
button(onclick="compile()" type="button").btn.btn-default.btm-btn.pull-right Compile
|
||||
#codearea
|
||||
textarea.code.formControl.sh_c(rows="12" id="inputCode")
|
||||
button(onclick="compile()" type="button").btn.btn-default.btm-btn.pull-right Compile
|
||||
|
||||
.col-md-6
|
||||
p.lbl.
|
||||
|
||||