Ryan Harrison My blog, portfolio and technology related ramblings

Example content

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.

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.

  1. Vestibulum id ligula porta felis euismod semper.
  2. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
  3. 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.

placeholder placeholder placeholder

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.

Read More

What's Jekyll?

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.

It’s an immensely useful tool and one we encourage you to use here with Lanyon.

Find out more by visiting the project on GitHub.

Read More

C# - MP3 Tag Renaming

After a recent migration away from iTunes (thankfully), I realised that a lot of the tags for my music files were pretty messy (thanks iTunes). Particularly the title tags for a few albums consisted of the artist name, a dash, and then the actual title of the song itself. For example album artist - song title. This quickly got annoying when scrolling through my library.

It seemed like a good opportunity to play with the Id3Lib library for C#.

This small C# utility app traverses through a directory structure looking for for all files within with the .mp3 extension. A new instance of Mp3File is then created which allows pretty comprehensive modification of the residing ID3 tags which can be accessed through the TagHandler property. In this example a small Regex is used to remove the artist from the title and update the file.

  
using System;  
using System.IO;  
using System.Text.RegularExpressions;  
using Id3Lib.Exceptions;  
using Mp3Lib;

namespace Mp3Renamer  
{  
    class Program  
    {  
        static void Main()  
        {  
            IterateFiles(@"C:\Users\UserName\Music\SomeFolder");

            Console.WriteLine("Done");  
            Console.ReadLine();  
        }

        static void IterateFiles(string path)  
        {  
            var files = Directory.GetFiles(path, "*.mp3″, SearchOption.AllDirectories);  
            var length = files.Length;  
            var count = 0;

            foreach (var file in files)  
            {  
                try  
                {  
                    var mp3 = new Mp3File(file);

                    var title = mp3.TagHandler.Title;  
                    var artist = mp3.TagHandler.Artist;

                    title = Regex.Replace(title, @"^" + artist + @"\s\*-\s\*", "", RegexOptions.IgnoreCase).Trim();

                    mp3.TagHandler.Title = title;

                    mp3.Update();

                    if (count % 100 == 0)  
                        Console.WriteLine("Done " + count + " files of " + length);

                    count++;  
                }  
                catch (InvalidFrameException e)  
                {  
                    Console.WriteLine(e.Message);  
                }  
            }  
        }  
    }  
}  

This is just one of the many uses of this library which is really easy to get to grips with. The only problem I’ve had so far is with `‘Invalid UTF-8 strings’ in some of my files. But I guess that’s a problem on my side and not with the library.

Check out the ID3Lib for C#.

Read More

[Link] Java 8 Lambda's - A Glossary of Terms

As a follow up to a previous post about the new features that Java 8 will bring to the table, here is another good link that covers some of the new terminology the update will introduce. As the new lambda expressions and streams API are likely to be the most used features of Java 8, it’s never too early to brush up on some of the new classes.

A conversational guide for JDK8′s lambdas - a glossary of terms

Read More

Free GitHub Micro Plan for Students

GitHub is a great service that I use often to host my personal projects. Their free accounts offer an unlimited number of public repositories where your code is visible to anyone visiting your profile. This is great for any open source work, but not so good for coursework projects where you really want to keep your source code private (at least until the deadline).

Handily though, if you are a student GitHub will give you a free Micro plan for a few years to help in your studies. This plan comes with 5 private repositories and of course you are still able to create an unlimited number of public ones.

All you need is a valid academic email address that has been added to your GitHub and you are good to go.

Sign yourself up here: https://github.com/edu

Read More