## How Much Does My Car Cost Per Mile?

I thought its time I put my GNUCash Data to good use and worked out how much I spent on fuel. I loaded up a simple Cash Flow bar chart in GNUCash and selected my expenses column for Car>Petrol and voila.

If you are astute you may have also noticed there are additional ‘fixed’ (varies annually/monthly) costs to running a car such as tax, insurance, maintenance and depreciation but I have chosen to eliminate these costs because I would like to explore the benefits of buying another car. We can use this graph based on the last 3 years to estimate this car, my 1998-1999 Vauxhall Corsa costs £73.88 monthly (excluding this month from the data)

## So How far does £74/month get you?

Good Question, I’ve always used my car when I’ve needed it. I have little reason not to use it. I’ve used it to commute to University, School and Work and on days out. It’s my main mode of transport is what I’m trying to say.

Unfortunately, I don’t keep the history of my car’s odometer, however, I can use the mot history of my car to estimate the £/per mile. Using the mot history, which has the date my car was taken in for MOT for two different dates recorded in the MOT history, one in 2017 and one in 2019, we can determine in that time I did 19,205 miles so roughly 6.66k miles a year.

We can then use this 19,205 miles, which have around 1 year, 11 months between them to get (74*23) £1,702 expenditure during that time, which compared with the actual data gives £2,051.23 (over £300 diff, 21%) gives us a fairly low confidence, however we can use this to estimate my cars cost per mile on fuel alone is around £0.106 per mile. 10p per mile (2051.23/19205) or 740 miles per month, give or take 20%. That’s 24 miles per day!

## My Submission for /r/badUIbattles February “Dating and Relationships”

Thought I’d post a quick one because I was bored. It uses Visual Studio 2019, WPF and that’s it. There’s very little business logic behind the whole thing.

🙂

TTFN, I don’t live in Dewsbury. I don’t even think I’ve been there.

## Inside a Western Digital Blue Hard Drive

I thought I’d share pictures I took when I took apart a 250GB dead hard drive.

#### Rest in pieces my WD2500AAKX

I got this hard drive as part of a Dell Optiplex 780 and used it as a server for my internal network. It worked great until it wouldn’t boot. I checked on it and sure enough, it was stuck in ubuntu server boot recovery. I tried to recover it but I think I did more damage than good. I decided to move to a Windows computer and tried to recover the data with Recuva which didn’t do anything because it couldn’t pick up the disk, so then I moved to TestDisk which was able to see the drive and partitions but never got past profiling the disk. So then I decided to take it apart.

First I unscrewed all the screws, there is another screw holding the read/write head under the label.

After that I took it apart a little more, it has one platter internally and one big old magnet which I kept.

Interestingly there seems to be a metal piece on the bottom and side of the hard drive which I think is for easy destruction. CrystalDiskInfo said it had 29202 hours on it and 2875 power ons, nearly exactly the same as my ST2000DM001-1CH164 T2B hard drive. The smart data also had warnings for its Reallocated Sectors Count.

It’s in the bin now. Thanks for reading.

Understanding that a customer has needs when using a good or service can allow a business to identify marketable opportunities for increasing profitability or maximizing revenues. For a large portion of customer focus, its about communication.

A customer focused approach can be adopted by many aspects of a business, such as;

• Sales
• Management
• Location
• Customer Service
• Marketing
• Growth and Extensibility

Many customers will have different needs and goals and there are many aspects to a business that may need to change to adopt a customer-first approach, but the payoff is;

• High Customer Retention
• Long Term Commitment
• Greater Profitability
• Greater Customer Satisfaction

However, adopting such an approach may also have some negative business consequences;

• Increased Spending
• Increased After-Sales spending
• Immediate responses and on-site negotiation
• Lower Profitability
• Harder Automation or lack there-of

## Providing a Customer-Focused Approach to Sales

Giving the customer what they want is paramount to ensuring a customer-focused approach. Customers usually can appreciate a hands-off approach to getting things done and are usually willing to pay extra for it. Providing a service that is better than the competition or providing greater pre-sales support increases, for example, through online-chat or in-person representation allows the business to increase their potential to close a sale and provide the customer greater satisfaction in their choice.

There are many ways to provide a custom approach to sales;

