Technology Tales

Notes drawn from experiences in consumer and enterprise technology

09:58, 28th May 2018

PHP Tutorial: Dynamically Cache and Combine All CSSĀ Files

Loading multiple CSS files on a webpage requires separate browser requests for each file, which can slow down page performance. A caching system that combines all CSS files into a single cached file can improve response times. A cache is a snapshot of a file at a specific moment, most useful for files that remain relatively static, making CSS files ideal candidates since they change infrequently. The implementation involves creating two files in the stylesheet directory: cache.css to store the combined content and cache.php to manage generation and delivery of the cached content. The PHP script monitors the modification dates of specified CSS files and regenerates the cache whenever any source file is updated more recently than the existing cache. The page header then references only the single cache.php file instead of multiple individual stylesheets, reducing the number of browser requests from several to just one. The PHP code reads all designated CSS files, writes their combined contents to the cache file and serves the result with the proper content type header. Initial setup requires configuring the file paths and permissions, updating the page headers to reference the new cache file and ensuring at least one stylesheet has been modified to trigger initial cache generation.

23:18, 12th May 2018

HTML ISO Country Codes Reference

HTML country codes serve as standardised two-character additions to language codes in the lang attribute, allowing web developers to specify both the language and geographical region of their pages. When combined with a language code, such as in the example "en-US" for English in the United States, these ISO codes help browsers and search engines better understand the intended audience and regional context of web content. The system encompasses codes for virtually every nation and territory globally, from Afghanistan (AF) to Zimbabwe (ZW), providing a comprehensive framework for international web development. This specification proves particularly valuable for sites targeting multiple regional markets or those requiring precise localisation, as it enables proper rendering of regional variations in spelling, currency formats and other locale-specific content.

23:15, 12th May 2018

HTML Language Code Reference

The lang attribute should be included in the HTML tag to specify the language of a web page, which helps search engines and browsers properly interpret content. This declaration follows the ISO 639-1 standard, which provides two-letter abbreviations for languages such as "en" for English, "fr" for French, "de" for German and "zh" for Chinese. In standard HTML, the attribute appears as lang within the opening HTML tag, whilst XHTML requires both lang and xml:lang attributes along with the proper namespace declaration. The ISO standard covers hundreds of languages from widely spoken ones like Spanish and Arabic to less common languages like Cornish and Ndonga, with some languages like Chinese having additional codes to distinguish between simplified and traditional variants. Properly declaring the language ensures that content is indexed correctly and improves the browsing experience for users across different linguistic contexts.

10:36, 8th May 2018

CSS Styling of Tables

CSS provides numerous properties to enhance the visual presentation of HTML tables, primarily through border control and spacing adjustments. The border property allows developers to define the width, style and colour of table borders for table, th and td elements, though this initially creates double borders because each element maintains separate borders. The border-collapse property resolves this issue by merging borders into a single line when set to collapse, whilst the separate value maintains distinct borders for each cell. Spacing can be controlled through the padding property, which manages the distance between cell borders and their content, and the border-spacing property, which adjusts the gap between adjacent cell borders when using separated borders. For tables requiring only an outer border without internal divisions, developers can apply the border property exclusively to the table element itself, leaving the th and td elements unstyled.

10:33, 27th March 2018

How do I unzip multiple / many files under Linux?

When attempting to extract multiple zip files on Linux using the command unzip *.zip, users often encounter an error stating "caution: filename not matched" because the shell expands the wildcard before passing it to the unzip command, causing the program to search for files within the first archive rather than processing each archive separately. To resolve this issue, the wildcard must be protected from shell expansion either by enclosing it in single quotes as unzip '*.zip' or by escaping it with a backslash as unzip \*.zip, both of which allow the unzip program itself to handle the pattern matching.

Alternatively, a bash for loop can be employed with the syntax for z in \*.zip; do unzip "$z"; done, which is particularly useful for handling filenames containing spaces or special characters when proper quoting is applied. More complex scenarios involving filenames with unusual characters can be addressed by combining the find command with a while loop and bash arrays to safely process each file, whilst password-protected archives can be handled by adding the -P option followed by the password, though this method is insecure as the password becomes visible to other system users. The key distinction between these methods lies in whether the shell or the unzip program performs the wildcard expansion, with the escaped or quoted approaches being more concise whilst the loop-based solutions offer greater flexibility for additional processing tasks.

11:11, 17th March 2018

RVM

