alanclasses / tsos Goto Github PK
View Code? Open in Web Editor NEW2015 to 2018 Operating Systems
2015 to 2018 Operating Systems
This would include removing the outdated namespace
keyword.
• Add a shell command to test this. Remember to include it in the help
This is taken from source/os/canvastext.ts
The total var seems to be the length of the string in terms of width. But... it never gets changed anywhere after initiating. Then at the bottom it just returns 0.
public static draw(ctx, font, size, x, y, str) {
var total = 0;
var len = str.length;
var mag = size / 25.0;
ctx.save();
ctx.lineCap = "round";
ctx.lineWidth = 2.0 * mag;
ctx.strokeStyle = "black";
for (var i = 0; i < len; i++) {
var c = CanvasTextFunctions.letter(str.charAt(i));
if (!c) {
continue;
}
ctx.beginPath();
var penUp = true;
var needStroke = 0;
for (var j = 0; j < c.points.length; j++) {
var a = c.points[j];
if (a[0] === -1 && a[1] === -1) {
penUp = true;
continue;
}
if (penUp) {
ctx.moveTo( x + a[0]*mag, y - a[1]*mag);
penUp = false;
} else {
ctx.lineTo( x + a[0]*mag, y - a[1]*mag);
}
}
ctx.stroke();
x += c.width*mag;
}
ctx.restore();
return total;
}
Mozilla developer network has marked KeyboardEvent.which
to be deprecated and nonstandard, even though most browsers have implemented it (albeit in an non-unified fashion).
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/which
Considerations:
keyCode
and charCode
are also both deprecated, with inconsistent browser support.key
is current and standard, however it does all the work that we're doing to take into account shift, locale, etc.keyIdentifier
seems to be a highly unimplemented and nonstandard stunt pulled by Safari (the only one to possibly implement it).code
might be a correct alternative. It represents which button on a device is pressed, without any consideration for what character that button is supposed to generate. This might be low level enough to keep student struggles aloft, but standard enough to work consistently in many browsers.• Accept and display punctuation characters and symbols.
• Handle backspace appropriately.
• Implement command completion with the tab key.
• Provide command history recall via the up and down arrow keys.
the current date and time
• status messages as speciDied by the user with a new shell command:
status
example: status i love opera*ng systems
date - displays the current date and time
whereami - displays the users current location (use your imagination)
something else interesting and creative; surprise me
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.