• Offer a product that is superior to competition – If your business is able to deliver a product better than the rest, you can capitalize on its potential to increase the customer’s satisfaction.
• Use Marketing that drives the customer toward package solutions – providing a complete service, rather than a means to an end will allow for greater satisfaction, and as a by-product greater opportunities for increased added value.
• Guide the customer – Inform the customer of any regulations or licensing that they may need, arrange to set that up for them as part of the service.
• Offer tertiary products that complement their purchase.
• Provide Pre-Sales service to ensure the customer is satisfied through demonstration or information.
• Understand the customer’s stated clear needs and objectives to provide a product they would be satisfied with.
• Know when the customer is ready to talk, and when they aren’t.
• Exceed the customer’s expectations.
• Develop relationships that the customer values.
• Offer solutions to suit the needs and concerns that the customer may have before purchase.
• Don’t be passive. Engage with the customer

Offering a way for the customer to reflect their satisfaction, through survey or metrics will allow a business to identify where they achieve, exceed or disappoint the expectations of the customer.

## Providing a Customer-Focused Approach to Management

A large part of Customer Focus for management staff and management, in general, is providing proper training for staff to fulfill the needs of the customer above and beyond their expectations,

• Management shouldn’t be a roadblock between the customer and the sales staff. Provide a framework that can be followed such as a budget or develop routine customer stories.
• Provide training to ensure the sales staff know what isn’t allowed.
• Use appropriate means of communication, don’t push for sales.
• Have measures in place to prevent abuse, A case study about continental found on average the lowest value customers whose flights were delayed were receiving the highest compensation.
• Know your market segment and the needs of the customers, if a customer does not care about your values as a business, you need to change to be competitive.
• Provide staff with a view to the customers’ interests and an incentive to stick to it.
• What is the best way to collect customers’ responses and respond to issues?
• Coordinate your teams as a group with clear ground rules and goals but don’t alienate the customer

## Providing a Customer-Focused Approach to Location

When a customer wants a product or service, they may be willing to pay more than the going rate for convenience, more-so due to the new market for app-based food deliveries and same-day online shopping. Having the customer see your storefront when they need to is a perfect situation for both parties.

Many businesses also opt to help the local community and sponsor community projects.

References;

## My Echo Dot broke and I’m kind of mad about It

I got an Alexa in 2016 as a birthday present and I used the thing almost daily! We ended up with 3 in the house, one in the Kitchen and two in different bedrooms. I also installed a Sonoff smart switch in the ceiling light in my bedroom which meant I could easily turn off the light right from the comfort of my bed (using sonoff-tasmota). It was great until one day my £50, 4-year old 2nd generation echo dot stopped working.

I went into my room and said ‘Alexa, turn on the light’ and was met with blunt silence. I looked over at my echo dot and it had its blue “I’m working, leave me be” blue light with single white light rotating around it, I walked over to it and after a considerable amount of minutes (7 or 10) I decided it had been this way for a longer-time than it should have been and was stuck in a boot loop or something, I opted for a switch-it-off-and-on-again approach. It booted into its solid blue bootloader, and then sat there spinning its blue and white light again in silence.

I left it for hours to no avail, I tried resetting it by holding down its mute and volume down buttons and nothing. I’ve tried all manner of combinations of button-pressing, uber and volume down with mute, all at once, a combination of one another. I gave up after about an hour of pressing and pushing buttons on it and decided that it was a software issue and would not wake up from its blue spinning trance.

I decided to search online and can’t find anyone with the same issue, there seem to be a few people who used the wrong power chord but I’m not one of them and I tried a new led and power-brick anyway. I posted on amazon’s digital devices forum and was met with standard troubleshooting that as I expected, but followed with optimism, did not work.

I also briefly looked at seeing if I could re-image the echo using fastboot, I knew it ran android but after reading online and trying for myself (uber and usb to PC, echo showing a green light) I saw that the echo is fairly locked down and not able to be accessed this way.

Which is where we come to why I’m mad. It’s for two reasons. In the first generation echo dot there was a physical and separate reset button that if I were able to use on the second generation echo dot I’m sure would allow me to hard reset the echo dot, but because the thing is stuck in some software upgrade or something, its only good as a bad police light, a paperweight, landfill.

And the second reason I’m mad is not allowing me to do this with another PC, ADB and Fastboot I’ve only used a few times but allowed me to extend the lifetime of my devices and customise them to my heart’s desire.

