Today is the day. WWDC 2016. Have you thought much about what we might expect?
One of the main things that I am expecting is Apple finally dropping OS X and naming it macOS (stylised exactly like that). Doing this would make macOS feel right at home with iOS, tvOS and watchOS.
Of course, iOS 10 is expected and OS X 10.12 (or macOS 10.12). Apple will probably also announce tvOS 2 and watchOS 3. Also, there may be a few more watch straps announced today. With macOS 10.12 I am expecting that Apple will finally bring Siri to us Mac users.
Anyway, that's my thoughts. Let me know what you think below.
My blog all about BalfBlog, which was formerly the BalfBlog blog has been renamed my Project blog. This blog will no longer focus solely on BalfBlog, but it will now discuss all of my projects.
On that subject, whilst ZPE is one of my main projects, it will not really be discussed too much on this blog since there is a dedicated blog on the zenlang.net website. I think it would be wise for me to keep submitting there rather than at both places.
It's considered pretty bad practice to use a class selector in CSS as a single instance, for instance, you would not choose to the name the main_container
element .main_container
, would you? Or would you?
Well actually, I was thinking about this today, and I've come to the conclusion that yes, maybe you would. That's because of the DOM buzz word specificity.
Any CSS developer who has been using it for a while will know that the ID selector (#
) is more powerful than the class selector (.
), but do you know how much more powerful it is? Well 10 times to be exact. For more information on this, read the linked article.
It's important to note that throwing in an ID selector makes it very difficult to overwrite, so using one is not always the best way to achieve something. For instance, say you wanted all the anchor elements inside your main body section to be displayed with a style where you've got the code such as:
<div id="main_container"> <a>Test</a> <a class="tester">Test</a> </div> <div id="sidebar"> <a class="tester">Test</a> </div> </div>
The anchors could simply be selected using the #main_container a
selection. But this means, according to specificity rules, that the anchor would have 101 points (100 + 1), meaning overwriting this anchor with a class is not easy and would require the ID at all costs. Now you want to style the links with the class tester
too, but across the whole site. So we have two choices, either rewrite the page so that the body has an ID too, or, create a selector like #main_container a.tester, #sidebar a.tester
.
Both of these solutions are inadequate.
The single use class
Let's rewrite the HTML and CSS. Add the class singleton
to the main_container
:
<div id="main_container" class="singleton"> <a>Test</a> <a class="tester">Test</a> </div> <div id="sidebar"> <a class="tester">Test</a> </div> </div>
Now our selection can be much weaker, albeit less specific (but since singleton
will only occur once and only once we do not care). We can now select using .singleton a
. We have reduced the specificity to 11 (10 + 1). To overwrite it, we can now just use a.tester
since this also has a specificity of 11 (1 + 10). However, this will only work if it is placed in the CSS file after the reference to the original tag (i.e. after the .singleton a
).
So there you have it, a way to use the class selector as a single instance effectively.
Over the last few years, I've done a lot of work on building my own programming language and platform known collectively as ZPE.
Perhaps the most important lesson I have learned from this is how to make a program more efficient. I focus a lot on shifting things from the interpreter/runtime side to the compile-time side in ZPE, which has been a major focus of the latest version. However, there are some things that I cannot do very easily.
I recently started thinking about making one of my programs more efficient and how this would work in ZPE. Let's take a look at some code:
$l = range(1, 5000) //For x is less than the length of the list (i.e. 5000), increment by 1 for ($x = 0, $x < list_get_length($l), 1) print($x) end for
Notice how we check the size of the list at the top of the for? This means each iteration will need to call that function to find the size of the array. If a variable had been defined before the for loop and contained the length of the list, one could simply reference the variable, which in turn would be much faster than constantly asking the system to find the length of a 5,000 element array. Here is a sample of this in action.
$l = range(1, 5000) $len = list_get_length($l) //For x is less than the length of the list (i.e. 5000), increment by 1 for ($x = 0, $x < $len, 1) print($x) end for
Times were measured using the Unix time command and were as follows:
For the first test:
real 0m1.821s
user 0m2.862s
sys 0m0.363s
And for the second test:
real 0m0.437s
user 0m1.051s
sys 0m0.099s
This is the first tip I have for you. This tip will also work in other languages such as JavaScript or Java or whatever.
In 2020
In 2020 when I was looking through my blog, I came across this post and thought I'd test it out again for a bit of fun. Interestingly, running both for loops is considerably faster than even the faster for loop example provided here. Compiler optimisations, runtime improvements and much more have made this much faster in ZPE 1.8.5. The version shown above is running on ZPE 1.4.2E, which is still available to download and compare.
To me personally, there is no greater sense of achievement than what I have now achieved! I've finally finished my four long but fun years at Heriot-Watt University and have recently learned that I have achieved a First Class Honours degree.
I cannot tell you in words how proud I am to have achieved this!
I also posted this to Twitter:

