Mindblown: a blog about philosophy.
-
Install VirtualBox Guest Additions on Linux
The following describes how to install the VirtualBox Guest Additions on Linux. NOTE: The following bash commands were tested on Ubuntu and may differ depending on the guest Linux OS. 1. Select from the menu Devices > Insert Guest Additions CD Image… to mount the ISO. 2. Run the following command to download the per-requisite […]
-
Write and Read Configuration Files Using Python
Configuration files are important in the storing of persistent data on the local disk and its retrieval for later use. The data could be in the form of an automated timestamp of last access or it could be user-entered information such as a name or personal user settings. In order to easily achieve this in […]
-
Use Dropbox to Host a Maven Repository
There are many Maven repository hosts that offer a free service if the project is open source software (OSS) such as Sonatype Nexus and JFrog Bintray. There are times where privacy is required, such as commercial or experimental code, however the price to host such projects is not viable. This is a guide to setup […]
-
OpenShift Cron Jobs
WARNING: This post was written when OpenShift 2 existed and is no longer relevant. The following is a guide to using Cron in an OpenShift application. OpenShift gives a simple out of the box solution to setup Cron using existing bash scripts. Requirements The following are required before reading the rest of this guide. OpenShift […]
-
Open Windows Folder Containing File from Eclipse
There are a number of times where the developer requires to look at the folder where project resources are stored. There are two ways though that a folder can be opened directly from Eclipse thus eliminating the need to navigate the project packages manually. Firstly, StartExplorer Eclipse plug-in is an easy way to implement this. […]
-
Windows Command – setx
Setx creates or modifies environment variables in the user or system environment, without requiring programming or scripting. The Setx command also retrieves the values of registry keys and writes them to text files. Setting Environment Variables Set environment variables permanently, Setx can be used to set Environment Variables for the machine (HKLM) or currently logged […]
-
Upload a File Using Selenium WebDriver
Web application testing is not only about the on-screen functionality but also involves interacting with external resources, such as images, documents and other media. To upload a file using Selenium, the file path is needed to be set in the input element control before submitting the form. On the form the control to inspect should […]
-
Remove Extra New Lines and Whitespace Using Java Regex
Sometimes when extracting text from another item may result in formatting issues that involve extra blank lines or leading/trailing whitespace on each line. This commonly occurs when extracting from HTML elements or XML documents. The following String regular expressions can fix the following issues. (?m) = multi-line mode The following removes the leading/trailing whitespace from […]
-
jQuery – Scroll to Top
Using anchors within the same page to navigate between sections is a good way to improve the user’s experience. However, this jump occurs in an instant and gives the user little feedback to indicate that the document position has changed. The use of animations can greatly improve the user experience and feedback by creating on-demand […]
-
Get the Parent Node of the Current Selenium WebElement
There are times that the parent is required from the child element. There are two options JavaScript or XPath: WebElement myElement = driver .findElement(By.id("myDiv")); WebElement parent = (WebElement) ((JavascriptExecutor) driver) .executeScript( "return arguments[0].parentNode;", myElement); WebElement myElement = driver.findElement(By.id("myDiv")); WebElement parent = myElement.findElement(By.xpath("..")); But what if the parent of the parent is required? The JavaScript would […]
Got any book recommendations?