You let me down Amazon, now I have to get up and turn off the light like everyone else.

## Writing a Requirement Specification Document for a Software Project

When a problem or solution requiring software is conceived it is essential that the software project is properly conveyed to the software house, agency or project staff creating the software. When constructing the document there are defined standards that the SRS may be structured to follow, such as IEEE Std 830-1998 which has been superseded by IEEE Std 29148-2011.

The document may also be written by the customer should the client choose to do so as it may provide more control of the specifications required in the project. Simply a Software Requirements Specification (SRS) could be titled ;

## Introduction

The introduction should indicate the expected behaviors of the software as clearly as possible detailing the processes, activities, interfaces, and tasks required by the software. The introduction can be muddied if the software is not already clearly conceptualized or thought out or is to be built onto existing software if the requirements are not understood by all parties. It may also be necessary to indicate the expected life cycle, phase-out period and maintenance required to maintain the performance and usability of the software. Users may also be considered.

#### Purpose

An SRS document may state the purpose of the software which could be considered an ultimate end-goal of the resulting project and consider the project a failure if not met. It should conclude with affirming that this document specifies how the software should be designed, developed, tested and implemented where applicable. If the purpose is to improve the speed of current business processes then make it appear in the purpose section, if the purpose is to improve the usability of the current software used by staff then include it in the purpose section as well. If the software is also supposed to do something not included in the purpose or easily justified by this section, then it can be hard to justify why such a feature should exist in the project.

#### Scope

The scope of the document is to provide a description of what the document specification includes, such as use cases and requirements. Some of the program may be in multiple documents so the scope is necessary to reduce overlap between projects.

#### System Overview

System Overview provides a description of the context, function and requirements of the software project.

#### References

References should indicate if the software is somewhat pre-existing, any references made in the document and references to appendixes should also be included too.

## Overall Description

The overall description is the second section of the SRS document.

### Product Perspective

A product perspective is a detailed outlook of what the program should appear like to the users of the system, some software projects may be completely transparent to users, if so then the product perspective should outline the interfacing between other software components that make it so.

• The overall description should not be vague, it should provide justification as to why the functions of the program are required.
• The overall description should detail crucial cornerstones of the program and interfaces that exist with the hardware or software.
• Some of the programs may be pre-existing which will require the project interface detailed and easily readable to be understood.

The Description should have six sections,

• System Interfaces which the user may interact with the system or the system may interact with other systems.
• User Interfaces which the users may interact with which may include the frequency of their usage and the intuitiveness of the design.
• Hardware. Including the frequency of use of the hardware, considerations to the longevity of the hardware and ability to update or dispose of the hardware.
• Software. Including external interfaces, naming conventions.
• Communication and Telecom both in interfaces software to software and to the user.
• Memory. Including minimum requirements.
• Operations and processes that the program may perform real-time or batch, transaction or otherwise.
• Adaptations and the ability to configure the system. For open source or high-security systems, this section may be larger than private or closed source software due to the need to ensure that it is secure or can be maintained or made depreciated quickly.

### Design Constraints

• What are the limitations of the software?
• What might the software fail to perform at?
• What are the limitations of the programming language if selected?
• How might this delay the project if risks arise?
• What are the limitations of the users’ ability?
• What training will need to take place in order to use the software effectively?
• What does the software not do?
• What happens if a user does not use the software as intended?

In most aspects of software engineering, there are simply parts of human nature and failure modes or edge cases that simply cannot always be mitigated, in such scenarios it is important to outline what steps your software has taken to make these issues not slow the productivity of the software and ensure that the system runs as intended part of this may be detailed in test cases written in the appropriate section.

### Product Functions

Product Functions should as best as possible describe the function of the program and how the modules of the program if any will work together with the interfaces of the system to produce the software’s desired functions.

The aim of the section is to break down the large characteristics of the program into more readable and manageable sections that can be delegated out to a team or read to an individual clearly without much overlap to avoid confusing what the program is designed to accomplish and what each function does.

• The functions should be organized and listed so that they may be read for the first time and understood effectively.
• The section may include graphical sections or UML detailing how the program may operate.
• The validity of the input.
• Sequence diagrams or how the program may pass data between functions.
• How the program accounts for abnormality.
• Common input examples may be a good way of explaining the function to the reader and providing a sample of what the programmer should accomplish on each function.
• Sequencing.

