Sunday, 23 October 2016

It's behind you: the making of a computer game

The Making of ZX Spectrum R-Type


"In April 1982 Clive Sinclair launched the follow up to his successful ZX81 home computer, The ZX Spectrum. In the ten years that followed over nine thousand commercial games were written for this iconic machine. This is the story of one of them."

I recently read an e-book by Bob Pape which details his experiences during the 80's when he made his living writing computer games. 

This was the era of the so-called bedroom-coder and this book gives an amazing insight into this world in all its glory. Specifically the book highlights the development, or rather a home computer port, of a game called R-Type from the arcade to the ZX Spectrum.


There are parts of the book which go in a little bit of technical detail of how he was able to make use of the ZX Spectrum's limited 8-bit capacity. Such as:

"Collision Map 2 is scanned through a byte at a time, if the value is zero then the corresponding character on the main screen is filled with zeros, overwriting any graphics from the previous frame. A non-zero value indicates that data from the back screen should be used, again overwriting any previous graphics."


The book is very well written and keeps the reader engaged throughout.
Although it covers quite a niche subject, anyone who is interested in classic video game development, the Spectrum home computer, remembers playing R-Type back in the day or has a passion for old computer games will surely find this book a illuminating insight into one particular corner of history.

What is most striking was how chaotic the working conditions were during this period. This is detailed in the following two passages taken from the book:

"If I was lucky when I arrived in the morning and climbed the stairs I'd be greeted by the remains of kebabs and empty beer bottles, if I was unlucky it would be vomit and full beer bottles - only it wasn't beer that was in them any more." - page25

"one of Kightley's suggestions was to cut out full page ads from games magazines and stick them up on the walls. I think the idea was to show prospective customers and visitors how professional and cutting edge we were but all it did was make us look a real Mickey Mouse outfit!" - page 25


The book is great value as it is available for free (as in beer) from Bob's site in either PDF, ZIP or Kindle formats.  It's quite a short book at just 136 pages, so it can be easily consumed in one or two sittings. 


Links:

It's behind you: the making of a computer game

R-Type Walkthrough, ZX Spectrum

Tuesday, 5 July 2016

Fedora 24 - Workstation

Fedora 24

Fedora 24 was released on 21st June 2016.
There are no major changes or amazing new features just a host of usability improvements as well as the usual software upgrades.

GNOME has been updated to the latest upstream release (3.20),
the GNU C Library is now at version 2.23, the System compiler has been updated to GCC 6 and Python has moved from 3.4 to Python 3.5.

There are also updates to NetworkManager (version 1.2) and glibc
has been upgraded to 2.23.

A most noticeable change is the default font which has now moved to Cantarell.
This is a really nice looking clear font which I personally thinks looks much better.

Fedora 24 has continued improving the X replacement, Wayland.
Although this is still not the default it is available as an option for users to try out.

From Fedora 24 on wards users can now perform major version upgrades via the GUI rather than the command line. The updates can be run from the Software app upgrade system which will have a clearly marked "Install" button.

This is another solid release from the Fedora team.
The user interface continues to look sleek and professional and there are a plethora of tools to help you get the job done.

Monday, 20 June 2016

MongoDB wired tiger configuration

How to configure the wired tiger storage engine

Today I spent time configuring a mongoDB instance to use the wired tiger storage engine. This is the default in version 3.2 but has to be manually configured for prior versions. I found that the official documentation lists all the available options that can be specified, but does not show any useful YAML formatted examples of how the completed configuration file should look.

As such I though that this post would be useful for anyone else in a similar predicament.

To start, the storage.engine needs to be set to wiredTiger.

engine: "wiredTiger"

This is new in version 3.0 and the default in v3.2.

The other options we need to amend / update / include are:

cacheSizeGB - This value is a number and we should use the larger of either:

    60% of RAM minus 1 GB, or 1 GB.
               
journalCompressor - The Default is snappy. The option is used to set the type of compression which will be used to compress the WiredTiger journal data. Other available  compressors options are: none or zlib.

directoryForIndexes - The Default is false. This option determines whether mongodb should stores indexes and collections in separate sub-directories under the data directory.

blockCompressor - The Default is again snappy. This option determines the default type of compression to use to compress collection data. Other options are: none or zlib.

prefixCompression - The Default is true . This option enables or disables prefix compression for index data.

The completed storage of the config file should look similar to the below.


Links: 

DBA Stack Exchange - Sample YAML Configuration Files for MongoDB


Wednesday, 15 June 2016

Oracle – DB Temp flle has been deleted!

Actions to take when the temp file has been accidentally deleted


If the temp file is removed / deleted when the database is shut down then the DB is clever enough to realize that its missing and should create a new file when it’s brought back online.

[oracle@localhost ~]$ rm /home/oracle/app/oracle/oradata/orcl/temp01.dbf

[oracle@localhost orcl]$ ls
afiedt.buf                                       APEX_2614203650434107.dbf     redo03.log
APEX_1930613455248703.dbf     control01.ctl                                  sysaux01.dbf
APEX_2041602962184952.dbf     example01.dbf                               system01.dbf
APEX_2610402357158758.dbf     redo01.log                                     undotbs01.dbf
APEX_2611417663389985.dbf     redo02.log                                     users01.dbf

SQL> startup


[oracle@localhost orcl]$ ls
afiedt.buf                                        control01.ctl                   system01.dbf
APEX_1930613455248703.dbf      example01.dbf                temp01.dbf
APEX_2041602962184952.dbf      redo01.log                      undotbs01.dbf
APEX_2610402357158758.dbf      redo02.log                      users01.dbf
APEX_2611417663389985.dbf      redo03.log
APEX_2614203650434107.dbf      sysaux01.dbf

* Temp01 file has been magically re-created

