Technology Tales

Adventures & experiences in contemporary technology

Shrinking title bar search box in Microsoft Office 365 applications

6th December 2019

Shrinking title bar search box in Microsoft Office 365 applications

It might be a new development but I only recently spotted the presence of a search box in the titles of both Microsoft Word and Microsoft Excel that I have as part of an Office 365 subscription. Though handy for searching file contents and checking on spelling and grammer, I also realised that the boxes take up quite a bit of space and decided to see if hiding them was possible.

Shrinking title bar search box in Microsoft Office 365 applications

In the event, I found that they could be shrunk from a box to an icon that expanded to pop up a box when you clicked on them. Since I did not need the box to be on view all the time, that outcome was sufficient for my designs though it may not satisfy others who want to hide this functionality completely.

Shrinking title bar search box in Microsoft Office 365 applications

To get it, it was a matter of going to File > Options and putting a tick in the box next to the Collapse the Microsoft Search box by default entry in the General tab before clicking on the OK button. Doing that freed up some title bar space as desired and searching is only a button press away.

Compressing an entire dataset library using SAS

26th September 2019

Turning dataset compression for SAS datasets can produce quite a reduction in size so it often is standard practice to do just this. It can be set globally with a single command and many working systems do this for you:

options compress=yes;

It also can be done on a dataset by dataset option by adding (compress=yes) beside the dataset name on the data line of a data step. The size reduction can be gained retrospectively too but only if you create additional copies of the datasets. The following code uses the DATASETS procedure to accomplish this end at the time of copy the datasets from one library to another:

proc datasets lib=adam nolist;
copy inlib=adam outlib=adamc noclone datecopy memtype=data;
run;
quit;

The NOCLONE option on the COPY statement allows the compression status to be changed while the DATECOPY one keeps the same date/time stamp on the new file at the operating system level. Lastly, the MEMTYPE=DATA setting ensures that only datasets are processed while the NOLIST option on the PROC DATASETS line suppresses listing of dataset information.

It may be possible to do something like this with PROC COPY too but I know from use that the option presented here works as expected. It also does not involve much coding effort, which helps a lot.

Using NOT IN operator type functionality in SAS Macro

9th November 2018

For as long as I have been programming with SAS, there has been the ability to test if a variable does or does not have one value from a list of values in data step IF clauses or WHERE clauses in both data step and most if not all procedures. It was only within the last decade that its Macro language got similar functionality with one caveat that I recently uncovered: you cannot have a NOT IN construct. To get that, you need to go about things in a different way.

In the example below, you see the NOT operator being placed before the IN operator component that is enclosed in parentheses. If this is not done, SAS produces the error messages that caused me to look at SAS Usage Note 31322. Once I followed that approach, I was able to do what I wanted without resorting to older more long-winded coding practices.

options minoperator;

%macro inop(x);

%if not (&x in (a b c)) %then %do;
%put Value is not included;
%end;
%else %do;
%put Value is included;
%end;

%mend inop;

%inop(a);

Running the above code should produce a similar result to another featured on here in another post but the logic is reversed. There are times when such an approach is needed. One is where a small number of possibilities is to be excluded from a larger number of possibilities. Programming often involves more inventive thinking and this may be one of those.

Smarter file renaming using PowerShell

14th November 2014

It seems that the Rename-Item commandlet in Powershell is a very useful tool when it comes to smarter renaming of files. Even text substitution is a possibility and what follows is an example that takes the output of the Dir command for listing the files in a directory and replaces hyphens with underscores in each one.

Dir | Rename-Item –NewName { $_.name –replace “-“,”_” }

The result is that something like the-file.txt becomes the_file.txt. This behaviour is reminiscent of the rename command found on Linux and UNIX systems, where regular expressions can be used like in the following example that has the same result as the above:

rename ‘s/-/_/g’ *

In both cases, you do need to be careful as to what files are in a directory for this though the wildcard syntax on Linux or UNIX will be more familiar who has worked with files via almost any command line. Another thing to watch in the UNIX world is that ** parses the whole directory structure and that could be something that is not wanted for much of the time.

