Three Things Retailers Can Do Right Now – #COVID-19 #retail #ecommerce #startups #fashion #restaurants #fastfood #bricksandmortar

Retailers are feeling the impact of COVID-19 as the landscape of how people move, interact and generally get on with day-to-day life. The ones I’ve been talking to have seen drastic falls in footfall and takings. As you can assume, they are naturally worried.

For the first time ever I managed to enter and exit and McDonald’s Drive-thru without another vehicle near me.

So the next few months are going to be a bit all over the place for everyone, for retailers though here’s a few ideas that might help.

Make Stock Available Online

There are still a lot of bricks and mortar retailers who do not sell online. The assumption by shoppers is that most stores have some form of online store, the reality is usually different.

If you want to just setup a shop then the likes of Shopify, Squarespace and Wix will get you started quickly. If you want to align your point of sale system with an ecommerce site then Airpos do this, the stock in store is the same stock online.

If you are heavily into Instagram the consider switching to a professional account and using a Facebook store to sell on Instagram.

Sell Gift Vouchers

Once again not everyone does this, if not then now’s a good time to start. Even better to make them available online or via email. There are an army of shoppers who still want to support local businesses during this enforced downtime. They want to stay loyal to the brands they love and this is not always the big names, the small retailers matter just as much.

As vouchers have a shelf life then it means you can sell now and let customers redeem when it’s safe to do so.

Social Social Social

Every retailer has a sweet spot of an audience on social media. For some it’s Instagram, for others Facebook does them well. Twitter is still the best broadcast media in my opinion.

If you’re still open for business, then tell the world your still open for business, it’s just that the rules on how you interact have changed a bit. Technology brings to retailer-to-customer interaction closer together. If you’ve not had chance to practice and harness it, well now you’re opportunity.

The piece about Glossier in the current issue of Wired UK Edition put it perfectly.

Also, if you need help then don’t be afraid to ask for it, once again Twitter’s the perfect place. Right now, we have to help each other.

Be safe but also proactive.

The National Trust and the Travelling Salesperson – #TSP #Data #NationalTrust @NationalTrustNI #R #RLang

I’ve not had to change much of my routine when it comes to self isolation, I work from home anyways. Saying that with all my speaking engagements cancelled (and rightly so) my brain needed something else to do…..

The Travelling Salesperson problem has fascinated me for years but I’ve never had the time to really sit down with it.

Welcome to TSP!

The Travelling Salesperson problem is this.

“Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city and returns to the origin city?”

What we have here is a graph problem, each location is a node and the route connecting each node are the edges.

There are a number of algorithms that have been devised over the years to calculate the optimum shortest route, it’s the sheer number of permutations to calculate the problem that makes me interested. For now the thing to keep in mind is this….

(n-1)!/2

More on this in a moment, right now I need some locations to test all this out. If I pick a high number it’ll take for ever to calculate a route. I’m going to use R, the Google Maps API and the TSP R Library to see if I can plot a route of some nodes. I need a decent dataset, the one I have in mind is massive so let’s take a subset instead…

The National Trust NI Locations.

The National Trust NI Sites

There’s a nice number of National Trust properties in Northern Ireland. I could have chosen pubs but that’s not what I really do, so as the card carrying member I will do my bit to support the cause.

Here’s my list of locations, I’ve pulled the address data from a combination of the National Trust website and Google Maps:

ADDRESSES = c(
"Carrick-a-Rede, 119a Whitepark Road, Ballintoy, County Antrim, BT54 6LS",
"The Crown Bar, 46 Great Victoria Street, Belfast, County Antrim, BT2 7BA",
"Divis and Black Mountain, Divis Road, Hannahstown, near Belfast, County Antrim, BT17 0NG",
"Dunseverick Castle, Causeway Road, Bushmills",
"Fair Head, Fairhead Road, Ballyvoy, Ballycastle,BT54 6RD",
"Giant's Causeway, 44 Causeway Road, Bushmills, County Antrim, BT57 8SU",
"Patterson's Spade Mill, 751 Antrim Rd, Templepatrick, Newtownabbey, Ballyclare BT39 0AP",
"Ardress House, 64 Ardress Road, Annaghmore, Portadown, County Armagh, BT62 1SQ",
"Coney Island, Lough Neagh, Dungannon, BT71 6PA",
"Derrymore House, Bessbrook, Newry BT35 7EF",
"Castle Ward, Strangford, Downpatrick BT30 7BA",
"Mount Stewart, Portaferry Rd, Newtownards BT22 2AD",
"Murlough Nature Reserve, Keel Point, Dundrum, Newcastle BT33 0NQ",
"Rowallane Garden, Crossgar Rd, Saintfield, Ballynahinch BT24 7LH",
"Castle Coole, Castlecoole Rd, Enniskillen BT74 6JY",
"Crom Estate, Newtownbutler, Enniskillen BT92 8AJ",
"Springhill, 20 Springhill Rd, Moneymore, Magherafelt BT45 7NQ",
"Downhill Estate, Mussenden Rd, Castlerock, Coleraine BT51 4RP",
"Hezlett House, 107 Sea Rd, Castlerock, Coleraine BT51 4TW",
"Portstewart Strand, 118 Strand Rd, Portstewart BT55 7PG",
"Gray's Printing Press, 49 Main St, Strabane BT82 8AU",
"Wellbrook Beetling Mill, 20 Wellbrook Rd, Corkill Rd, Cookstown BT80 9RY"
)

The ! means factorial and it means the product of a number. eg 1 x 2 x 3…..

3! is 6 for example 1 x 2 x 3.

7! is 5,040, 1 x 2 x 3 x 4 x 5 x 6 x 7.

With 21 Trust properties in NI, it’s going to be a large number. The equation though has a few more bits to it, I’m already at my starting point so I can take that one away and I’m only going in one direction so I divide the answer by 2.

How many permutations are there to start at each point and figure out every possible route?

(21-1)!/2 = 1,216,451,004,088,320,000

Or....
20 x 19 x 18 x 17 x 16 x 15 x 14 x 13 x 12 
    x 11 x 10 x 9 x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1
divided by 2 as we're only going one way.....

We could be here for a while with a quintillion routes to calculate. That’s the brute force method, using the other algorithms will make life much easier. Ever more so, I’m not going to waste my time writing new code when someone has already done it.

Andrew Collier (@datawookie) already has the code done for us…. thanks Andrew. His marvellous code will figure out all the positions in the map, work out the optimum route and then generate a Google Map for me. Brilliant!

In the time it took for Andrew’s TSP code to work out a route, I’d made a cup of tea. That’s good going and this is what was waiting for me when I got back…..

Lovely isn’t it?

So What’s the Route?

So the shortest route is 417.5 miles altogether and a total driving time of just over 11 hours, the algorithm started me off at Dunseverick Castle and suggested this shortest route:

Dunseverick Castle > Giant’s Causeway > Portstewart Strand > Hezlett House > Downhill Estate > Gray’s Printing Press > Castle Coole > Crom Estate > Wellbrook Beetling Mill > Springhill > Coney Island > Ardress House > Derrymore House > Murlough Nature Reserve > Castle Ward > Rowallane Garden > Mount Stewart > Crown Bar > Divis and Black Mountain > Patterson’s Spade Mill > Fair Head > Carrick-a-Rede

Interesting that the shortest route also means you can put that fear of heights well to the back of your mind until you are on the final leg of the journey (I’ve still not gone over that bridge).

Now all I need to know which properties have second hand bookshops in them.

With the Northern Ireland locations figured out, and that quintillion number firmly lodged in my head as it’s a rather large number, it merely brings me on to the next question in my mind.

How Many Permutations to Visit ALL the National Trust Properties?

The things that keep my mind occupied. We know the brute force calculation of the NI properties is (21-1)!/2, there are 1500 National Trust properties in the UK. I’m really curious now how that looks…… how many permutations are there?

Back to that factorial again. (1500-1)!/2

160399926559325828672233003119379326061160268022420460271028531372101
917296670318637640768617355779506228213365397811950646840303748727220
900904939604644438105426542700999480497779296815631318368290559599231
084345664901559430781330877755152176202495350252487889761078688818307
591803733611460289091231259625586667371351061600814514024732016213923
2331686047840739961706485632803190198184986301818944059...