### User Characteristics

When a user may use the system either from time to time (i.e. infrequently), once or many many times it is important to detail this information in the user characteristics section and account for this in the software, if the methods used to do something are contrived or confusing it could lead to increased mistakes or data mismanagement further down the line and increase the need for normalization or reconciliation of information.

• User Characteristics should detail the factors that affect each user and provide use cases for each user, it may also be ideal to detail overlapping functions that each user may use and diagram where appropriate.
• It also may be applicable to detail why each user may need a function of the program.

## Specific Requirements

The specific requirements should detail all of the requirements of the clients, the user and the software itself. It should provide suitable detail to enable the software to be written clearly and tested effectively. It should be stated for each requirement which user the requirement is for and if applicable that the test case corresponding to the requirement should be satisfied through cross-referencing other parts of the document.

• The requirements should be clearly stated to prevent later mistakes or edge cases, poorly written requirements or poorly designed functions may cause the program to be unstable or possibly unsuitable for use. Proper error handling should be given to most aspects of the programs requirement and how it operates to meet the requirement.
• Vagueness or Failings in test cases may allow for requirements to be deliberately misinterpreted, such as “The program must be fast and easy to use” may be considered easy to use for the programmer or tester, and therefore a suitable statement that the requirement is met, but not for the user who may not understand the inner workings of the software and therefore lack the knowledge to use the software effectively as much as the programmer testing the requirement, it may be a good idea to allow the users to try the functions using agile development and adapting the program accordingly.

The final part of the document should include the appendices and the index.

## Fixing an Accenta/Optima Alarm Power Failure Troubleshooting

A long time ago our alarm box died and I thought it was time we diagnose an fix the issue.

DO NOT ATTEMPT TO COPY IF YOU DON’T KNOW WHAT YOU ARE DOING. CONTACT AN ELECTRICIAN OR ALARM INSTALLER.

We will be opening a delicate box with potentially live mains power and could cause damage to yourself or the panel.

As you can see, although our isolation switch is set to ‘ON’ the power light on the alarm box is not illuminated. This may be because,

• The battery in the alarm has died.
• A fuse in the alarm box has blown.
• There is a fault with the incoming power to the alarm box.
• There is a fault with the main board of the alarm box.

We know that there is no fault with the existing setup because the alarm used to work, so we can start to diagnose our four potential issues. I’ll also teach you how to reset your panel.

## Opening the Panel

This step is the easiest but can be daunting for some. Remember, safety first. We will be dealing with a panel that may be receiving mains voltage.

When we open the box, there is a small spring that pushes against the door, this little spring ensures that any burglars who attempt to open the panel, trigger the alarm. As our alarm is not working, nothing will happen but if the alarm does sound, then it may be a sign that your panel does not have a power issue, consider resetting your alarm. Unscrew the two front facing screws. Note that from here on out, experienced competent people should continue.

Now that we have taken the bottom section off completely, we need access to the top of the main board as well. There is a fuse we need to test in the top half of the alarm panel so we’re going to remove the top half as well, this bit is just as easy as the bottom half, but there is a speaker attached to the housing, we can remove the speaker by unscrewing the terminals or do what I did and simply let the top half dangle by its wires (lazy but effective).

## Testing the External Power Supply to the Box

`(If you are following along and have an Optima remote alarm panel, you may  need to find a box similar to mine, but it does not have any controls or lights - its also likely that your remote panel is not illuminated and the screen is off if it is a power issue.)`

Firstly we need to test that the incoming power supply is working, this is where our AC Voltage tester comes in (fear not if you don’t have one but do have a voltmeter).

Using this wand we can see if there is power coming into the alarm. (If you don’t have one of these and are following along at home, you can set your voltmeter to AC or ṽ and place your black lead into the COM jack and red lead into the VOmA jack and when we open the alarm panel later put your test leads on the incoming supply chock block above the transformer, using the left brown and blue wire screws)

Place the wand near the incoming mains wire, if the wand sounds and flashes, congratulations. We have determined that the alarm panel is receiving power to its transformer.

