05 Oct 2015
Various algorithms are used.
Particularly of note are Chronological Backtracking, the algorithm for which is on the slides.
Backtracking works on the principle of making assumptions for each variable constrained and seeing whether the constraints are fulfilled.
If the network fails the constraints, the last variable to be assigned a value is moved to the next value in its possibility space.
If there are no values in the possibility space that fulfil the constraints for the variable currently looked at, the algorithm backtracks and moves to the second last variable edited and moves to the next value in its possibility space.
Because the search will go through all possibilities unless they are verified not to work, the search will always find a solution if one exists.
We call searches that are guarenteed to find a solution if one exists complete searches.
This search can be visualised as a tree, where each level of the tree is another variable.
If the variables are assumed to be on a stack, and are placed on a stack when they are given a possibly-valid value, then each layer of the tree would be the variables as they are added to the stack.
Note that varibles are always added to the stack in the same order.
Another way to visualise this is to view the search as a graph, of past variables with instantiated variables, current variable with a vaue being checked for validity (just-assigned value), and a set of future varaibles that are waiting for values to be assigned.
A problem with this is thrashing, where the system will make many changes and backtrack lots, if the vairable that needs changing is far back in the stack. This happens because the algorithm will check every value in the possibility space of each variable after that problematic variable in the stack.
So other people can use and share the resource, and to avoid redundant effort maintaining multiple sites, throw a pull request into the gu-cs-notes.github.io repo.
14 May 2015
BlackDoc is a two-column Jekyll theme that's ideal for websites that require a master-detail layout for viewing of content. It's based on Poole, the Jekyll butler, and the Hyde theme.
I needed a two-column layout with a scrolling sidebar to publish my code cheatsheets, and found the Hyde Jekyll theme to be a good starting theme. To complement the color scheme of my main website, I customised the theme to make it look great in black background and changed the sidebar to display scrolling content. I created this theme because I can't seem to find any good Jekyll theme with a master-detail layout. Hopefully, someone will find this useful as well in their own projects.
Built on Poole
Poole is the Jekyll Butler, serving as a foundation for creating Jekyll themes. Poole-based themes, such as BlackDoc here, include the following:
- Complete Jekyll setup included (layouts, config, 404, RSS feed, posts, and example page)
- Mobile friendly design and development
- Easily scalable text and component sizing with
rem
units in the CSS
- Support for a wide gamut of HTML elements
- Related posts (time-based, because Jekyll) below each post
- Syntax highlighting using Pygments (the Python-based code snippet highlighter)
BlackDoc Features
In addition to the features of Poole and Hyde, BlackDoc theme adds the following:
- Scrolling sidebar with a thin scrollbar to allow displaying of numerous top-level content.
- Elements and classes of the Hyde theme were updated to look great in black background. Check out the Theme Styles to see the stylings used in the theme.
Check out the Readme
of Poole and Hyde theme to learn more about the features.
Browser support
BlackDoc theme supports most modern browsers and only compatible with Internet Explorer 9 and above.
Download
BlackDoc is a free Jekyll theme and hosted with GitHub. Head to the GitHub repository to download.
Cheers!
07 Feb 2012
Howdy! This is an example blog post that shows several types of HTML content supported in this theme.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Sed posuere consectetur est at lobortis. Cras mattis consectetur purus sit amet fermentum.
Curabitur blandit tempus porttitor. Nullam quis risus eget urna mollis ornare vel eu leo. Nullam id dolor id nibh ultricies vehicula ut id elit.
Etiam porta sem malesuada magna mollis euismod. Cras mattis consectetur purus sit amet fermentum. Aenean lacinia bibendum nulla sed consectetur.
Inline HTML elements
HTML defines a long list of available inline tags, a complete list of which can be found on the Mozilla Developer Network.
- To bold text, use
<strong>
.
- To italicize text, use
<em>
.
- Abbreviations, like HTML should use
<abbr>
, with an optional title
attribute for the full phrase.
- Citations, like — Mark otto, should use
<cite>
.
Deleted text should use <del>
and inserted text should use <ins>
.
- Superscript text uses
<sup>
and subscript text uses <sub>
.
Most of these elements are styled by browsers with few modifications on our part.
Heading
Vivamus sagittis lacus vel augue rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Code
Cum sociis natoque penatibus et magnis dis code element
montes, nascetur ridiculus mus.
// Example can be run directly in your JavaScript console
// Create a function that takes two arguments and returns the sum of those arguments
var adder = new Function("a", "b", "return a + b");
// Call the function
adder(2, 6);
// > 8
Aenean lacinia bibendum nulla sed consectetur. Etiam porta sem malesuada magna mollis euismod. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa.
Gists via GitHub Pages
Vestibulum id ligula porta felis euismod semper. Nullam quis risus eget urna mollis ornare vel eu leo. Donec sed odio dui.
Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec sed odio dui. Vestibulum id ligula porta felis euismod semper.
Lists
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean lacinia bibendum nulla sed consectetur. Etiam porta sem malesuada magna mollis euismod. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
- Donec id elit non mi porta gravida at eget metus.
- Nulla vitae elit libero, a pharetra augue.
Donec ullamcorper nulla non metus auctor fringilla. Nulla vitae elit libero, a pharetra augue.
- Vestibulum id ligula porta felis euismod semper.
- Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
- Maecenas sed diam eget risus varius blandit sit amet non magna.
Cras mattis consectetur purus sit amet fermentum. Sed posuere consectetur est at lobortis.
- HyperText Markup Language (HTML)
- The language used to describe and define the content of a Web page
- Cascading Style Sheets (CSS)
- Used to describe the appearance of Web content
- JavaScript (JS)
- The programming language used to build advanced Web sites and applications
Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Nullam quis risus eget urna mollis ornare vel eu leo.
Images
Quisque consequat sapien eget quam rhoncus, sit amet laoreet diam tempus. Aliquam aliquam metus erat, a pulvinar turpis suscipit at.

Tables
Aenean lacinia bibendum nulla sed consectetur. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Name |
Upvotes |
Downvotes |
Totals |
21 |
23 |
Alice |
10 |
11 |
Bob |
4 |
3 |
Charlie |
7 |
9 |
Nullam id dolor id nibh ultricies vehicula ut id elit. Sed posuere consectetur est at lobortis. Nullam quis risus eget urna mollis ornare vel eu leo.
Want to see something else added? Open an issue.
06 Feb 2012
Jekyll is a static site generator, an open-source tool for creating simple yet powerful websites of all shapes and sizes. From the project's readme:
Jekyll is a simple, blog aware, static site generator. It takes a template directory [...] and spits out a complete, static website suitable for serving with Apache or your favorite web server. This is also the engine behind GitHub Pages, which you can use to host your project’s page or blog right here from GitHub.
Find out more by visiting the project on GitHub.