That’s only the first 400 digits of it, there are 4112 digits in the actual number. Even Wolfram Alpha won’t tell me the full answer in one go so I’ll have to pad it out…. If I fill in the remaining numbers with zeroes (no way I’m going to guess) this is the sort of number we’re dealing with.

Ready?

16039992655932582867223300311937932606116026802242046027102853137210191729667031
86376407686173557795062282133653978119506468403037487272209009049396046444381054
26542700999480497779296815631318368290559599231084345664901559430781330877755152
17620249535025248788976107868881830759180373361146028909123125962558666737135106
16008145140247320162139232331686047840739961706485632803190198184986301818944059
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000

Sorry, I’m not typing the commas in for this one….. you’ll just have to imagine. As an educated guess it would take estimated 2 CPU years time to figure out the optimum route using Concorde TSP algorithm.

 

Machine Learning Hands On 2nd edition now available. #machinelearning #ai #java #kafka #clojure #weka #dl4j #spark #r

Towards the end of February the author copies of the second edition of my book, Machine Learning: Hands-on for developers and technical professionals landed on my desk. I’m very happy with the way it’s turned out.

I’ve spend the last few months resting, asides from the day job at Digitalis.io – the plan was to gradually ease myself back in at Strata Data Conference in London, sadly this is cancelled due to COVID-19 concerns, only compounded by FlyBe going into administration.

I am, however, doing some speaking things over March and April – DevOps Belfast on 24th March and I’ll be on the AI Panel at Beltech 2020 as well.

So tell me about the 94.75%…. #startups #business #IgniteNI #Propel

I’ve been contacted by a few people who seem rather insistent I crawl out of my grumpy cave as I’m not really commenting on things and haven’t done for most of the year.

I took the bait…. I fell for it.

You can read the full story and list of startups here.

A Big Whacking Great Disclaimer…..

If you think this post is about me having a go at the 5.25% who made it to £15k and a desk, nah, it’s not happening. Good luck to y’all and all the best.

It does however point to a far more interesting topic.

What about the other 94.75%?

That’s where the interesting data is, this is where I start asking the questions like, “What made those 21 more eligible than the 379?”

Don’t believe me? I asked….

This is where the gold is…. because what I want to know is this:

If I wrote an algorithm to judge the 400, would my predictions of success match those of the IgniteNI judging panel?

What makes one idea better than the other? What does the market look like for the 21 who made it through to the Digital X Factor? How does investment levels in Northern Ireland in these ventures look compared to the rest of Europe (I don’t even count Silicon Valley as a reference point now).

So many questions!

What’s the judging criteria?

Who’s the judging panel and their pedigree (previous exits etc)?

Are founders putting in multiple ideas just to get the £15k (now that’s a rather interesting question).

What measures success in the programme……. and could any of the other 379 matched that?

And for IgniteNI, would an algorithm find the diamond in the rust that they could have already passed on (quick answer, yes, likely, but it could happen to any incubator or accelerator).

If there was a betting market for the 21, where would the outside world put it’s money? Now that is the interesting question….

So, will I ever get to see the 379? I’m working on odds of 2000/1 that I will……

 

 

 

 

 

Machine Learning book update…. #ai #machinelearning #java #clojure #kafka #dl4j #weka #spark

The first draft of the second edition is complete and a lot of the editing work is done. There are a couple of big changes….

  • SpringXD has now been replaced with Kafka and how to perform self training machine learning models (with Neural Networks, Linear Regression and Decision Trees).
  • The chapter on Spark got a rewrite to bring it up to date (oh and bye Scala….)
  • New chapters on math/stats and stuff, machine learning with text and machine learning with images.
  • A whole new chapter on data preparation, extraction with Apache Tika and so on.
  • Some jokes have been removed…..

You can see the page on the Wiley website for more information (it’s being updated while edits are ongoing) so it might not be 100% accurate.

If you want to preorder on Amazon (thank you in advance) then you can do so here.

A Little Gotcha in Luminus request in Layout Renders….. #clojure #webdev #luminus

It’s been a while since I looked at the Luminus web development framework for Clojure. I know some folk find it a bit too heavy but I really like it. There have been some changes in releases since I built DeskHoppa so I though I better leave it here incase someone else gets confused by it.

