paulbrownmagic / lpn Goto Github PK
View Code? Open in Web Editor NEWThis project forked from learnprolognow/lpn
Learn Prolog Now LaTeX sources
License: Other
This project forked from learnprolognow/lpn
Learn Prolog Now LaTeX sources
License: Other
Instead of:
Lines 1 to 3 in 09a818b
is preferable to write:
:- initialization((
logtalk_load('chapters/chapters'),
logtalk_load('chapters/chapter1/chapter1'),
logtalk_load('chapters/chapter2/chapter2')
)).
or:
:- initialization(
logtalk_load([
'chapters/chapters',
'chapters/chapter1/chapter1',
'chapters/chapter2/chapter2'
])
).
I'm translating chapter 3 of learn prolog now. It has several images, how can i add them into the code?
P.s. as soon as i finish a will push a PR.
The random_id/1
predicate defined as:
lpn/www/html_components/code_components.pl
Lines 25 to 29 in 06e897a
can be rewritten for better performance as:
random_id(ID) :-
length(Codes, 12),
maplist(random_between(97, 122), Codes),
atom_codes(ID, Codes).
The children/2
predicate is currently defined as:
lpn/www/html_components/page_components.pl
Lines 47 to 50 in 06e897a
The downside of this definition is that the call to the current_object/1
built-in predicate will enumerate all loaded objects. If the objects actually implementing the children/1
predicate are redefined to implement a marker protocol, then the children/2
predicate definition could be simplified to:
children(N, Children) :-
implements_protocol(N, marker_protocol),
% or, if the object inherits the protocol from an ancestor
% conforms_to_protocol(N, marker_protocol),
N::children(Children).
This simplified version does assume that there will be no categories implementing the protocol.
In Quiz '2.3.4' it would be nice to have a drag and drop sortable list with a bin for results that aren't returned. This could be achieved using a jQuery library like sortable, or a HTML5 alternative.
It's likely that this will be useful with non-ordered things too, it could provide a nice alternative to MCQ's.
To do this will require a new subclass of question_quiz
in /www/book/quizzes.pl
, and a new JavaScript and optional Tau-Prolog auto-marker.
The init/0
predicate currently defined as:
Lines 6 to 8 in 09a818b
can be rewritten for better performance as:
init :-
forall(get_by_type(radio, Input), bind_click(Input)).
For quizzes such as 2.3.7 it would be nice to have an in-built editor. This would be a multi-step project.
It would also be useful to provide an example solution tab. When we integrate user accounts, we could also store a user's code for them, alternatively, we could hand this off to SWISH if we don't have user accounts.
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.