Technology Tales

Notes drawn from experiences in consumer and enterprise technology

01:55, 5th March 2015

The FINDSTR command is a utility used to search for text patterns within files using regular expressions, offering options to specify search criteria such as case sensitivity, line positions and file locations. It supports parameters like /b for matching patterns at the beginning of a line, /i for case-insensitive searches and /s to include subdirectories, while allowing users to define search terms directly or read them from external files. Examples demonstrate its use in locating specific words, patterns, or lines within files, including the ability to filter results by line numbers, file names, or seek offsets, making it a versatile tool for text analysis in command-line environments.

01:51, 5th March 2015

How to Read the Value of an HTTP Header

Reading HTTP header values requires only a few lines of server-side scripting code, with the implementation varying slightly across different programming languages. In ASP, both VBScript and JScript access headers through the Request.ServerVariables collection, using the format HTTPx where x represents the header name with hyphens replaced by underscores. Java Servlet and JSP environments utilise the getHeader() method of the HttpServletRequest object, passing the header name directly with hyphens intact. Perl stores header values in the %ENV hash, again replacing hyphens with underscores and prefixing with HTTP. PHP follows a similar pattern to ASP and Perl, storing headers in the $_SERVER array with the same naming convention as HTTP_x with underscores replacing hyphens. Each language offers additional pre-defined server environment variables beyond these HTTP headers, though these fall outside the scope of basic header retrieval for user agent and device capability detection purposes.

17:06, 9th December 2014

LIBNAME Statement Syntax :: SAS/ACCESS 9.3 Interface to PC Files: Reference

The LIBNAME statement in SAS can be used to associate a library reference with external data sources such as Microsoft Excel or Access files, enabling interaction with these files as if they were SAS datasets. It requires specifying a library name, an engine name corresponding to the file type and optionally a physical path and filename, though the file extension often suffices to identify the engine. Connection options like PATH, INIT and PROMPT allow customisation of how SAS connects to the data, while specific parameters for Access and Excel files handle security settings, version compatibility and database interactions. The statement also supports clearing or listing library attributes, facilitating dynamic access to external data objects through SAS procedures and data steps.

19:14, 8th November 2014

The SQL LIKE Condition enables pattern matching in queries using wildcards such as %, which matches any string length and _, which matches a single character, with syntax allowing optional escape characters for literal wildcard use. It is commonly used in WHERE clauses for filtering data and is case-insensitive for string comparisons, though care is needed with char data types due to trailing space padding that may affect results. Examples demonstrate its application in selecting records based on partial matches, excluding specific patterns with NOT and escaping special characters for precise searches. Additionally, combining LIKE with functions like UPPER can facilitate case-insensitive searches, ensuring flexibility in querying diverse data formats.

19:59, 31st May 2007

Being a Safari subscriber, I found a pleasant surprise awaiting me in this month's email newsletter: eBooks from SAS Books are now available on Safari. Having a brief look, I found a small but useful selection. Topics like the SQL procedure, the Macro language and Enterprise Guide caught my eye, but there's more than this on offer. It'll be interesting to see where this leads...

19:45, 25th April 2007

Until SAS 9.2, SAS/Access will not support the Oracle timestamp format. There still is no word on when 9.2 might appear, so it's over to the SQL pass-through facility...

18:40, 21st March 2007

What I never realised was that PHP could do image generation, and it's an intriguing possibility that I may yet use myself. This useful ability comes courtesy of GD, and this is included in some PHP distributions.

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