Technology Tales

Notes drawn from experiences in consumer and enterprise technology

18:51, 18th February 2022

Flask is a lightweight WSGI web application framework designed to facilitate rapid development and scalability, relying on dependencies such as Werkzeug, Jinja and Click. Its documentation provides comprehensive guidance on installation, a quick-start guide for initial setup and a detailed tutorial for building applications, alongside sections covering configuration, testing, error handling, deployment and security considerations. Additional resources include API references, explanations of design decisions, extension development practices and information on contributing to the project, with a focus on modular application structures, command-line interfaces and asynchronous capabilities through technologies like Gevent. The framework supports a range of features, from session management and template rendering to handling HTTP methods and deploying to production environments, while also addressing best practices for configuration, logging and application lifecycle management.

16:33, 18th February 2022

MySQL DELETE Query: How to Delete a Row from Table

The MySQL DELETE command is used to remove specific rows from a database table, with the WHERE clause allowing precise filtering to target particular entries. If omitted, all rows in the table are deleted, emphasising the need for caution and prior data backups to prevent irreversible loss. Examples demonstrate deleting individual records by specifying identifiers or multiple entries using the IN clause, highlighting the command's utility in managing obsolete or temporary data while underscoring the critical importance of ensuring data integrity through careful execution and backup practices.

11:06, 18th February 2022

MySQL Change a User Password Command Tutorial

Changing a MySQL or MariaDB user password on Linux, Unix, macOS and Windows systems can be achieved through several command line methods. The primary approach involves logging into the MySQL server as a root or admin user and running an ALTER USER command followed by a FLUSH PRIVILEGES command to reload the grant tables.

For older versions of MySQL, specifically 5.7.5 and earlier, the SET PASSWORD syntax or an UPDATE command targeting the mysql.user table can be used instead. An alternative method involves the mysqladmin command line tool, which allows password changes to be made directly from the shell without needing to enter the MySQL prompt.

It is worth noting that in MySQL 5.7 and later, the Password field in the user table was replaced with authentication_string, and FLUSH PRIVILEGES is not strictly necessary when using account management statements such as ALTER USER, as the server automatically reloads the grant tables in those cases.

15:48, 16th February 2022

Julia Programming: a Hands-on Tutorial

Julia is a free, open-source, general-purpose programming language originally developed by researchers at MIT, designed to combine the speed of compiled languages like C and Fortran with the ease of use associated with Matlab and Python. It achieves this through a just-in-time compiler, meaning code that appears interpreted runs at speeds comparable to fully compiled alternatives, often with significantly fewer lines of code required. The language supports optional typing, offers clean mathematical syntax and benefits from a thriving package ecosystem, making it particularly well-suited to scientific and engineering applications.

09:26, 15th February 2022

Hugo and Data: Advanced Manipulation with Slices and Maps

Advanced data manipulation in Hugo using Slices and Maps is a topic that receives little attention in the Hugo community, yet it is critical for building pages from remote sources such as API endpoints or Markdown files. Slices, which function as ordered arrays, can be created, appended to and filtered using built-in Hugo functions such as slice, append, uniq, first, last and where, while the index function allows retrieval of specific elements. Maps, which are associative arrays of key and value pairs, can be created using the dict function and combined using merge, with the reflect.IsSlice and reflect.IsMap functions available for type checking.

When slices and maps are combined, developers can construct structured data collections that can be browsed using range loops, filtered using where clauses with operators such as in and intersect, and sorted in ascending or descending order using the sort function. While hard-coding data in this way is useful for defining defaults and reusable bases, real-world projects typically draw data from external sources such as APIs or user-managed content files, with more advanced transformation techniques building upon these foundational concepts.

09:24, 14th February 2022

Add Sub Menu in Hugo Website

Hugo, the static site generator, does not natively support nested menu structures, but this can be achieved through a series of manual configuration and file creation steps. The process involves updating the config.toml file to define parent and child menu items using identifiers, names, URL's, weights and parent references, then creating or modifying a menu.html partial to render the nested structure using Hugo's built-in menu functions.

Styling is handled through custom CSS that manages the visibility and positioning of dropdown submenus across different screen sizes, and a JavaScript file is used to handle menu toggle behaviour for mobile views. Posts can be mapped to specific submenu items by applying matching tags in the front matter of each post, which Hugo then associates with the corresponding tag URL defined in the menu configuration. The approach is demonstrated using the Hugo Mainroad theme, so users of other themes may need to adapt the HTML, CSS and JavaScript to suit their particular setup.

19:42, 13th February 2022

Making Google Fonts Faster in 2022

Optimising font loading performance involves a balance between leveraging existing services like Google Fonts and implementing custom solutions for greater control. Strategies include preloading critical resources to ensure fonts are available early, in-lining essential CSS to enable quicker discovery of font requirements and using tools like subfont to automate font subsetting and optimisation. Hosting static assets on a reliable CDN can further enhance delivery speeds, especially for global audiences. While Google Fonts offers optimised variants and benefits from its extensive infrastructure, self-hosting allows for tailored control over file sises and caching strategies.

However, the decision to self-host should weigh the trade-offs between reduced file sises and the potential loss of shared caching benefits, which are no longer widely available due to browser security changes. Testing performance improvements through tools like WebPageTest is crucial to understanding the impact of each choice, ensuring that any adjustments align with the specific needs of the project and its users.

09:03, 11th February 2022

Tips for Customizing Hugo RSS Feed

Customising Hugo's RSS feed involves overriding its default template to tailor content inclusion. By modifying the template file located at layouts/_default/rss.xml, users can adjust the range expression to include all pages, filter by specific sections such as blog, or exclude non-post pages like section indices. Combining these adjustments allows for precise control, ensuring only relevant content appears in the feed. The final template typically includes metadata, item listings with titles, links, publication dates and content, structured to meet standard RSS format requirements while reflecting the site's specific needs.

21:14, 10th February 2022

R Graphical User Interface Comparison

A detailed comparison of nine graphical user interfaces (GUIs) for the R programming language evaluates each across four categories: ease of use, general usability, graphics and analytics. BlueSky Statistics and R-Instat rank closely together overall, though they differ greatly in their approaches and strengths. JASP leads on ease of use alongside Jamovi and BlueSky, while R-Instat tops the general usability and graphics categories, largely due to its extensive data wrangling capabilities and broad range of graph types. R Commander dominates the analytics category, benefiting from decades of development and 42 add-ons covering statistical, machine learning and artificial intelligence methods.

Each GUI has distinct characteristics: Jamovi offers an interactive interface with Bayesian analysis but limited data management; JASP excels at Bayesian methods but cannot display the R code it generates; Rattle focuses narrowly on machine learning; R AnalyticFlow supports flowchart-based workflows but lacks breadth in analysis methods; RKWard combines a point-and-click interface with an advanced development environment; and Deducer, despite an appealing interface, appears to have stalled in development. The comparison is intended to help users select the most appropriate tool for their needs, whether they are students, statisticians or data scientists.

09:51, 8th February 2022

broken-link-checker

This tool identifies broken links in HTML documents by scanning clickable elements, media references and other specified tags, while respecting robots.txt directives and excluding certain link types based on user-defined filters. It offers both command-line and API-based usage, allowing for custom configurations such as defining accepted protocols, setting rate limits and handling HTTP errors through retry mechanisms.

The package provides detailed feedback on each link's status, including reasons for exclusion or failure, and supports advanced features like checking external sites or parsing sitemaps in future updates. Designed for developers and SEO professionals, it operates under an MIT licence and is available as an NPM module, with ongoing improvements aimed at enhancing accuracy and usability in link validation tasks.

  • 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.