Giter Site home page Giter Site logo

akalenuk / wordsandbuttons Goto Github PK

View Code? Open in Web Editor NEW
478.0 28.0 18.0 31.3 MB

A growing collection of interactive tutorials, demos, and quizzes about maths, algorithms, and programming.

Home Page: https://wordsandbuttons.online

License: The Unlicense

C++ 2.99% HTML 85.29% Makefile 0.43% Python 1.74% C 0.64% Assembly 8.55% Rust 0.24% Cuda 0.11%
interactive-visualizations interactive-tutorials mathematics algorithms quizzes vanilla-js computational-geometry

wordsandbuttons's Introduction

Words and Buttons Online

This is the source code for Words and Buttons Online — a collection of interactive tutorials, guides, and quizzes about maths, algorithms, and programming.

All the code is licensed under The Unlicense.

Tags

#algorithms #demos #mathematics #programming #quizzes #tutorials

Pages

See also

wordsandbuttons's People

Contributors

akalenuk avatar nminhnguyen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wordsandbuttons's Issues

Question 4 on "So you think you know C"

The explanation for why 4 is undefined is technically correct (it's undefined behavior therefore undefined results), but even with UB I can't think of any implementation where the value wouldn't be 1. Even if int is 16 bits and there's some particularly weird implementation detail of how overshifting is handled on the architecture, any 16-bit integer shifted right by 16 bits will be either 0 or -1, and in both cases those would make the final result 1. What am I missing? Does C's specification allow for an implementation to have a NaN-type integer value that compares to NaN with other integers?

Numeric input box

http://wordsandbuttons.online/interactive_guide_to_homogeneous_coordinates.html is cool!

Minor suggestion for the “Please enter w_h” input box:

  • take the box out of so that pressing enter doesn't cause the page to reload
  • or even better, make pressing Enter update the value
  • or it might even be feasible to update the value on each keystroke
  • or maybe set type=number so that the browser will provide up/down arrows to change it
  • or maybe use something like Tangle (I have my own implementation using d3 here)

some comments on "How much math can you do in 10 lines of Python"

I have realized that your code examples use in fact some Python 2.x functions:
xrange() and print (without parentheses).
.
Also, I suspect that python doesn't have a tuple comprehension.
It seems to me that the code that produces a tuple in your example:
tuple(2*v for v in (1.0, 4.0, 3.0))
uses in fact a generator comprehension.
Which can be also used here: sum(i for i in range(5)) # returns: 10
Because both functions accept iterables as arguments, and since generator is iterable, it goes through it.
.
Anyway, I like the website!
Thank you.

interactive_guide_to_homogeneous_coordinates.html - matrix is transposed

I think your transformation matrix is transposed:

What's happening when we multiply a square matrix to a point in homogeneous coordinates?














[ A D a
B E b
C F c
][ x
y
w
] = [ Ax + By + Cw
Dx + Ey + Fw
ax + by + cw
]

Should be:
What's happening when we multiply a square matrix to a point in homogeneous coordinates?














[ A B C
D E F
a b c
][ x
y
w
] = [ Ax + By + Cw
Dx + Ey + Fw
ax + by + cw
]

Really like what you have done BTW.

Unreadable font colours

The inline stylesheet sets background-color for certain elements but not the color for the text overlaid on them leading to poor contrast and other unreadability.

replace <a/> with </a>

this invalid html would be detected by a linter

$ tidy the_real_cpp_killers.html >/dev/null
line 113 column 200 - Warning: missing </a> before <a>
line 478 column 389 - Warning: missing </a> before <a>

But the most interesting piece of code is the third one. It’s ForwardCom – an assembler Agner Fog, a renowned author of C++ and assembly optimization manuals, proposes. Just as with Web Assembly, the proposition covers not so much an assembler as the universal set of instructions designed to enable not only backward but forward compatibility. Hence the name. ForwardCom’s full name is “<a href="https://www.forwardcom.info">an open forward-compatible instruction set architecture.<a/>” In other words, it’s not so much a proposition of assembly, as a peace treaty proposal.

"main()" should be "int main(void)" and other quibbles

For all five examples in so_you_think_you_know_c.html, main() should be int main(void).

In C90 (which is 19 years old and has been replaced by two later editions), a function definition with empty parentheses is an obsolescent feature.

In C99 and later, the "implicit int" rule was dropped, and omitting an explicit return type from a function definition is invalid (I think it's a syntax error, or it might be a constraint violation).

On to other quibbles:

In the second example, the relative sizes of short int and int are not guaranteed, only that the range of int includes at least the range of short int. In the presence of padding bits, a conforming implementation could have sizeof (short int) > sizeof (int). The implementation-defined signedness of plain char is also relevant; it's possible to have sizeof (int) == 1 and CHAR_MAX > INT_MAX (if plain char is unsigned and CHAR_BIT is at least 16).

In the third example, the numeric value of ' ' is implementation-defined (and you used LEFT SINGLE QUOTATION MARK characters rather than apostrophes for the character constant).

In the fifth example, the operator precedence of the ++ operator is well defined. Only the order of evaluation is unspecified. The description could imply that the possible results are limited to the possible orders of evaluation, but in fact the behavior is completely undefined; in principle, evaluating i++ + ++i could make demons fly out of your nose. (Of course that can't happen, but if it did it would not violate the C standard.)

Point being dragged swaps when passing over another point.

I was playing with the interactive plots from "Bi-whatever transformations", trying to add a twist by dragging points. One odd behavior I noticed occurred when dragging one point directly over another: the point being dragged would switch to the other point! I could go back and forth this way, never able to get the points to go past each other, unless I went around and avoided the collision.

I suspect the drag logic lacks enough statefulness to "cling" to the point initially grabbed, but looking at biwhatever_transformations.html I wasn't able to quickly identify where it was missing, or where it should go.

Could it be a feature-not-a-bug? ;^)

Edit: We've chatted before (about languages), where I went by BobC.

Don't block Tor

Going to https://wordsandbuttons.online/ using Tor gives me this error: "Access denied. Your IP address is blacklisted. If you feel this is in error please contact your hosting provider's abuse department." It would be good to whitelist Tor

RSS invalid mimetype

The RSS from the website doesn't work.
https://wordsandbuttons.online/rss

My RSS app can't detect it.

Not parsing document with invalid RSS/Atom mimetype: null/null

But, the file from this repository works instead.
https://raw.githubusercontent.com/akalenuk/wordsandbuttons/master/pages/rss

[Question] How did you build your website? Pure html?

Your pages have

tags that are one-liners so I don't think a page editor was used, and I don't think this shows signs of a JAM stack like Hugo.

Asking because I like how it was written - it looks simple to maintain. And effective, so I wanted to model yours for my blog.

Thanks in advance.

Support touch events

In the past if you wanted to support touch events for tablet/phone/windows10 you would have to implement a separate set of events, sometimes different per browser. But now we have pointer events, and it looks like it's relatively easy to support and widely supported.

I take https://wordsandbuttons.online/lagrange_polynomial_as_a_gateway_drug_to_basis_splines.html as an example page.

  1. Change mousemove to pointermove, mousedown to pointerdown, mouseleave to pointerleave. The pointer events support both mouse and touch so it will continue working with mouse.
  2. Add CSS canvas { touch-action: none; } to disable the browser's default touch-drag handlers (like dragging an image, or scrolling the page). This will not affect mouse users.
  3. Add either i_canvas.setPointerCapture(e.pointerId) or i_canvas.releasePointerCapture(e.pointerId) inside the pointerdown event handler. This tells the browser to either hold on to the drag until you let go, or to release it when you leave the canvas. It looks like for this page you want to release it.

With these three changes, your page will work with touch events.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.