All of this is a far cry from the capabilities of the ren or rename command used in the days of MS-DOS and what has become the legacy Windows command line. Apart from simple renaming, any attempt at tweaking a filename through substitution ended up with the extra string getting appended to filenames when I tried it. Thus, the Powershell option looks better in comparison.

Turning off the full height editor option in WordPress 4.0

10th September 2014

Though I keep a little eye on WordPress development, it is no way near as rigorous as when I submitted a patch that got me a mention on the contributor list of a main WordPress release. That may explain how the full editor setting, which is turned on by default passed by on me without my taking much in the way of notice of it.

WordPress has become so mature now that I almost do not expect major revisions like the overhauls received by the administration back-end in 2008. The second interface was got so right that it still is with us and there were concerns in my mind at the time as to how usable it would be. Sometimes, those initial suspicions can come to nothing.

However, WordPress 4.0 brought a major change to the editor and I unfortunately am not sure that it is successful. A full height editor sounds a good idea in principle but I found some rough edges to its present implementation that leave me wondering if any UX person got to reviewing it. The first reason is that scrolling becomes odd with the editor’s toolbar becoming fixed when you scroll down far enough on an editor screen. The sidebar scrolling then is out of sync with the editor box, which creates a very odd sensation. Having keyboard shortcuts like CTRL+HOME and CTRL+END not working as they should only convinced me that the new arrangement was not for me and I wanted to turn it off.

A search with Google turned up nothing of note so I took to the WordPress.org forum to see if I could get any joy. That revealed that I should have thought of looking in the screen options dropdown box for an option called “Expand the editor to match the window height” so I could clear that tickbox. Because of the appearance of a Visual Editor control on there, I looked on the user profile screen and found nothing so the logic of how things are set up is sub-optimal.  Maybe, the latter option needs to be a screen option now too. Thankfully, the window height editor option only needs setting once for both posts and pages so you are covered for all eventualities at once.

With a distraction-free editing option, I am not sure why someone went for the full height editor too. If WordPress wanted to stick with this, it does need more refinement so it behaves more conventionally. Personally, I would not build a website with that kind of ill-synchronised scrolling effect so it is something needs work as does the location of the Visual Editor setting. It could be that both settings need to be at the user level and not with one being above that level while another is at it. Until I got the actual solution, I was faced with using distraction-free mode all the time and also installed the WP Editor plugin too. That remains due to its code highlighting even if dropping into code view always triggers the need to create a new revision. Despite that, all is better in the end.

Customising Nautilus (or Files) in Ubuntu GNOME 13.04

12th September 2013

The changes made to Nautilus, otherwise known as Files, in GNOME Shell 3.6 were contentious and the response of the Linux Mint was to create their own variant called Nemo from the previous version of the application. On the Cinnamon or MATE desktop environments, the then latest version of GNOME’s file manager would have looked like a fish out of water without its application menu in the top panel on the GNOME Shell desktop. It is possible to make a few modifications that help Nautilus to look more at home on those Linux Mint desktops and I have collected them here because they are useful for GNOME Shell users too. Here they are in turn.

Adding Application Menu entries to Location Options Menu

The Location Options menu is what you get on clicking the button with the cog icon on the right-hand side of the application’s location bar. Using Gsettings, it is possible to make that menu include the sort of entries that are in the application menu in the GNOME Shell panel at the top of the screen. These include an entry for closing the whole application as well as setting its preferences (or options). Running the following command does just that (if it does not work as it should, try changing the single and double quotes to those understood by a command shell):

gsettings set org.gnome.settings-daemon.plugins.xsettings overrides '@a{sv} {"Gtk/ShellShowsAppMenu": <int32 0>}'

Adding in the Remove App Menu GNOME Shell extension will clean up the GNOME Shell a little by removing the application menu altogether. If, for some reason, you wish to restore the default behaviour, then the following command does the required reset:

gsettings set org.gnome.settings-daemon.plugins.xsettings overrides '@a{sv} {}'

Stopping Hiding of the Application Title Bar When Maximised

By default, GNOME Shell can hide the application title bars of GNOME applications such as Nautilus on window maximisation and this is Nautilus now works by default. Changing the behaviour so that the title bar is kept on maximised windows can be as simple as adding in the ignore_request_hide_titlebar extension. The trouble with GNOME Shell extensions is that they can stop working when a new version of GNOME Shell is used, so there’s another option: editing metacity-theme-3.xml but /usr/share/themes/Adwaita/metacity-1. The file can be opened using superuser privileges using the following command:

gksudo gedit /usr/share/themes/Adwaita/metacity-1/metacity-theme-3.xml

With the file open, it is a matter of replacing instances of ' has_title="false" ' with ' has_title="true" ', saving it and reloading GNOME Shell. This may persevere across different versions of GNOME Shell should the extension not do so.

Disabling Recursive Search

This discovery is what led me to bundle these customisations in an entry on here in the first place. In Nemo and older versions of Nautilus, just typing with the application open would lead you down a list towards the file that you wanted. This behaviour was replaced by an automatic recursive search from GNOME Shell 3.6 where the search functionality was extended beyond the folder that was open in the file manager to its subdirectories. To change that to subsetting within the open folder or directory, you need to install a patch version of Nautilus using the following commands:

sudo add-apt-repository ppa:dr3mro/personal
sudo apt-get update && sudo apt-get upgrade

The first of these adds a new repository with the patched version of Nautilus while the second combination installs the patched version. With that done, it is time to issue the following command:

gsettings set org.gnome.nautilus.preferences enable-recursive-search false

That sets the value of the new enable-recursive-search option to false for searching within an open directory. It also can be found using Dconf-Editor in the following hierarchy: org -> gnome -> nautilus -> preferences. The obsession of the GNOME project team with minimalism is robbing users of some options and this would be a good one to have by default too. Maybe the others should be treated in the same way even if you need to use Gsettings or Dconf-Editor to change them to avoid clutter. Having GNOME Tweak Tool able to set them all would be even better.

A look at Windows 8.1

4th July 2013

Last week, Microsoft released a preview of Windows 8.1 and some hailed the return of the Start button but the reality is not as simple as that. Being a Linux user, I am left wondering if ideas have been borrowed from GNOME Shell instead of putting back the Start Menu like it was in Windows 7. What we have got is a smoothing of the interface that is there for those who like to tweak settings and not available be default. GNOME Shell has been controversial too so borrowing from it is not an uncontentious move even if there are people like me who are at home in that kind of interface.

What you get now is more configuration options to go with the new Start button. Right clicking on the latter does get you a menu but this is no Start Menu like we had before. Instead, we get a settings menu with a “Shut down” entry. That’s better than before, which might be saying something about what was done in Windows 8, and it produces a sub-menu with options of shutting down or restarting your PC as well as putting it to sleep. Otherwise, it is place for accessing system configuration items and not your more usual software, not a bad thing but it’s best to be clear about these things. Holding down the Windows key and pressing X will pop up the same menu if you prefer keyboard shortcuts and I have a soft spot for them too.

New Windows 8.1 Options

The real power is to be discovered when you right click on the task bar and select the Properties entry from the pop-up menu. Within the dialogue box box that appears, there is the Navigation tab that contains a whole plethora of interesting options. Corner navigation can be scaled back to remove the options of switching between applications at the upper left corner or getting the charms menu from the upper right corner. Things are interesting in the Start Screen section. This where you tell Windows to boot to the desktop instead of the Start Screen and adjust what the Start button gives you. For instance, you can make it use your desktop background and display the Start Screen Apps View. Both of these make the new Start interface less intrusive and make the Apps View feel not unlike the way GNOME Shell overlays your screen when you hit the Activities button or hover over the upper left corner of the desktop.