I'd like to also congratulate all my friends and thank them for supporting me through this time! I really couldn't have done this without all the support from them.
On the subject of support, I also must thank my lecturers for their support as well, since there is absolutely no way I could have done this without them.
Windows 10 was an amazing operating system for a few days when I first installed it on to my gaming PC. My gaming PC, The Zebra X2, is a beast of a machine which can run most games that I play like Starcraft II and GTA V in the highest available settings (Core i7 4770K, 256GB SSD, 8GB DDR3 RAM and an AMD 7950) but latterly it struggled with simple things like starting up.
After I installed Windows 10 the machine ran fine. However, one day when I was playing a favourite game of mine, Command and Conquer 3, I noticed a slight drop in framerate from playing it the time before. I didn't think too much of it at the time but gradually I noticed that each time I played this game it was getting worse. At the very end before I ridded myself of Windows 10 it was running so slow that when I used the graphics intensive Ion Cannon superweapon the game would just freeze and the animation for the superweapon would not be shown. The game would resume after the Ion Cannon blast was finished. So what the heck was going on?
My initial thoughts were that the hard disk drives that I stored my games on were starting to fail. I tested them all with SMART tools and none of them showed any signs of failure. I then assumed that it was my SSD so decided to install an old SATA III HDD into the system and installed Windows 7 on to it. It ran fine. I upgraded it to Windows 10 and again, it ran fine. So I assumed it was the SSD. I left the SSD in the system just disconnected.
After time, the same weird thing happened to my system - it began slowing and the graphics were getting messed up in games. So now I assumed it was the graphics card or the PCI controller that had failed on me. I took the GPU out of the system and used the dedicated graphics built in to the CPU. The system ran just the same so I now knew it wasn't the graphics card that had failed, but wasn't sure if it was a motherboard fault such as the PCI controller or the memory controller.
I decided to reinstall the SSD and flash my BIOS. Clearing the BIOS meant that I could set it back to the factory defaults and test it with them (I had tried this several times before but to no avail). Nothing changed.
My next choice was to clear the SSD and install Windows 7 on it. After reinstalling I panicked slightly as it wasn't working well at all with the Desktop Window Manager crashing on startup. After installing Service Pack 1 everything seemed to work perfectly. I would like to say that Windows 7 was the solution but I can't be sure.
I would probably put the problem down to several things: Windows 10 was clogging up the system (don't know why), the original BIOS was not designed for Windows 10 and would have required an update (I have since updated again and may try it again in the future with Windows 10) and that Windows just needed that little reformat that us Windows users need to do on a regular basis.
My fix appeared to have come from the reinstall of Windows 7 and the BIOS reset. I will keep everyone up to date with my progress with Windows 10 again in the future.
The Windows 10 upgrade tool can be a pain!
Due to the upgrade tool in Windows 7, I have been upgraded to Windows 10. This time the system appears to be running well - that is at least in comparison to how it was before. I will keep you posted when it begins to slow down again (if it does).
In the past, I have been told that my code samples are really good, but they lack one or two things. The most crucial one of those is the ability to copy the formatting. Unfortunately, this is not possible at the moment due to the fact they are written as a ordered list element. This means that each line of code is put in a new li
element. When one comes to attempt to copy from the element, the formatting (e.g. the indentation, which is completely controlled by a CSS margin property) will not be retained.
After some perseverance, I have begun the transformation of my samples. Currently in the ol
element, they will now be nested within the pre
element. What this also means is that it will be much easier for me to update them using my content management system. As of this second, the CSS tutorial has been partially updated, and my articles, reviews, blogs and the software section completely use this new system.
The main theory behind doing this is to make my website more accessible and easier to use, whilst not making any real visual changes. At the current time, you may see that some of the older samples no longer appear properly. This is a known issue and will be fixed when they switch to the new style.
Please bare with me whilst I make this change, since it will take some time for me to fully implement across my tutorials.
pre
-based samples. It's taking a long time to do but I will be done with the PHP tutorial by the end of the day.pre
-based code samples so all code from these samples is now fully copyable. JavaScript must be enabled for the pre elements to display properly, but it will work without JavaScript anyway. 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.
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.
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!