Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Jamie Balfour'sPersonal blog

Today I am releasing the latest version of BalfBlog and using it on my website to power my articles!

The latest version of BalfBlog had the core focus of being able to manage a system like my articles system. Well now, after 3 years of development BlackCat is being replaced by a much younger (started in January 2016) content management system. 

BalfBlog is far from perfect for this and a lot of work is still needed. I say this because, at present you need a dashboard for each BalfBlog system. Also, whilst the project was only recently renamed BalfBlog, it was never to be the full time name. So please help me come up with a better name for BalfBlog that reflects this new feature.

The new system brings a lot of front end features too, such as being able to use the BalfBlog search which will search for words you enter only in that blog/section. You can do this using the search box at the top of the section, this allows you to search based on the category, keyword, title, tags or anything else you may want to search for. This gives a lot more specificity over what you are searching for compared with Google's search provided on my website.

On top of this, updates are easier to apply to these sections of my website than before and I can manage content using a more useful content management system.

So all in all, it's been a great move.

Posted in Website news
balfblog
website
update
articles
powered
featured

My poster is finished. This means I have done all of the work other than presenting my poster and I have finished all of my uni work. :-)

I now feel epic and that I can finally relax! Thank you to everyone who has supported me throughout my time at university. 

Posted in Life
poster
university
computer
science

The latest update to BalfBlog brings quite a lot of useful features that make it easier for you to manage your pages. As well as this I have given you the option to customise the comments block. This allows you to change the text that would normally have been in the post in the section at the bottom when the user is not viewing an individual post.

If you download the update, you will also need to add an extra field to the posts table in the database since this new feature, although experimental at the moment, is now included in all versions of BalfBlog henceforth. 

The last update brought a few changes that were preplanned features that would make this transition easier, I hope you enjoy the latest updates too. Remember, get in touch to download.

PS, I did mention a public demonstration of BalfBlog in the next few days where I will release the first public version. Any thoughts or feedback before then are greatly appreciated!

Posted in BalfBlog
important
update
available

The next feature to come to BalfBlog is a page manager for the CMS. This will allow you to manage blog posts as if they were individual pages. For instance, I currently maintain my website through BlackCat 1.1 (my own CMS) for the articles and reviews section. I will soon be changing this over to my new BalfBlog CMS in an attempt to unify the blogs and page managers on my website. All of this is possible because of mod_rewrite and BalfBlog combined.

Posted in BalfBlog
page
manager
cms
USB-C

USB-C seems set to take over now

The future of physical connectivity in computer systems looks very limited. One day in the future I can foresee all devices connecting with a connection not too dissimilar to USB Type C. The reversible USB connector that was released a year back with the new MacBook was received with both positive and negative responses. For me, it was an incredibly positive product since it does a lot of things in one.

Apple just didn't get it right by releasing it with just the one connector. At the moment, adapters are still not everyone's cup of tea. In fact, for most people, adapters never will be a good solution. 

Anyway, the main point of this post is not talking about the MacBook, it's talking about something that I feel strongly about, physical connectivity.

One connector for all...

I don't really like this one connector for all since I've always liked the idea of different connectors for everything. 

You know, I remember when I made the switch to FireWire over USB about 7 years ago, I thought that buying all my drives with FireWire would be great since it's going to be the future of data connectivity. I know I was late in coming in, but I didn't expect it to be removed from all of my devices within a few years! I mean take my Macs for instance, my Retina MacBook Pro does have a Thunderbolt to FireWire adapter available, but this isn't ideal and it's expensive. My Mac Mini does have a FireWire 800 connector on it but the new models also require the adapter since they no longer feature FireWire on them. My PC is just as annoying however, since it doesn't even have a FireWire header on it. My previous PC (the Zebra, built in 2011) featured a Gigabyte GA-Z68X-UD3 motherboard which had 3 FireWire connectors (including headers) and then all of a sudden, an upgrade 2 years later to a Gigabyte GA-Z87-UD3H motherboard and a Haswell architecture, and I've suddenly got no FireWire connectors. 

Actually, one of the most annoying things is all of my PCI cards (not PCI-Express) which I've been using since about 1998 when I got my first PC, including a really old, but still useful, video capture card (circa 2000), no longer work on my system since there are no free PCI slots in my system (I have a serial port card and a TV tuner in them). 

A single connector for all also bring about the concern of overloading buses or whether or not everything is polled (as USB is). Speed can become an issue when one connector is used for everything. 

