Almighty Bus Error

Loading search...

Almighty Bus Error Update

Even though there haven’t been any posts, Almighty bus error has been getting updates in its design/presentation perspective. This post will present what’s new aswell as the underlying technologies behind Almighty Bus Error.

What’s new?

The first new thing noticed when you enter the website is the lack of a description in a written form and the appearance of an epic picture that pretty much describes the mood of a bus error appearance (for those to which the reaction was “what?”, that’s exactly it).

Some posts now also contain a table of contents to help with navigation(presented later).

Before:
After:

The menu has appeared from the need to have a navigational gateway on the website for now, and modular enough for the future.

Currently it contains the way to get back to the index of the all posts, the GitHub repository with examples presented on the website aswell some random tools I might’ve needed in the past and the “About” page.

About

To replace the old description on the blog, I’ve decided to create an about page with more information about myself and a description of what a Bus Error is (kindly quoted from Wikipedia).

Technologies behind ABE

Jekyll

From mojombo/jekyll:

Jekyll is a simple, blog aware, static site generator. It takes a template directory (representing the raw form of a website), runs it through Textile or Markdown and Liquid converters, 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.

Since the original Jekyll does not have HAML support (liquid is very weak from programming point of view) I decided to use a out-dated (though fully functional) fork from jberkel.

HAML

HAML is a language used to define templates (such as the index) on Rails applications, more robust than the original liquid.
For example, the index is generated from the following code:

---
layout: default
---
#home
  - site.collated_posts.sort.reverse.each do |year,months|
    - months.sort.reverse.each do |month,days|
      %h3.title_date
        = "%s" % Date::MONTHNAMES[month]
        %span.year
          = "%s" % year
      %ul.month
        - days.sort.reverse.each do |day,posts|
          - posts.each do |post|
            %li
              %div.index_post
                %div.index_post_title
                  = "%s" % [link_to post.title, post.url]
                %div.index_post_date
                  = "%02dth" % day
                - if (post.content.split('</p>')[0]).gsub(%r{</?[^>]+?>}, '') != ""
                  - if post.content =~ /Article Contents/
                    %div.index_post_intro
                      = (post.content.split('<p>')[1] + " (...)").gsub(%r{</?[^>]+?>}, '')
                  - else
                    %div.index_post_intro
                      = (post.content.split('</p>')[0] + " (...)").gsub(%r{</?[^>]+?>}, '')

Yes, thats alot of regular expressions. Since Jekyll only generates a static site “offline”, there is no need for huge optimizations and code mangling.

Textile

From Wikipedia:

Textile is a lightweight markup language originally developed by Dean Allen and billed as a “humane Web text generator”. Textile converts its marked-up text input to valid, well-formed XHTML and also inserts character entity references for apostrophes, opening and closing single and double quotation marks, ellipses and em dashes.

Instead of Markdown, Almighty Bus Error uses textile to present the posts (and some hack’ish html to be honest).

For example in Dynamic Programming:

From "Wikipedia":http://en.wikipedia.org/wiki/Dynamic_programming:

<blockquote><span class="qstart">&#8220;</span>In mathematics and computer science, dynamic programming is a method of solving complex problems by breaking them down into simpler steps. It is applicable to problems that exhibit the properties of overlapping subproblems which are only slightly smaller and optimal substructure (described below). When applicable, the method takes much less time than naive methods.
Top-down dynamic programming simply means storing the results of certain calculations, which are then re-used later because the same calculation is a sub-problem in a larger calculation. Bottom-up dynamic programming involves formulating a complex calculation as a recursive series of simpler calculations.<span class="qend">&#8221;</span></blockquote>
As described above, dynamic programming consists of two main steps:

* 1) Correctly identify the recursive function that describes the problem.
* 2) Convert that function to a iterative algorithm that is memory-bound ("memoization":http://en.wikipedia.org/wiki/Memoization) instead of cpu-bound.

Table of Contents

The table of contents which has appeared also in some posts is a new feature developed by me and is available in GitHub. This feature reads all the headers on a post and creates a structure by using the degree of header. For more technical information check the fork’s Wiki.

The new search is provided by Google’s AJAX Search API which is configured to search within almightybuserror.com domain for what you are looking for.

Thats about all new to Almighty Bus Error, thank for reading. Comments are welcome.