Mike MacDonagh's Blog

Somewhere in the overlap between software development, process improvement and psychology

How to remove duplicates in Amazon Music playlists

I’ve recently migrated to Amazon Music from Spotify and local media servers. It’s actually pretty good although getting my playlists migrated was a pain.

Uploading seemed to cause a lot of duplicates, so then creating playlists from the recently imported or added files caused a lot of duplicates in the playlists. I listen to playlists on shuffle so this annoyed me because it means the probability of duplicated tracks is higher and you miss out on the other files. I found a way around it though!

  1. Create your playlists however you want.
  2. On Windows, install the local Amazon Music app.
  3. In the Amazon Music Windows App you can select all of the files in a playlist, right click and add to a new playlist
  4. The app will popup and tell you how many duplicates there are and ask if you’d like them to be filtered out.
  5. Delete the original playlist
  6. Rename the new playlist.
  7. Rejoice in a lack of duplicates.

For Spotify playlists I used STAMP from FreeYourMusic – ok but expensive.

It managed most of the files on my wife’s spotify playlists fine, and produced a file of songs it couldn’t match. Some made sense because they were misnamed, or not part of Amazon Music so needed manual uploading from our local collection. However, across several thousand tracks it failed to match about 60 it should have.  Also, the CSV to Amazon Music doesn’t appear to work in STAMP. Still, it saved me hours despite being over-priced and not perfect.

Send messages to another room using Amazon #Alexa #dirtyhack

Here’s a fun trick to get Amazon Alexa to send messages to the kids in another room or whatever…
This is a bit of a hacky workaround but it’ll do the job until Alexa can do push notifications.
1) Record some custom mp3s (or go to http://www.readthewords.com and generate some)
2) Save them with good names and upload them to Amazon Music in a “Messages” playlist
3) From the Alexa app you can then choose a message to send to an Echo/Dot from the “Music and Books” area (the playlist makes them easy to find)
For example, “Please come downstairs, dinner is ready”.

How to call a webservice api from Amazon Alexa using Javascript in a Lambda function

This wasn’t trivial and I’ve seen a lot of questions about it online so I thought I’d share how I did this to get Alexa to respond to questions about my kids pocket money 🙂

You can call a URL like this:
(note I’m assuming a JSON response, you’d need to modify for non-JSON)

var http = require('http');

function getWebRequest(url,doWebRequestCallBack) {
    http.get(url, function (res) {
        var webResponseString = '';
        //console.log('Status Code: ' + res.statusCode);

        if (res.statusCode != 200) {
            doWebRequestCallBack(new Error("Non 200 Response"));
        }

        res.on('data', function (data) {
            webResponseString += data;
        });

        res.on('end', function () {
            //console.log('Got some data: '+ webResponseString);            
            var webResponseObject = JSON.parse(webResponseString);            
            if (webResponseObject.error) {
                //console.log("Web error: " + webResponseObject.error.message);
                doWebRequestCallBack(new Error(webResponseObject.error.message));
            } else {
                //console.log("web success");
                doWebRequestCallBack(null, webResponseObject);
            }
        });
    }).on('error', function (e) {
        //console.log("Communications error: " + e.message);
        doWebRequestCallBack(new Error(e.message));
    });
}

You can then use it like this from inside an intent handler:

function getPocketMoney(intent, session, callback) {

    let shouldEndSession = false;
    let repromptText = null;
    let speechOutput = '';
    let cardTitle = '';

    let url = "http://mypocketmoneyservice/getpocketmoney?person=mike";

    getWebRequest(url, function webResonseCallback(err, data) {
        if (err) {
            speechOutput = "Sorry I couldn't connect to the server: " + err;
        } else {
            //something like this
            const balance = data.pocketmoney.person.balance;
            speechOutput = `${person} has £${balance} pocket money.`;            
            callback({}, buildSpeechletResponse(cardTitle, speechOutput, repromptText, shouldEndSession));                   
        }
    });
}

Amazon Alexa – what it needs to do next