However, one connector for all is a good thing too, since every device you use will use that connector and it's easy to remember what you need to use the device (i.e. a USB-C cable). But many companies, such as Apple, are difficult and try too hard with their own connectors and make the one for all difficult. Look at the Lightning connector for example, every other smartphone uses Micro USB 2.0 or Micro USB 3.0 meaning you can share your charger with any other smartphone user; that is everyone except iPhone users. It never works. One for all is too difficult.

Complications also arise when you are working with very specific applications. I for one still use the 1980s RS232 standard for many things such as electronic circuit boards for experiments (although I'm looking into using a RPi for this in the future) and for control commands for my projector. With a connector like USB-C, this becomes more complicated since RS232 was a highly simple connector, it becomes harder to emulate old standards. 

Another even more annoying thing is having to buy an adapter to make it work with your older devices such as serial port devices. These devices may be hard to come by, but the bigger issue is if we end up needing all these adapters we've got to pay for them, and more specific adapters will probably be fairly expensive.

Here is a comparison table showing how Thunderbolt has changed over the years:

Version Maximum Speed Maximum Power Output Connector Type
Thunderbolt 10Gbps 10W Mini Displayport
Thunderbolt 2 20Gbps 10W Mini Displayport
Thunderbolt 3 40Gbps 100W USB-C

Notice any similarities between Thunderbolt 3 and USB-C that was announced on the new MacBook? That's because they will likely merge.

The conclusion

Here's my solution: make the one connector for all a reality, just keep the old connectors alongside this new connector, thus giving people, like me, the option to use older connectors without needing to buy the adapter. This keeps costs down, but also leaves users of older devices able to continue to use them. Don't cut out USB Type A and replace all mice and keyboards with USB-C connectors. 

We cannot live in a world where we need to keep all of these dongles for everything, it's simply ineffective and expensive, especially when one breaks down. I believe because we have come from a world of loads of different connectors into a world wanting a single connector for all that we will be faced with many problems. This is particularly the case with industries such as the music industry, where devices of today really lack in the connectivity side of things. I mean the world got rid of the Gameport (or MIDI port) without any major problems, but for those who had purchased MIDI devices that used the Gameport-style connector as the input, they had to go out and buy adapters or get new devices. The change can come on too rapidly, especially for some. The slow but very painful disappearance of FireWire in the last few years has made it's mark, even for me since I can no longer connect my FireWire drives to my PC (I can with my Mac mini thankfully). And now companies are phasing out audio jacks and in particular the multi audio jack system, and all in favour of USB or single audio jack solutions.

Posted in Tech talk
usb
c
type-c
usb-c
3.0
hdmi
displayport
thunderbolt
pci-e

Live posts/live blogs are a thing now and while BalfBlog has had them since late 2014, they are really not well enough implemented to be used. A friend on mine suggested a new way to bring these to BalfBlog and in the near future, they will come to BalfBlog. For now, checking the box to make a post live does nothing anymore. 

Hidden posts on the other hand are getting more emphasis. Now hidden posts can be changed from the dashboard (before now I only had these in for my own use). Posts can be hidden when you don't want to publish at the very second you leave the page, and then they can be revealed again by just changing a box.

These new features aren't exactly amazing, but they are pretty damn important. 

Posted in BalfBlog
live
posts
balfblog
blog
balf
update

Whilst it was never my intention to move back to the way JBlogs was and use a local copy of TinyMCE, unfortunately the way that TinyMCE works means that you cannot add plugins to a version in a CDN. As a result, a local copy has been created and you can choose to use this version or the lightweight version which uses the CDN. The local version is superior in all ways apart from for speed and space. 

With the local version there is an increase of about 400KB. I will not be including this by default but I will keep a configuration that is setup for this available too. I found that this is the best way to allow users to insert images since plugins like JustBoil.me allows users to quickly insert images.

Posted in BalfBlog
cdn
local
balfblog
tinymce
jbimages

The latest update is perhaps my favourite to date. I have added a feature to BalfBlog that allows it to be used as if it were a journal instead of a public blog. In this mode users will only be able to view their own posts and will need to be logged in. Of course users with more power such as admins can view anyones posts.

Posted in BalfBlog
journal
viewer
blog
balfblog

I have been focusing on improving the search algorithm used by BalfBlog. What happens now is this:

  • A search is sent to the database to search for items containing any of the words searched for
  • The results are then traversed and any results that do not contain all of the search words are removed

Another important step was removing the double query design. This was a pathetic idea in the first place and I never meant for it to be in the release version but only in a test version. I apologise to anyone who has since downloaded but the latest update is marked as CRUCIAL. Please make sure to download it as soon as possible.

BalfBlog now has a more flexible refinement of queries function that will ensure that the information coming out is suitable.

More importantly, the HTAccess directive file is much better now and it works more efficiently.

Posted in BalfBlog
search
update
fixed
issues

I would go as far as to say that over the few months I have learned so much and am aiming to become an Apache master soon! 

In the last year or two, I have also been using regular expressions (regexps) to do everything and I think it's fair to say I am a master of them. I find them to be the most useful thing you can know for using your computer on a day to day basis. I now use them to search my computer or a text editor, I have made my own programming language which uses them for matching in the compiler, and very recently to match things on my website. I recently mastered htaccess files on Apache and nginx servers. As part of this I have made my site much more SEO friendly and developed BalfBlog considerably. I have been using regexps for about five or six years, but I was not exactly using them often enough and skillfully enough. Back in my C# programming days (I haven't worked on my C# projects since 2013, but I am talking about when it was my main language in about 2008 - 2010) I used regexps in Wonderword for the search and replace features, in BlackRabbit Script it was pretty much the basis of the language and in other programs I used it for text replacement tools (also included in Wonderword, but also found in my BBCL library).

Recently I brought both of these masteries together and have done so much with my website to make it better. I improved my hotlink protection due to these regexps and, to be honest, I think I did a great job since I cut ninety lines down to three with some simple regexps. 

So today I'm going to share this with you.

cPanel, by default, allows you to add URLs that will not be affected by hotlink protection. As such you enter them in (or if you add a new subdomain it adds them automatically). Except as great as this is, my URLs looked like this:

HTAccess
RewriteCond %{HTTP_REFERER} !^http://2010.archive.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://2010.archive.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://2012.archive.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://2012.archive.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://airdisplays.sites.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://airdisplays.sites.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://alpha.archive.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://alpha.archive.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://archive.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://archive.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://ashes-scattered.sites.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://ashes-scattered.sites.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://be.sites.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://be.sites.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://castleinn.sites.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://castleinn.sites.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://clickit.education/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://clickit.education$      [NC]
RewriteCond %{HTTP_REFERER} !^http://developer.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://developer.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://doodle.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://doodle.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://doodle.projects.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://doodle.projects.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://edustream.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://edustream.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://flitter.projects.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://flitter.projects.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://firestarter.projects.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://firestarter.projects.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://jamiebalfour.co.uk/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://jamiebalfour.co.uk$      [NC]
RewriteCond %{HTTP_REFERER} !^http://jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://jbtest.projects.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://jbtest.projects.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://projects.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://projects.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://sites.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://sites.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://wonderword.sites.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://wonderword.sites.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.2010.archive.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.2010.archive.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.2012.archive.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.2012.archive.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.airdisplays.sites.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.airdisplays.sites.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.alpha.archive.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.alpha.archive.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.archive.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.archive.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.ashes-scattered.sites.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.ashes-scattered.sites.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.be.sites.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.be.sites.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.castleinn.sites.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.castleinn.sites.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.clickit.education/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.clickit.education$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.developer.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.developer.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.doodle.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.doodle.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.doodle.projects.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.doodle.projects.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.edustream.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.edustream.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.flitter.projects.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.flitter.projects.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.firestarter.projects.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.firestarter.projects.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.jamiebalfour.co.uk/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.jamiebalfour.co.uk$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.jbtest.projects.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.jbtest.projects.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.projects.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.projects.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.sites.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.sites.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.wonderword.sites.jamiebalfour.scot/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.wonderword.sites.jamiebalfour.scot$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.zenlang.net/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.zenlang.net$      [NC]
RewriteCond %{HTTP_REFERER} !^http://zenlang.net/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://zenlang.net$      [NC]

I was looking at what it generated tonight since I've been fixing a lot of htaccess directive files across my site and subdomains and my other domains. I realised that I can put these down to just three lines of code and make it easier for me to maintain in the future. So this is what I've got:

HTAccess
RewriteCond %{HTTP_REFERER} !^https?://(www.)?(.*.)?(.*.)?jamiebalfour.co(m|.uk)(.*)      [NC]
RewriteCond %{HTTP_REFERER} !^https?://(www.)?clickit.education(.*)      [NC]
RewriteCond %{HTTP_REFERER} !^https?://(www.)?zenlang.net$      [NC]

 So there you have a simple solution to a big problem. Learning regexps is like learning to use a calculator, it just saves so much time!

Posted in Web Development
apache
web
server
nginx
regex
regular
expression
matching
Powered by DASH 2.0