17:07, 10th August 2018
Five things you (probably) don’t know you can do with a hash table in SAS
Hash tables in SAS are versatile tools capable of performing tasks beyond basic table lookups, such as supporting create, read, update and delete operations similar to a database, enabling data aggregation across multiple levels with minimal processing steps and allowing for parametrisation through macro language or data-driven techniques. They can manage memory constraints effectively using partitioning methods and often offer efficiency advantages over traditional SAS approaches for data management. These capabilities are explored in detail in a book authored by a SAS consultant with extensive experience in data warehouse and business intelligence applications, highlighting practical implementations and code examples.
13:42, 22nd July 2018
Environment variables in Windows are used to store configuration settings and paths, often accessed within batch files or command-line sessions and can be temporarily adjusted using the SET command or permanently modified with SETX. Common examples include %AppData%, %LocalAppData% and %Temp%, which point to user-specific directories, while others like %SystemRoot% and %ProgramFiles% reference system-wide locations. These variables are enclosed in percent signs and may contain letters, numbers and special characters, though they cannot begin with a numeral. Dynamic variables update automatically during use, while volatile ones are session-specific and stored in memory.
Environment variables are stored in the Windows registry under user or system settings and their precedence during process execution follows a defined order, with system variables taking priority over user-defined ones. Security considerations advise against using them for sensitive data, as inherited variables may expose information in crash logs or other contexts. Custom variables are often prefixed with an underscore or dollar sign to avoid conflicts with built-in names and tools like SET and SETX facilitate their management, though undocumented variables exist for advanced use cases.
22:37, 28th June 2018
Summary of SAS Macro Quoting Functions and the Characters They Mask
Macro quoting functions in SAS are used to mask special characters and symbols so they are treated as text rather than as part of the macro language. When an item is masked, its significance is typically restored automatically when it is passed to other parts of the SAS system, but manual unquoting may be required in specific cases. This is necessary if the masked value needs to retain its original meaning within the same macro, or if the way the word scanner processes the text leads to unexpected results. The %UNQUOTE function is employed to reverse the masking effect, allowing symbols to be interpreted correctly in contexts such as comparisons or data processing. Different macro quoting functions mask varying sets of characters, with some operating during compilation and others during execution, depending on the specific requirements of the task.
10:13, 25th June 2018
Unicode Consortium
The Unicode Consortium aims to ensure global access to language use on digital devices, offering technical resources such as standards, code charts and documentation, alongside opportunities for organisational and individual membership, character adoption and donations. It provides information on governance, licensing and intellectual property policies, along with updates on events, news and public engagement initiatives, supported by a global network of contributors and stakeholders.
12:23, 8th June 2018
Apache Groovy
Grails
Apache Groovy is a versatile, Java-like programming language for the JVM that combines dynamic and static typing to enhance developer productivity, offering features such as closures, meta-programming and support for domain-specific languages. It integrates seamlessly with Java and third-party libraries, enabling the creation of scripts, applications and testing tools with a syntax familiar to Java developers. Built on Groovy, the Grails framework provides a web application development environment leveraging Spring Boot, with conventions that simplify configuration and support for REST APIs, asynchronous programming and front-end technologies like React and Angular. Both Groovy and Grails benefit from a rich ecosystem of plugins, tools and community resources and are maintained as open-source projects under the Apache Software Foundation, fostering collaboration and innovation in JVM-based software development.
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.