Ruby Version Manager is a command-line tool designed to simplify the installation, management and use of multiple Ruby environments, enabling users to handle different versions of Ruby and associated gem dependencies efficiently. It supports creating isolated, self-contained environments for projects, reducing conflicts between dependencies and ensuring consistency across development, testing and production settings. By allowing the use of named gemsets, RVM facilitates the management of gems specific to individual projects or environments, minimising repository bloat and optimising workflow. The tool also aids in testing applications across various Ruby versions simultaneously, enhancing compatibility checks and development reliability. Maintained by a community of contributors, RVM provides extensive documentation and integration options, promoting secure, user-level Ruby usage that minimises system risks and streamlines deployment processes.

14:53, 8th February 2018

Hstr

HSTR, also known as HiSToRy, is an open-source command line utility for bash and zsh that provides an improved terminal user interface for viewing, navigating, searching and managing shell command history, positioning itself as a more capable alternative to the built-in Ctrl-r shortcut. It supports features such as bookmarking favourite commands and removing sensitive or outdated entries from history, and is available across a wide range of Linux distributions as well as macOS.

Exa

The EXA Language Server is a separate, much smaller project that provides language server functionality for EXA, the programming language used in the Zachtronics game EXAPUNKS, with its implementation powered by Tree-sitter and licensed under the MIT Licence.

23:29, 22nd October 2017

Zend

Zend provides enterprise-grade PHP platform development and services designed to keep mission-critical PHP applications secure, performant and supported. The company offers ZendPHP runtimes with backported security patches and long-term support for end-of-life PHP versions including 7.2, 7.3, 7.4 and 8.0, alongside dedicated round-the-clock support and container-ready, cloud-ready images. ZendHQ delivers monitoring and management capabilities through real-time root cause analysis, custom alerts, job automation and improved background task performance. Professional services include migration and modernisation support, consultative guidance, flexible service hours and continuous performance monitoring. The Zend Enterprise Web Platform combines platform-as-a-service simplicity with custom configuration, real-time observability, autoscaling, declarative deployments and security-first architecture built on hardened images, allowing organisations to deploy anywhere whilst maintaining compliance without operational overhead.

20:01, 16th October 2017

Using the DATA step debugger in SAS Enterprise Guide

The introduction of a DATA step debugger in SAS Enterprise Guide 7.13 offers users a tool to trace program execution, monitor variable changes and set breakpoints within code, enhancing the debugging process for complex data transformations. While it supports interactive debugging with features such as watch windows and conditional breakpoints, it has limitations, including incompatibility with certain procedures like PROC SQL and input statements and the inability to detect compile-time errors. Users can activate the debugger through the program editor, though some have reported issues with breakpoint functionality in specific contexts. The tool leverages the /ldebug option, which is also accessible in SAS Studio through interactive mode, though its interface remains basic. Feedback from users highlights its utility for understanding data flow and identifying runtime issues, though suggestions for improvements such as in-editor code editing and more intuitive command shortcuts have been noted. The feature reflects ongoing efforts to modernise SAS tools, though its availability in other environments like University Edition remains limited.

19:59, 16th October 2017

SAS 9.4 System Options: Reference

This documentation hub provides comprehensive programming guidance for SAS 9.4 and SAS Viya 3.5, covering a broad range of topics essential for working with these statistical software platforms. The material encompasses data access methods, base procedures, DATA step programming, debugging techniques, global statements and system options that control how SAS operates. Additional coverage includes DS2 and FedSQL programming languages, macro language functionality, output and graphics generation, and various operating environment considerations. The documentation also addresses specialised areas such as in-database technologies, metadata management, security protocols, server administration and data quality processes. Supporting materials include programming tutorials for those learning SAS, alongside administrative guides for both SAS 9.4 and Viya platforms, with particular emphasis on system options that allow users to customise their SAS sessions through procedures like OPTIONS, OPTLOAD and OPTSAVE.

  • The content, images, and materials on this website are protected by copyright law and may not be reproduced, distributed, transmitted, displayed, or published in any form without the prior written permission of the copyright holder. All trademarks, logos, and brand names mentioned on this website are the property of their respective owners. Unauthorised use or duplication of these materials may violate copyright, trademark and other applicable laws, and could result in criminal or civil penalties.

  • All comments on this website are moderated and should contribute meaningfully to the discussion. We welcome diverse viewpoints expressed respectfully, but reserve the right to remove any comments containing hate speech, profanity, personal attacks, spam, promotional content or other inappropriate material without notice. Please note that comment moderation may take up to 24 hours, and that repeatedly violating these guidelines may result in being banned from future participation.

  • By submitting a comment, you grant us the right to publish and edit it as needed, whilst retaining your ownership of the content. Your email address will never be published or shared, though it is required for moderation purposes.