I’m a big fan of Amazon Alexa. I bought a dot to experiment with and it’s so useful I have it in several rooms now. Alexa can control my smart lighting (courtesy of lightwaverf kit), play music, order food, order some amazon stuff, manage my shopping and to-do lists amongst other things, but she’s got a few drawbacks.

Here’s what I’d like to see Alexa tackle next:

  1. Conversation flow – the ability to add contextual follow up questions, without every command being “Alexa, do a thing…” It sounds trivial but when you’re having entire conversations with Alexa it’s a bit weird to have to use the wake word for every sentence.
  2. Multiple commands in one e.g. “Alexa, turn on the kitchen lights and start playing the cooking playlist” rather than “Alexa, turn on the kitchen lights” and “Alexa, start playing the cooking playlist”
  3. Unstructured search – Alexa’s great at facts but Amazon have decided not to make her opinionated.  She’s great at “what is a hoover?” and “what is 12 miles in kilometres?”.
    1. She can answer: “Who played harry potter in harry potter and the philosopher’s stone?”
    2. But can’t do things like “who played Harry Potter in the movies”. In contrast google can answer that question with a quick snippet about the cast. I read a blog that said they didn’t want to make a decision for users about simply returning the first search hit rather than making an informed choice – but if I’m making a voice search that’s exactly what I want. If I want to get a range of views and select my search result I’ll use a text interface. Returning “cards” with links to Bing isn’t good enough – just read me the top hit from <insert search engine here>
  4. Intercom – I want to be able to send a voice message from one Alexa device to another to create an intercom system in my house (e.g. “Alexa, send a message to the living room telling the kids to turn the TV volume down”)
  5. Delayed reminders – Alexa’s good at setting alarms but I want her to remind me with a message not just beeping (e.g. “Alexa, at 6pm remind me it’s time to order a taxi”). At the moment, that sentence will result in “Time to order a taxi” on the to do list. Or I can set an alarm for 6pm which beeps. I want a voice message at a specific time.
  6. Alarms – play music not just beeps. (e.g. “Alexa, wake me up at 7am with my Spotify Wake Up playlist”)
  7. Local DLNA integration. Alexa’s great at streaming music from the internet but doesn’t currently see home DLNA music as a streaming source. Which is odd, I can see how to program a skill to do discovery (similar to the current smart home discovery, or just built into that) and the rest is the same. Amazon, if you read this I’ll do it for you at a reasonable price.
  8. Chromecast e.g. Alexa, play Netflix: Game of Thrones”
  9. Order a Dominos. Yep, I know it can do this in the US so why not in the UK? Dominos allow ordering via chatbot in Facebook Messenger so this is easy to do from a coding point of view. Dominos, if you’re listening…
  10. IFTTT integration. C’mon Amazon, IFTTT say they’re waiting for you do to something. This unlocks millions of possibilities.
  11. Add things to my Amazon Wish List e.g. “Alexa, add a Raspberry Pi to my Amazon wish list” only adds it to my (local) shopping list.
  12. Remove things from todo or shopping lists by voice. Also, email me my lists.
  13. Custom volume schedules. In the morning I want Alexa to be nice and quiet, in the evening I want her volume to be a lot higher. Perhaps what I really need is her to automatically adjust her volume based on the ambient noise. After all she’s listening all the time anyway.
  14. Proactive notification. I realise it would be annoying if any skill could push notifications to my Alexa (I don’t want random ads being spoken in my house) but I’d like to be able to whitelist some apps so I can get alerts at certain times of day from specific apps (e.g. order status on ordered food, package tracking, breaking news, birthday reminders).
  15. I want a big Echo with a screen for my kitchen too.

I realise many of these are about integrating outside of the Amazon ecosystem which is perhaps why they’ve been reluctant to do so. But with Google Home, an MS and Apple assistants turning up soon the winner is likely to be the most useful all round. At the moment that’s Alexa, but by being more open to integrations it’ll be hard to beat.

What do you want Alexa to be able to do?

Holistic Software Development – the book