If the database is up when the file is removed then you can manually re-create it on the fly as follows:

-- create a new temp file
ALTER TABLESPACE TEMP ADD TEMPFILE
'/home/oracle/app/oracle/oradata/orcl/temp02.dbf' SIZE 50M;

-- Drop the old file
ALTER TABLESPACE TEMP DROP TEMPFILE
'/home/oracle/app/oracle/oradata/orcl/temp01.dbf';

SQL> select file_name, tablespace_name from dba_temp_files;

FILE_NAME                                                                 TABLESPACE_NAME
/home/oracle/app/oracle/oradata/orcl/temp02.dbf       TEMP

Or if you are able to restart the database, then you can let the database re-create it for you.

[oracle@localhost ~]$ rm /home/oracle/app/oracle/oradata/orcl/temp02.dbf

SQL> shutdown immediate

SQL> startup

[oracle@localhost orcl]$ ls
afiedt.buf                                       control01.ctl                    system01.dbf
APEX_1930613455248703.dbf     example01.dbf                 temp02.dbf
APEX_2041602962184952.dbf     redo01.log                       undotbs01.dbf
APEX_2610402357158758.dbf     redo02.log                       users01.dbf
APEX_2611417663389985.dbf     redo03.log
APEX_2614203650434107.dbf     sysaux01.dbf

Wednesday, 30 March 2016

Brainf**k - A short intro to the programming language

An esoteric programming language is a language designed to test the
boundaries of computer programming language design. Usability is rarely a goal.

An example of such as language is Brainfuck which was created in 1993 by Urban Müller. The language consists of only eight simple commands and an instruction pointer.

Here is an interesting video which details it's unique charm.

 

Links:



SQLBits 2016

SQLBits XV - European SQL Server conference

This year’s SQLBits conference is being held in Liverpool, between 4th – 7th May. SQLBits is the largest SQL Server conference in Europe, and is billed as a must-attend event for DBAs, developers and BI professionals who work with Microsoft SQL Server in the UK and Europe.

Wed and Thursday are full day training sessions, whilst Friday and Saturday are filled with 60 / 75 or 135 min sessions.

There are numerous talks by a whole host of industry experts such as: Kendra Little, Steve Jones (SQLServerCentral), Brent Ozar (BrentOzar.com), Thomas LaRock (SolarWinds), Grant Fritchey (The Scary DBA), Kevin Kline (SQL Sentry) plus sessions from members of the Microsoft team. 

Saturday is a community day which is also free to register.
This is a great training and networking opportunity for SQL Server DBA's.

Prices start at £849 for the full conference (until 1st April, £999 after).
Individual Days start at £349 for Wed and Thurs (until 1st April 2016 and then £399). Friday is £249 until 1st April 2016 and then £299.
Saturday is a community day which is free to register.

This is a great training and networking opportunity for SQL Server DBA's.


4th – 7th May 2016
Exhibition Centre Liverpool
Kings Dock
Liverpool, Merseyside L3 4FP

Links:

SQLBITS - http://sqlbits.com/
FAQ


Tuesday, 22 March 2016

New Features in SQL Server 2016

New in SQL Server 2016...


Query store

The Query store captures queries, query plans, runtime statistics, etc. in a persistent store inside the database. This can be used by DBA's for performance troubleshooting and identifying regressed workloads.

Live Query Statistics

SQL Server 2016 has a new feature, called Live Query Statistics (LQS), that allows you to view what is happening during the query execution. This allows you to view associated statistics such as current CPU/memory usage, execution time and query progress. Making the process of identifying potential bottlenecks a lot simpler.

JSON 

Native JSON support is included in SQL Server 2016. It comes with several new T-SQL constructs to facilitate working with JSON data.

Temporal Database Support

2016 also comes with temporal database support. This feature provides correct information about stored facts at any point in time, which is a convenient way to query table snapshots from any point in time, or data over a particular time range.

Security

The Always Encrypted feature gives the ability to have your data encrypted whilst at rest and in motion. You can also query your data while it is still encrypted. 

Row-Level Security provides fine-grained access control over rows in a table based upon conditions you set up.

SQL Server’s Transparent Data Encryption (TDE) allows organizations to encrypt data when it is stored on a disk, and decrypt it when it is read into memory. 

SQL Server also has the ability to encrypt the data while creating a backup. In 2016 backup encryption is now supported with compression.

The new Always Encrypted feature can also protect sensitive data stored in a SQL database from DBAs and other high-privileged yet unauthorized users. A special database admin role can be created for standard database administration, without the ability to access user data. 

Microsoft has stated that SQL Server 2016 is the first data platform solution on the market providing query-able encryption.

Auditing

SQL Server 2016 supports important new functionality for auditing. This gives the DBA the ability to audit whether an underlying operation was successful as well as whether the permissions check succeeded or failed.

Availability

SQL Server 2016 adds significant new enhancements to AlwaysOn. You can have up to three synchronous replicas, on different domains either on-site or on Azure virtual machines.

Enhancements

AlwaysOn in the areas of scalability and manageability. Increased number of auto-failover targets from two to three.
Physical processing now scales up to 640 logical processors, and virtual machines scale up to 64 logical processors.
There are increased upward limits on memory available to the operating system.
SQL Server 2016 now implements Microsoft’s next-generation cryptography.
SQL Server supports as many as 15,000 table partitions.

Cost-effective Solution

Many vendors deliver limited functionality in their premium editions and including further charges for additional options or feature packs. SQL Server Enterprise includes a range of capabilities for data integration, data management, data warehouse, data cleansing,and end-to-end business intelligence all included in the price.

Links:

Microsoft - Announcing SQL Server 2016

Microsoft -  Migrate from Oracle with free licenses

Microsoft -   SQL Server 2016 datasheet