It all seems rather more like a series of little concessions and not the restoration that some (many?) would prefer. Classic Shell still works for all those seeking an actual Start Menu and even replaces the restored Microsoft Start button too. So, if the new improvements aren’t enough for you, you still can take matters into your own hands until you start to take advantage of what’s new in 8.1.

Apart from the refusal to give us back a Windows 7 style desktop experience, we now have a touchscreen keyboard button added to the taskbar.So far, it always appears there even when I try turning it off. For me, that’s a bug and it’s something that I’d like to see fixed before the final release.

All in all, Windows 8.1 feels more polished than Windows 8 was and will be a free update when the production version is released. My explorations have taken place within a separate VMware virtual machine because updating a Windows 8 installation to the 8.1 preview is forcing a complete re-installation on yourself later on. There are talks about Windows 9 now but I am left wondering if going for point releases like 8.2, 8.3, etc. might be a better strategy for Microsoft. It still looks as if Windows 8 could do with continual polishing before it gets more acceptable to users. 8.1 is a step forward and more like it may be needed yet.

Installing the Cinnamon Desktop Environment on Sabayon Linux

26th January 2013

During the week, I did an update on my Sabayon system and GNOME 3.6 came on board without to much of a bother. There was no system meltdown or need for an operating system re-installation. However, there was one matter that rankled: adding and updating extensions from extensions. gnome.org was impossible. The process would create a new folder in ~/.local/share/gnome-shell/extensions/  but not fill it with anything at all. Populating from another my Ubuntu GNOME Remix 12.10 machine didn’t seem to achieve the needful and I am left wondering if it is down to the version of GNOME Shell being 3.6.2. However, even adding an entry for the current version of GNOME Shell to metadata.json for one plugin didn’t appear to do what I wanted so resolving this issue needs further enquiry.

In the meantime, I added the Cinnamon desktop environment using the following command and will be using that from now on. If the GNOME Shell extension issue ever gets sorted I may move back but there is no rush. GNOME 3.8 sounds like it’s bringing an interesting option that makes use of the approach Linux Mint took for version 12 of that distribution and I can await that, especially if it avoids the need for adding extension on a personal basis like now.

sudo equo update && sudo equo install cinnamon

With the installation completed by the above command, it was a matter of logging out and choosing the Cinnamon entry (there is a 2D version too) from the session dropdown menu on the login screen to get it going. Then, it was a matter of tweaking Cinnamon to my heart’s content. Getting a two panel layout required logging out and in again as well as choosing the appropriate setting in the Cinnamon Panel options tab. Next, I decided to check on what themes are available at cinnamon.linuxmint.org before settling on Cinnamint 1.6. It all feels very comfortable apart from not having an automatically growing list of workspaces that are a default offering in GNOME Shell. That goes against the design principles of Cinnamon though so only hopes of someone making an extension that does that are left.

Using the IN operator in SAS Macro programming

8th October 2012

This useful addition came in SAS 9.2 and I am amazed that it isn’t enabled by default. To accomplish that, you need to set the MINOPERATOR option unless someone has done it for you in the SAS AUTOEXEC or another configuration program. Thus, the safety first approach is to have code like the following:

options minoperator;

%macro inop(x);

%if &x in (a b c) %then %do;
%put Value is included;
%end;
%else %do;
%put Value not included;
%end;

%mend inop;

%inop(a);

Also, the default delimiter is the space, so if you need to change that, then the MINDELIMITER option needs setting. Adjusting the above code so that the delimiter now is the comma character gives us the following:

options minoperator mindelimiter=",";

%macro inop(x);

%if &x in (a,b,c) %then %do;
%put Value is included;
%end;
%else %do;
%put Value not included;
%end;

%mend inop;

%inop(a);

Without any of the above, the only approach is to have the following and that is what we had to do for SAS versions prior to 9.2:

%macro inop(x);

%if &x=a or &x=b or &x=c %then %do;
%put Value is included;
%end;
%else %do;
%put Value not included;
%end;

%mend inop;

%inop(a);

It may be clunky but it does work and remains a fallback in newer versions of SAS. Saying that, having the IN operator available makes writing SAS Macro code that little bit more swish so it’s a good thing to know.

Open source CMS options

18th March 2007

After reading an article in the latest issue of PC Plus, I got curious about the world of content management systems again. I went over to OpenSourceCMS to sample the CMS demos that they have got on there. Mambo and Joomla! are fully fledged CMS’s and look impressive too, though how they would fit into my online presence is something of an open question. I spied that PHP-Nuke uses themes so that is an attraction; I am already used to that mindset thanks to WordPress. Drupal seems to be less slick than the others but that could be an attraction of itself; it does offer themes but no rich text editing is available.

All of the above are base upon PHP/MySQL but I ignored them for some reason when I last took a look at open source CMS’s. That does seem a strange thing to do but this was a while ago and the moderate cost of adding database functionality to my website was not something that I was willing to pay, though I have done so since for HennessyBlog. I therefore ended up taking a look at Plone (built on Zope and using the Python programming language). What I was had in mind at the time was a replacement for Perl-powered photo gallery and a CMS was never going to fit the bit; it still doesn’t. In any case, I like coexistence of website components on a single server and Plone left me with the impression that it was an all or nothing affair. Things may have changed since so giving it another go remains an option.

I have now decided to take a look at Drupal but the emphasis this time is not on using it as a photo gallery platform; if I wanted that, I’d go with the API for something like Flickr or Zooomr. This time, the emphasis on using a CMS to manage the visitor information directories on my website. It does coexist with the other website components, including WordPress and the aforementioned bespoke built photo gallery. Interestingly, Drupal does offer blogging functionality if I wanted it.

Set up involved a spot of work with mySQL before moving onto other things:

mysql -u adminuserid -p /* logging in*/

create database drupal; /*creating new database*/

grant ALL on drupal.* to adminuser identified by “**********” /* granting access to new database */

quit; /* exiting */

I prefer command line working with mySQL; it is easier to see what’s going on (not wrong, hopefully). For some reason, Drupal comes only in tar.gz archives but I extracted this into the web server directory and opened up the site in Firefox. Installation only requires set up of database access and is very quick. A few things turned up in the status report that needed attention: cron, this can be run manually; activation of PHP Unicode and GD library (PHP’s gd_info function is a real help in testing this) extensions, editing of php.ini to remove commenting semicolons activated them and restarting Apache made them available; having a place to store uploads, the directory files was created.

I have since set about bending it to my will, not always an easy thing to do with software. The first thing to do was to give it a static home page. By default, Drupal places tasters for any nominated pages and stories on its home page and shows configuration instructions until you allow some content to filter through. However, adding the Front Page module allows you to override this behaviour and have something more static. It was an entry on Kehan’s Blog that set me heading in the right direction.

The next steps are be to persuade the thing to allow external links to exist in menus (patches exist but I have yet to learn how to apply them other than finding the nefarious piece of code and replacing, a considerable challenge that makes me wonder if there is not a better way to do it: with a module, perhaps?) and carry on the theme editing until it ties in with the rest of my site. Then, I’ll make the decision as to whether to replace my current work flow (Perl-powered pre-processing of XML into PHP/XHTML using XSLT and the Saxon parser followed by FTP upload to the web server) with this one. The automation of the former argues in its favour. We’ll see how things pan out…

  • All the views that you find expressed on here in postings and articles are mine alone and not those of any organisation with which I have any association, through work or otherwise. As regards editorial policy, whatever appears here is entirely of my own choice and not that of any other person or organisation.

  • Please note that everything you find here is copyrighted material. The content may be available to read without charge and without advertising but it is not to be reproduced without attribution. As it happens, a number of the images are sourced from stock libraries like iStockPhoto so they certainly are not for abstraction.

  • With regards to any comments left on the site, I expect them to be civil in tone of voice and reserve the right to reject any that are either inappropriate or irrelevant. Comment review is subject to automated processing as well as manual inspection but whatever is said is the sole responsibility of the individual contributor.