The HSD book is currently in it’s final editing phase. If you’d like to purchase the book then please bookmark this page and come back soon.

What’s inside?HSD Book

The book covers a detailed introduction to Holistic Software Development and it’s principles. Covering the H-Model and how it us used to map levels of decomposition to recomposition and integration the book then follows a structured path through HSD material.

We discuss Strategy and Holistic Portfolio Management to help guide organisations in adopting post-agile flexibility at the top level. We cover the HSD requirements model and how it supports strategic intent without falling into the Big Up Front Requirements trap.

A detailed chapter on architecture follows covering enterprise, solution and system architecture and its representation through over sketches and architectural mechanisms.

We cover Planning and how to balance the needs of business planning with agile just in time planning. We deconflict project management and agile ways of working showing how they can work together in a holistic organisaiton.

Releases and Integration is the heart of the H-Model and so is where the focus of HSD comes together. We discuss the dual nature of releases, and how they are best set up across teams of teams in both a technical configuration management context and a planning context.

We cover the HSD approach to Quality and Operations before covering a detailed view of People structures and organisational design. Based in psychology we look at motivation, teaming and large scale structuring covering the HSD Hybrid Dynamic Model in depth.

Finally we look at Governance and HSD variants for simple organisations and COTS before briefly covering Adoption practices.

 

We’re working through the last few edits of version 1.0 currently and hope to have the book published in 2016, you can now sign up to be notified when it’s published on the HSD site.

Howto: Controlling LightwaveRF lights with a Raspberry Pi, Flirc and Logitech Harmony One IR remote

I’ve recently got into home automation and so thought it would be fun to integrate my smart lighting with my media centre and remote control. When I watch TV or streaming video I want the main lights to go off and the side/back lights to come on in my living room. When I pause I want the main lights to come up a little and when I play I want main lights to turn off again 🙂

My setup

I use LightwaveRF devices to control my main lights (2 dimmers) and various side-lights and screen backlights, I’ve also got a LightwaveRF Link hub which allows the Lightwave’d lights to be controlled by app, but also by simple UDP packets.

I’ve got a Logitech Harmony One remote control, because it allows you to setup custom sequences and controls my TV, DVR box and sound bar.

My solution:

I decided to use a Raspberry Pi 3 (now with Wifi and Bluetooth built in!) to do the lightwave udp packets and  Flirc to interpret the IR signals and convert them into simple text commands. Then I wrote a little python program that listens to the incoming commands from the Flirc USB Infrared receiver. There are other ways of interpreting the IR commands, but this was a super simple one!

Harmony One to Lightwave RF integration Read more of this post

These are not the practices you are looking for @agileinabag

Holistic Software Development @AgileInABag London 12 June 2015

Agile In a Bag London 2015

I’ll be presenting with my friend and colleague Steve Handy about Holistic Software Development at the Agile in a Bag conference in London on the 12th June 2015.

If you can make it, do come along to this great 1 day conference to have some fun, share some thoughts and ideas and meet some interesting people 🙂 Here’s the blurb for our talk first thing (9am) in the morning:


 

These are not the practices you are looking for

Is your time to market quick enough for your business to respond?
Is your Programme and Project Management smoothly joined up with your agile teams?
Does everyone understand how their work contributes to business value?
Do you know what end-to-end scenarios will be delivered in the next programme release?

Come to this talk to hear how these common problems are easily solved, even in highly complex system-of-systems organizations by using the freely available “Holistic Software Development” (HSD) framework which aligns agile philosophy throughout the enterprise, at-scale engineering, architecture, strategy, portfolio and programme management. Using a novel but lightweight end-to-end scope level requirement type we iteratively drive the development of well understood Releases and customer feedback loops.

Combined with layered iterative or continuous integration and clearly understood progressive Definitions of Done we can simplify the complex resulting in a perfect join up between customers, requirements, planning, delivery teams and governance. HSD is the glue that plugs together your existing agile team practices (e.g. Scrum) with PPM practices (e.g. Prince2) and business strategy providing people focussed, lightweight guidance firmly based in evidence, experience and excellence.