If there is no power, consider using a voltmeter as explained above to verify. If there is still definitely no power then a fuse may have blown in the isolation switch or the ring main RCD may have tripped, so consider diagnosing if they are the issue.

## Testing the Alarm Battery

If you think that the Accenta / Optima alarm has stopped working due to a battery failure, we can test the battery by connecting test leads to the battery terminals on either side of the battery block or on the battery directly, you will need to turn off power to the alarm so that we don’t get the feed in voltage from the board. Do not put your voltmeter test leads in the red highlighted section. Make sure to set your voltmeter back to measuring DC voltage if you set it for AC earlier. Place your test leads on both screws on the green highlighted area.

If you don’t get a reading or a low reading (3V or less) then your alarm battery may have ran out because of power failure. If your battery reads ~12V then it is a good indicator that your alarm panel is faulty and will need to be replaced entirely, but I would suggest you check the fuses before doing so to verify.

## Testing Fuses in the Accenta / Optima Alarm Box

If you have verified that the incoming power is working and your alarm battery is depleted then a fuse is a most likely cause of the alarm failing.

To test the fuses, you need to set your voltmeter to continuity mode and then test each side of the fuses contacts. Make sure the power is switched off before and during testing any fuses. If any are blown, replace like for like.

The fuses are as follows, from left to right; –

• Internal Speaker
• Bell / Strobe
• Battery
• Transformer

## Resetting the Accenta / Optima Alarm Panel

To reset the alarm panel, remove power to the panel and short the SET output to the left PA input terminal. Then turn on the alarm and allow it to power up completely. After a few seconds, you can then switch off the alarm once again and remove the shorting wires. Make sure to replace any wires previously installed and then power up the unit again, the default 0123 code will now have been restored. Beware in doing this, you reset any zones, such as fire zones will have been reset.

## Tracking My Position all the Time

I have a long standing interest in monitoring my daily doings, I previously thought about putting a GPS tracker in my car, a good idea for both tracking my position and also checking to see if it has gone walkies (is stolen). I decided against doing this a while ago due to exams and lack of time to set the whole thing up. But I did decide to have a crack at this idea later with my phone.

The way I chose to go about this power hungry task was to use an app like IFTTT to record my position to a spreadsheet. But then I heard about owntracks, a purpose-built app for tracking your position. After setting up the owntracks server, MQTT and owntracks recorder. I now have a pretty good way of determining where I am at one time or another and have been using it for about 6 months.

My phone is a OnePlus 3 and as I said the app is fairly power hungry. Currently owntracks uses ~39% of my battery’s capacity based on 1 day 1 hour uptime. Although this seems fairly high I have accepted it as a fair compromise untill I can finish another GPS project I have in the works.

Here’s my experience of such a setup so far,

• Battery usage increased significantly to a point where some users may not find it acceptable.
• I had to turn off battery optimization and advanced battery optimization or else the app would stop.
• The app does not always capture my location all of the time, sometimes it may be a few hours before it reports a significant change despite being in move monitoring mode or significant changes mode.
• The performance and recording of positions in the app isn’t as good if the app does not have internet access all the time, so if data is switched off in my phone, the recording of the position isn’t as good as if it were on all the time, sometimes there can be large gaps where there was no internet access where it drops out.
• My use case was for later analysis of the data, not realtime.
• Owntracks recorder is not very featured but it does the job.

## Exporting GnuCash Data to PowerBi

Some things are better if you do them yourself. I mainly did this project to keep a running ledger of the changes that I would need to keep track of the account balance data.

GnuCash is great, but when I export my accounts data the CSV file isn’t easily translated with power-query automatically. I decided that because I need to keep track of my transactions, this problem was best suited with a little program to calculate my net inflows and outflows using a python program, I also decided halfway through the project that I wanted to hook it up to my graphing backend, a silly idea – but a fun one to see my spends go up and down. I decided that I’d publish it here so that in the future I would find it a lot easier.

Traditionally if you wanted to export GnuCash data from CSV to PowerBi, you’d be better off using their inbuilt power query, however, I wanted to implement a ledger system, something that I don’t think can be accomplished directly in PowerBi without some scripting, and in the future I want to be able to change platforms if I need to because I no longer have a licence for PowerBi or want to use something else like excel or free equivalents like Google Sheets. I reckon that if done properly Google Scripts could make everything run automagically from an upload, but I don’t have my reports ready yet for that to happen.