So, the basic page render used to look like this:

(layout/render "mytemplate.html")

Then you could pass in a map for values that would appear in the page.

(layout/render "mytemplate.html" {:key1 value1 :key2 value2})

In more recent releases it now takes the request object.

(layout/render request "mytemplate.html")

Now on first inspection the automatic assumption would be to add key/values to the request.

(assoc request :key3 value3)

Adding to the request will do nothing and have no effect. The render function doesn’t actually do anything with the request when it comes to render the page. You can, however, append parameters to the function after the page name is declared.

(layout/render request "mytemplate.html" {:key1 value1 :key2 value2 :key3 value3})

And the map will get passed to the page so you can use it.

<p>Hi, {{key1}}, you're visiting from {{key2}}!</p>

And so on.

I only mention it because it caught me out for a good half an hour……. thought it might be useful to someone else.

 

 

Adding file logging to Kafka Connect – #Kafka #Connect #Streaming #Data #Devops

More of a memory aid for me as I’ll forget…..

Kafka Connect’s default logging goes to the console, I prefer tailing and grepping files instead. I’m using Confluent Kafka 5.1.2 but the file locations will be pretty much similar if you are using the Apache version.

Open up the connect-log4.properties file in $KAFKA_HOME/etc/kafka directory.

Add the following lines.

log4j.appender.logFile=org.apache.log4j.DailyRollingFileAppender
log4j.appender.logFile.DatePattern='.'yyyy-MM-dd-HH
log4j.appender.logFile.File=/tmp/connect-worker.log
log4j.appender.logFile.layout=org.apache.log4j.PatternLayout
log4j.appender.logFile.layout.ConversionPattern=[%d] %p %m (%c)%n

Change:

log4j.rootLogger=INFO, stdout

To:

log4j.rootLogger=INFO, logFile

And then restart Kafka. The new log file will be in the /tmp folder.

Also worth noting…..

The connect-standalone.properties file seems to have to changed from version to version. The Connect jar path in 5.1.2 for example is share/java where it’s now /usr/share/java in 5.3.1, I was trying to figure out why no Connect plugins were working at all. So it’s worth setting up either a symlink or copying all the jars to that location, or simpler would be to change the properties file.

Jason, Jase and Jade – The @skillsmatter tribute #ClojureX #conferences #events

The sad news began to stream in during yesterday afternoon, that Skillsmatter had gone into administration. I’m sure some of us have been in the same situation and have been in an organisation when this kind of thing has happened, it’s no fun.

What I did witness was the outpouring of thanks and support, this was wonderful to see.

Five years ago I became aware of ClojureX, I refused to talk when it was suggested that I do so, “I’m no good to talk at that!”, was my reply. I’d been coding Clojure for six months at that point and the talk titles I’d seen were on another planet. It wasn’t for another year that I took to the stage.

Jade is born….. by mistake

My name is Jason, everyone calls me Jase (at my request, there’s another Jason Bell, he’s a very good photographer, we know each other, me being Jase makes things easier). By an autocorrect quirk of fate of Chris Howe-Jones turned Jase in to Jade. A meme was born, so everyone in the Clojure community knew me as Jade.

The one thing Jade noticed was that everyone at Skillsmatter were completely kind, caring, professional and always wanting to make sure that you were okay. If you were happy the conference was always better. They made sure everyone was happy, it felt more like family than organisers.

Bring on the Hecklers….

At ClojureX I could let go a little and, being in December, I could get away with some very silly call and response. It became near like pantomime last year with one lady shouting at the top of her voice, “IT’S BEHIND YOU!”, I folded over laughing.

The first row ended up being a gallery of heckling rogues. It was hilarious and I’ve never delivered a plain talk ever since, there has to be some audience participation if they are willing to join in, I know it’s not for everyone but it makes a huge difference.

ClojureX was always close to my heart, along with Strata London. To the point that this year I stopped doing all talks but these two.

So……..

A huge thank you to Wendy, Carla, Sam, Nicole and everyone else that made sure I was happy, fed, watered, looked after, let me nod off from very early morning flights.

To John, Gaibile, Chris, Bruce and the rest of the committee – thanks for the hard work you’ve put in over the years.

Lastly, to those who gave me the grace to stand up, entertain and educate, thank you. The positive feedback meant the world to me.

SkillsMatter, it was an honour. Thank you!

(Everyone will still call me Jade…. I know).

 

“Where have you been hiding?”…. #machinelearning #books #writing

Last posted 15th August…..

…basically I didn’t have anything interesting to say.

I’ve have been busy working on this though:

The second edition of Machine Learning: Hands on for Developers and Technical Professionals is well underway, the first drafts are going to completed over the next couple of weeks. A lot has changed since the first edition back in 2014 (the description text is liable to change between now and March 2020).

I took 2019 off from doing talks, I wore myself out in 2018 and really didn’t want to repeat the whole episode. After the book is complete I’ll be slowing down again in to 2020.

Once the book is complete I’ll be blogging with more frequency. There’s a lot more Kafka things to talk about.

Is Googlewhacking Still Possible? cc @DaveGorman :) #data #bigdata #davegorman #googlewhack

You Need to See This!….

A kind of ritual viewing has happened with myself and the teen recently. Especially as there’s a large interest in statistics and comedy between the pair of us. They’ll suggest one thing, we’ll watch it and then I’ve gone through Monty Python, Billy Connolly, Jasper Carrott, Bill Bailey and so on….. I’ll get shown Game Theory and Film Theory in equal measure.

Then one evening, it hit me….. YOU NEED TO SEE THIS!

Dave Gorman’s Googlewhack Adventure……

(Now as this isn’t an official version of the live show I encourage you to venture here for the DVD and here for the book.)

Francophile namesakes

I owned the DVD when it came out in 2004 and it was a wonder to watch, even after being involved in the web and data industry since 1995 I was still mesmerised.

It’s the true story of Dave Gorman tasked by his friend, Dave Gorman, to find a continuous connection, a chain, of ten Googlewhacks connections. Meeting each Googlewhacker in person they supply Dave with two further Googlewhacks of their own finding. It is, in all seriousness, compelling viewing. And I know what you’re thinking….

What’s a Googlewhack? We need to go back in time a bit.

Googlewhack is a contest for finding a Google search query consisting of exactly two words without quotation marks that returns exactly one hit. A Googlewhack must consist of two actual words found in a dictionary. A Googlewhack is considered legitimate if both of the searched-for words appear in the result page. (From Wikipedia)

Watching again in 2019 it’s still a brilliant story but also it’s interesting to see how much the internet has changed, some for the better and some for the far worse. There’s a far more important question.

Can It Still Be Done?

Has our accelerated lives, data, data shadows and other digital finger prints rendered all of this history. Or, is there a minute glimmer of hope that it could still be done?

The Oxford Dictory contains 171,476 words in current use. From this point on it’s a combinatorics problem, how many word pair combinations actually exist? Back in 2004 I wouldn’t even know how to ask that question let alone find an answer for it….. oh how my life has changed.

There are 14,701,923,550 word pairs that could be searched in an attempt to find a Googlewhack. Fourteen billion….. and from my point of view that’s not a big data problem, it’s an average sized data problem. How long would it take though?

A quick Google search on “Francophile Namesakes” tells us two interesting facts.

Firstly there’s 59,800 results…. no longer a Googlewhack by any stretch of the imagination, and second, the result took 0.33 seconds to find. (14701923550 * 0.33) / 60 gives us 80,860,579 minutes to do all the word pair searches, 1.36m hours. Basically a single computer would take 155 years to just go and hit Google with all the pairs to find a Googlewhack. 

In our world of clustered computing and loads of computers doing the job at the same time, I could deploy a 1,000 machines and it would still take over fifty days to do the work. 

Ultimately, it doesn’t matter. It’s been done already, by Dave, in a time when you could easily do those kinds of searches. When human connection was the default standard of communication. And that’s when I was reminded what the internet has lost for me, the humanity of data. With all the Facebook, Twitter and all the other social networks the social aspect is, to me, lost, it’s the broadcast medium for those who want to listen. Back in 2004 the landscape was much different…… The Googlewhack Adventure just reminded me how much I missed it. 

Thanks Dave. Sadly, I’ve no idea what that’s done to the graph.