And here’s the learning outcomes we’re aiming at:

  • Understanding how to de-conflict agile and enterprise portfolio and programme management
  • How to unify agile teams, governance, customers and executives in a simple model
  • The “H-Model” of software development
  • How to join up different schools of thought/processes into a cohesive way of working
  • How a strong approach to understanding business value enables effective software businesses

 

You may detect a slight Yoda-like grammar to the title… Come or come not, there is no spoiler.

The rise of the Chief Software Architect

ArchitectureSoftware is increasingly important to everyone, it’s everywhere. It’s in our phones, runs our cars, our cities, our healthcare, entertainment and utilities. There are few businesses without a software element and many that are critically software dependent. What these organisations are finally beginning to understand is that the business of doing software is difficult, in fact it’s complex. It needs C-suite level direction and coverage.

Being good at software isn’t a matter of hiring the good coders, buying the right workflow management tool, using the right Configuration Management system, hiring the right management consultants or using the correct technology. These things all have a part to play but they’re supporting parts to the most important factor: culture.

Software Development is a team activity and the team is bigger than we used to think it was (a few developers, testers, direct customers, managers, analysts etc.). A good set of development practices at team level isn’t enough to be effective because software development is a business enabling activity and so it touches all parts of an organisation (development teams, hr, procurement, security, business change, legal, financial, business services, operations, support etc.).

As organisations evolve to make the maximum use of technology they are making increasingly complex software products, often through diverse technology stacks, using a variety of in-, near-, and out- sourcing partners. Delivering systems of systems across teams of teams is not simple and so organisations are now looking to embrace the importance of software, technology and ways of working to their businesses at board level.

What is a Chief Software Architect?

Whether a “Chief of Software“, a “Chief Software Officer“, a “Chief Digital Officer” or “Chief Architect” the role tends to include:

  • Leading and encouraging a positive software development culture
    • Where delivery of business value is the primary measure of success and decisions are based on business value
    • Where failing fast is a cause for celebration not a career ending issue
    • Where software is designed for users/customers needs
    • Where continuous/iterative development integration and deployment are the norm
    • Where teams collaborate and co-create with each other and their customers to produce the best products
    • Where thinking all day to write a perfect algorithm is worth more than pushing out hundreds of lines of code quickly
    • Where professionals are trusted to do their jobs properly
    • Where organisational impediments to smooth software development are removed, from board level if necessary (due to Conway’s Law transformational change is often impossible without such top-level leadership)
  • Providing top level architectural direction and governance (sometimes called Enterprise Architecture)  that strikes the balance between directing technical decisions towards alignment but not imposing restrictive unchanging standards on development teams
    • Architecture is understood cohesively at Enterprise, Solution and System levels
    • Architecture exists in the form of directed (but community driven) standards, off-the-shelf mechanisms and principles
    • Architecture exists primarily as executable software although appropriate weight documentation, models, examples and usage guides describe it
    • Architecture provides a context for making technical decisions in normal development, makes technical decisions on commoditized platform/software/operations choices but does not constrain innovation and research (architecture has a different impact in different parts of a hybrid dynamic model)
    • Architecture enables control of whole-lifecycle costs by smoothing the flow of work from innovation and research into mainstream development and support
  • Ensuring that teams can use the tools they want and need to use, not those that had the best sales pitch to a non-technical board (hint: these are normally small, simple and/or open source, not those provided by large vendors) balanced by creating a cohesive community that isn’t unnecessarily fragmented by every team needing to set up different tools environments
    • Tool chains take the pain out of development, testing, build and deployment – automated wherever possible
    • Development environments are appropriate for actually developing, building, testing and deploying
  • Ensuring, and embodying, the principles of agility, devops, and agility-at-scale at the organisational level – promoting the evolution of working practices, operating models and ways of working while avoiding endless management fads
    • Building and championing the needs of the development community, attending to their needs
    • Ensuring that portfolio selection takes into account technical issues, shaping it in line with architecture and in turn using business priorities to shape architectural choices