```# Extracted from here https://github.com/aidancrane/GnuCash-CSV2CSV-for-PowerBi/blob/master/convert_to_powerBI.py

import csv
from re import sub
from decimal import Decimal
import time

# If we only want the transactions values, set this to true and they will print to console, they do not save to accounts_out.csv!
numbersOnly = False

# Anyone thats not me will want this to be false, this is used to show the transaction data on a live graph I use for scratching around with.
smoothieChartEmulation = False

# Leave this here so that Notepad++ and Atom auto-suggest it.
# Date,Account Name,Number,Description,Notes,Memo,Category,Type,Action,Reconcile,To With Sym,From With Sym,To Num.,From Num.,To Rate/Price,From Rate/Price

if (smoothieChartEmulation):
import requests

# Negative Numbers are bracketed when exported from GNUCash so we need to fix that for the float data type.
def convert_if_negative(number):
returnNumber = str(number)
if ("," in returnNumber):
if ("(" in returnNumber):
returnNumber = returnNumber[1:]
returnNumber = returnNumber[:-1]
returnNumber = returnNumber.replace(",", "")
returnNumber = 0 - round(float(returnNumber), 2)
returnNumber = str(returnNumber).replace(",", "")
if ("(" in returnNumber):
returnNumber = Decimal(sub(r'[^\d.]', '', returnNumber))
return (0 - round(float(returnNumber), 2))
return returnNumber

# open accounts.cvs, our exported file.
with open("accounts.csv", "r") as csvIn:
entries = []

runningTotal = float(0)

# Save
if (row["Account Name"] == ""):
pass
else:
runningTotal = runningTotal + float(convert_if_negative(row["To Num."]))
if (numbersOnly):
print(str(round(runningTotal, 2)))
else:
if (smoothieChartEmulation):
print(str(convert_if_negative(row["To Num."])) + " Description: "+ row["Description"] + " Account Balance: " + str(round(runningTotal, 2)))
entries.append([row["Date"],row["Description"],row["Category"],str(convert_if_negative(row["To Num."])),str(round(runningTotal, 2))])

# Save what we care about to our new csv for power BI
with open('accounts_out.csv', mode='w', newline='') as csvOut:
titles = ["Date","Description","Destination","Transaction","Account Balance"]
writer = csv.writer(csvOut, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
writer.writerow(titles)
for transaction in entries:
writer.writerow(transaction)
```

I used python because it’s quick to debug in Atom and I know it well. The way this snippet is used is to export an account from GnuCash, then use this program to output the final CSV to be taken in by PowerBi, I’ve chained these steps together. The final result is stored in accounts_out.csv.

Thanks!

## Opening up my Tile Mate

Bluetooth trackers are a great addition to anyone’s cluttered key chain, Last year I got a Tile Mate as a present. A nifty little key-chain Bluetooth connected sounder for when I loose my keys, or when I loose my phone.

So far given one years use I have maybe used it seriously to find my phone 2 or 3 times, it works very well for it. Anyway now that I’ve had a years use, the Tile app decided they wanted more money as the battery was getting low. Interestingly enough in the newest versions of the Tile Mate the battery is replaceable, however in this version (replaceable or not) the method to open the case is rather destructive.

Forgive the image, it was rather late at night, As you can see there was a replaceable CR2025, so changing the battery was as simple as replacing it with a battery I had spare. I wonder what ’62’ means?

I couldn’t get the data-matrix to scan on my phone app unfortunately, but the board is very pretty and its clear a lot of thought has gone into keeping the size small. I like the little Pogo pins on the right for the piezo on the lid and the little pcb antenna. Also featured, the timing crystal oscillator, microprocessor and what looks like a version number for the board.

Anyway, then I put it all back together nice and snug inside its now fairly tarnished case and used some 5-second-fix glue to glue it back together and jobs-a-gooden, almost. It seems like the message on the app still persists.

Anyways, I’m still happy with it, it’s served its time and I think I’ve broken it a little too much to replace it again. In the future perhaps with the latest version, tile could offer some sort of slot so that the battery can be replaced a little less destructively (or maybe I did it wrong, oops). Nevertheless I don’t advise doing it yourself. TTFN, Aidan.

Cya later, Mate.