Posts

MS Office Word - copy text and it puts OLE bookmarks - a handy macro to stop this

Image
Have you recently found that copying something in Microsoft Word causes the copied text to have grey square brackets surround it? These brackets are showing because the "show bookmarks" option is enabled. Indeed you may want to keep that option enabled, as you have other bookmarks that you want to see while editing. The new bookmarks are being created with a certain naming format, they are sequentially numbered and are named like "OLE_LINK##". These bookmarks are automatically created by Word. Here is a macro to automatically delete the bookmarks straight after they're created. It doesn't delete other bookmarks, only the ones that start with "OLE_LINK". The best place to put this is in the Normal.dot file. To find this, enable the Developer tab in the ribbon, and then click on the Visual Basic button. In there you can find a file called "ThisDocument" inside the "Normal" heading. Inside that file just put the following...

Keep the monitor display brightness the same when the power source is changed to battery/charging

When using a laptop you usually have to adjust the screen's brightness based on the ambient lighting conditions. However, when plugging/unplugging the power supply Windows will change the brightness again. This can be a poor user experience, for example the reason for plugging it in was just to charge it, not to change the brightness. Here is a PowerShell v3.0+ script and Windows Task Scheduler config file for fixing this issue. The schedule will run at system startup, and just runs the script. The PowerShell script will register a script block to some Windows events. One is the brightness change event, so when the user manually changes the screen brightness it will save that value to a temp file. The other event is when the power supply is changed to battery/charging, it will change the value back from the saved temp file. Here's the PowerShell script, just copy this into a Notepad and save as "C:\Battery power display brightness.ps1".

PowerShell modules

Overview of PowerShell Modules A module in PowerShell is basically a script with exposed members, such as Functions and Variables. It's best for a specific module to serve a singular purpose. There are four kinds of PowerShell module. (As documented in this Microsoft link:  click here .) Script Modules -- PSM1 files that usually contain functions, but can contain any valid PowerShell code. Binary Modules -- Compiled DLL files, which can be created in .NET languages like C#, F# or VB. Manifest Modules -- These are Script Modules which contain a manifest. Dynamic Modules -- In memory modules which haven't been persisted to permanent storage. How To Create A PowerShell Module At the basic level, a PowerShell module is a text file with a ".psm1" extension. Here's an example: # A private variable. $prefix = 'Some text' Function Get-Prefix {     $prefix } Function Append-Prefix ($suffix) {     $prefix + $suffix } Function Hidden...

Android Preferences Time Picker

When developing the preferences page for an Android app you can add a time picker with this class. import android.content.*; import android.content.res.*; import android.preference.*; import android.util.*; import android.view.*; import android.widget.*; import java.text.*; import java.util.*; /* * Use in preferences.xml like this: *   <net.intrepidis.library.prefs.TimePreference *       android:key="mytime_preference" *       android:title="@string/mytime_preftitle" *       android:summary="@string/mytime_prefsummary" *       android:defaultValue="00:10" *       positiveButtonText="@string/ok_button" *       negativeButtonText="Close me" /> */ public class TimePreference extends DialogPreference { private final Calendar calendar; private final TimePicker p...

Uploader for Vimeo - Privacy Policy

Uploader for Vimeo stores only the paths to videos existing on your device while it has them pending for upload. It will only upload to Vimeo.com. No data is uploaded to any other server. Once upload has completed (or has been removed by the user) it will have all data about the video removed from the app's storage location. It uses OAuth2 to authenticate the user with Vimeo.com. Here is a link to the app on Google Play Store:  https://play.google.com/store/apps/details?id=net.intrepidis.vimeouploader

Why the XBox One Scorpio should be called "XBox X"

Here are some cast-iron reasons why Microsoft should christen their so called "XBox One Scorpio" as the XBox X . Be warned, these are merely the rantings of a crazed lunatic. Here goes: 1. It reinforces the fact that the XBox name was primarily taken from the X in DirectX (the 3D graphics API from Microsoft). Of course the X also has the meaning "this computing box can do X (anything)"!.. Much like the Play in PlayStation means "this entertainment station can Play anything (games, music, videos, apps, etc)". 2. The name when said aloud will sound like XBox Sex... A thing most boys owning the system will be dreaming about while sitting on their bed vigorously pounding their joystick. 3. The value 'x' in algebraic mathematics can be any number. This is good because Microsoft have trouble comprehending the function of numbers (a worrying fact for a computing company). Therefore they can circumvent the problem by saying "put any numbe...

Murdered: Soul Suspect - Mouth Bags and other books

Image
I've been playing the quite remarkable game "Murdered: Soul Suspect" and came across these books in the apartment where Ronan (the main character) has his last fight. You have to get very close to be able to see them. They have rather strange titles. On another note, I like the room you find these in. The girl that hid in there was kinda spiritual and it shows, by the crazy drawings on the floor, the dream catcher hanging from the ceiling, and paraphernalia she adorns her clothing with! And what the heck is that stuck to the side of the fridge, a strange picture of (what I guess is) a face with a green eye. Weird.