Why “Architect”?

The Vitruvian Man - Leonardo Da Vinci

The Vitruvian Man – Leonardo Da Vinci

At a business level Architecture exists to guide organisations through the business, information, process and technology changes necessary to execute the organisation’s strategy. Because “architecture” has always been more than just the technology bit, it also focusses on the non-functional aspects necessary to make the technology work terming a “Chief Software Officer” an Architect is an organisation recognising that to be successful at software a holistic approach is required that combines business concerns with technical concerns.

The idea of an “Architect” role with such a broad focus is analogous to that of a structural architect concerned with buildings. Indeed in 25 BCE Vitruvius (a well known Roman writer and architect who inspired Leonardo Da Vinci, hence the Vitruvian Man ) described an architect as:

The ideal architect should be a man of letters, a mathematician, familiar with historical studies, a diligent of philosophy, acquainted with music, not ignorant of medicine, learned in the responses of jurisconsults, familiar with astronomy and astronomical calculations.

Virtuvius is famous for stating that architecture must be solid, useful, beautiful (De architectura). The same three qualities relate to software architecture. Architecture is a fine balance between a subtle science and an exact art – as such it is the magic sauce that turns a technology strategy into business benefits.

If your business is reliant on technology and/or software and you don’t have a Chief Architecture, you should promote/get one before you become technically irrelevant, encumbered by lumbering traditional delivery approaches based on manufacturing and negative development cultures.

It’s time for businesses to recognise the important of software, and architecture, before they’re outmanoeuvred by those who have.


 

For more on Architecture see:Architecutural assets

 

 

How to write a good strategy

Strategy is a plan that provides overall direction for an organization and a framework for decision making.

Strategy is the instrument by which executive decision makers communicate and drive the future direction of their organization, without clear well-communicated strategy the organization becomes directionless. The purpose of strategy is to set the overall direction that an organization will take; it is the expression of executive intent and is effectively a contract between the directing layer of an organization and its sponsors (shareholders or elected representatives for public sector concerns). Strategy, specifically in the form of Strategic Goals, forms the very top of the requirements stack driving the portfolio of work and shaping enterprise architecture.

Recommendations for effective strategy

Articulate how Business Value is understood and measured – this helps everyone understand the business purpose and the primary measurement of success helping avoid implementation of intermediary measures that are mis-aligned to strategy

Minimize the number of organizational layers – this avoids unnecessary translation of information across layers and unnecessary middle-management resourcing. See information on Resourcing Levels and Workforce Shaping for more.

Make bold strategic changes – if change is required then sometimes drastic change is required rather than a series of small changes, it might be painful but it’s likely to be more cost-effective to make a bold change.

Push tactical decision making as low as possible in the organization – this empowers individuals to use their skills properly within the organization and prevents stragic decision makers from getting swamped by minor issues. Business Leaders must back up tactical decisions made by their staff for this to work.

Continuously make small tactical improvements – don’t wait for a large change in a year to improve something small that can be fixed today. Make the change and measure the improvement to validate the change and ensure systemic improvement.

Forget the past – Business situations involving large numbers of people are extremely complex and so similar situations from the past are not good indicators of present or future events. Correlation does not equal causation.

 

Tests for a good strategy

Overall
Does the strategy communicate a clear change?
Is it engaging, inspirational and compelling?
Is it clear and unambiguous?

Why?
Does it describe the rationale for change?
Is the Business Strategy achievable? or worth risk of failure?
It it relevant to the prevailing business environment?

When?
Do the business goals provide value to the sponsors?
Does it contain a roadmap/plan? Or can one be easily derived?
Does it contain short, medium and long-term goals?

What?
Are strategic goals identifiable, measurable, tangible business state-change milestones?
Do strategic goals follow a logical sequence to a desired end-state?

How?
Does it consider resourcing necessary to realise the goal?
Is it executable?

 

Extract from Holistic Software Development – Strategic Direction

%d bloggers like this: