2019-01-15

Etiquette of giving

Etiquette is complicated. It is a set of rules for social behaviour. There are, of course, many books on this, but at the end of the day etiquette only works if those involved are working to the same rules, and for that reason I am not going to read/reference any formal etiquette in this post, but rely on those rules I have learned :-)

When they work, the rules of etiquette help avoid awkward situations and ensure social interactions run smoothly. They are not usually logical though, which is a nuisance. If there were logical, one could work out the rules (or close enough) for any new situation. Unfortunately they have to be learned, sometimes the hard way by getting them wrong.

So, I was pondering the rules on gifts...

Giving gifts

Of course, there are different rules for gifts to children, so I am mainly talking here about adults giving gifts, e.g. Christmas and birthday, and so on.

There are, of course, many different, and sometimes overlapping, social groups. These will often develop their own set of traditions and etiquette for giving gifts. Sometimes these are more formal, such as a "secret Santa" arrangement in an office at Christmas - with explicit rules on value of gift.

There are, of course, "token" gifts (often the case for secret Santa). These are usually low value, sometimes humours, and sometimes useful.

But sometimes, between adults, there may be gifts of more value given. These are more complex. I have already commented how Christmas seems to be a time of several months where one dare not buy anything you actually want in case someone gets it for you for Christmas. There is also the risk of duplicate gifts. It is not usually etiquette to simple state exactly what you expect as a gift as that is obliging someone to get it for you. Of course you are expected to appreciate the gift, not discard it. This creates a problem as not saying exactly what you do want people are expected to get exactly the right thing, and not some lesser model with which you will be unhappy. Subtle clues are then involved, and I don't do subtle well!

There is also a usual expectation of some reciprocality of gift value. Sheldon from The Big Bang Theory takes this to extreme, working out the cost of gifts to the cent so as to avoid leaving any lingering imbalance and obligation (and I know how he feels). Of course this then creates a problem if a gift is "too much". If I was to gift a friend something worth thousands of pounds, they would feel obliged to do the same, and may not have the means to do so.

So, no, I don't really have many answers. I would say if buying a gift of value, i.e. not some token gift, then really try and work out exactly what they want rather than getting something "close". Dilbert has comments on gift vouchers - basically why swap currency you can spend anywhere with currency that only works in one place and for a limited time. Well, they can be useful I suppose as a way to help someone get just the thing they want without getting it wrong - if you know someone wants a new apple watch, an apple gift voucher maybe better than getting the wrong version/size/etc.

There is, however, one rather complex type of gift:-

Lottery tickets

On the face of it a lottery ticket makes a perfect "token" gift. It is low value, e.g. £2, and nobody is going to say "oh, shame, I already have a lottery ticket". It is a "fun" gift in a way.

There are, of course, two big issues with giving a lottery ticket:

Worth nothing!

The most likely case, as with over 90% of all lottery lines, is that it is worthless. You have literally given someone a worthless scrap of paper. That struggles to even be worthy of a "token" gift.

Obviously the "logical" approach is to consider the gift to be worth what was paid for it, £2, so logically the same as giving a £2 coin - but if the recipient would not have bought a lottery ticket then this is sort of forcing them to throw away £2 and be left with nothing, so not the same as giving a £2 coin. Etiquette does not necessarily follow logic.

There is sort of one way around this, and this is what led to my making this post - an event with quite a few people where it is customarily to give the attendees a token gift. Giving all a lottery ticket, especially with a couple of "lines" means that there is likely to be someone that at least wins £30. This means all can sort of participate in the gift receipt process vicariously to some extent. It is not hard to have enough tickets to be pretty sure someone will win £30.

Winning £30 is pretty much the ideal outcome of giving a lottery ticket - it is fun and not a crazy amount for a token gift. Indeed, one could be devious even in the case of giving a couple of people a gift (e.g. at Christmas) by using something like my lottery ticket mazes to give tickets that supposedly were put in the maze before the draw - if you actually buy many tickets, and pick the ones that did win £30 to include, at the last minute, perhaps swapping with the maze boxes previously on display before the draw, you could make it that everyone is a winner. Not sure how well that would work, but it would be fund if everyone in a small group all won on their lottery tickets.

Worth a lot!

The bigger issue is the etiquette around the gift recipient winning a lot more. This is where there may not be clear etiquette in place, and it could cause hard feeling. What if the ticket wins £1,750 or £1,000,000? Is the recipient expected to share that with the giver?

Again, logic suggests the gift was worth £2 and the winnings are entirely the recipients, but will that leave bad feeling. What if the ticket is a £10million jackpot? The way that is handled could destroy a family. Thankfully it is very unlikely, but even winning £140 could cause some hard feeling in some social groups.

I do have a suggestion in this case, but it doubles the cost. If the giver gets for themselves the exact same lottery lines, then anything won by the recipients is also won by the giver - no feeling of any obligation to share with the giver as they are already a winner to the same extent. I think that will work.

2019-01-12

Putting the maze to bed...

I have tinkered on and off with the maze box stuff since Christmas, and we have actually found a really good use for the lottery ticket boxes for a small project (more on that after the event).

I have done loads to fine tune the clearance between the lid and the box, with lots of testing (each test takes hours, during which I have other work to do). It is a bit of a trade off - you need the lid to not scrape on the maze, or be too tight to move, but also not be too loose, and you also need to adjust the "nub" a bit and the "ridge" where it parks when complete. All these are now options on https://www.me.uk/puzzlebox anyway, and tested on my TAZ6. I will have to test on a Makerbot Replicator 2 to confirm if they work on the current defaults, or need more tweaks.

I have also gone for three nubs on the maze by default (again, this is a setting), to be more stable, especially as it is now a tad looser. This works well, but means less maze area and so simpler mazes. Even so, I think the new maze logic does create a good puzzle. I find it hard to tell as I don't have any problem solving these, sorry.

I changed the park ridge and nubs to directly calculated polyhedrons to make them the exact correct shape and size and skew to fit the maze, that was a challenge. It is quite fun getting your head around three dimensional geometry though.

Some of the tinkering has been a bit more complex. One of the changes I made was to allow any number of sides on the outer box. It used to insist on a multiple of the nubs - this ensured you could make the maze any way around (e.g. if 3 nubs, any of the 3 ways to start the maze would work). However, I thought it would be more fun to allow for other combinations, so as per the image above, 7 sides and 3 nubs. This means only one of the 3 ways to start will line up with the base at the end. To help, I added a subtle mark on the lid and the maze for alignment as you may be able to see. That was a slight challenge to code as the starting point of the maze could be wrapped around several times compared to the end point, and the combinations of maze inside, outside, both or neither, made for some fun testing.

Also, I found the lettering was not ideal on the ends. I have an option to do a proper chiselled effect (45 degree angle) in to the letters, but you ideally need a thin/fine font. I have made an ExtraThin variant of my 5x9 font for this now - and overall the 5x9 JTD font looks pretty good in 3D print I find.

I also used parallel command to make the sample boxes without trashing my machine in device waits!

All in all I am running out of things to improve. I have one idea which is to do with fonts: I made a bodge to use Noto Emoji if the string starts with top bit set, which is to allow some hearts and rings, but ideally each block of text should use fontconfig to find if the chosen font has the glyph and have fallbacks and make OpenSCAD for each separate block (as OpenSCAD does not seem to allow a list of fonts with fallback). Doing that could also ensure text does not go off the end of the space. Not sure if I'll go that far yet as the text is usually fixed, and I have already added a scale setting.

Apologies to the many people downloading from thingiverse. I have tried to ensure the various versions I have uploaded are all "good" even if they have slight changes, but just a few times I have messed up and only realised when the test print finished. Thingiverse is very slow at deleting and uploading new models, so I am sure it looked wrong at times. I included a "version" box (as shown above) in the uploads for reference. There are a good selection of test boxes on thingiverse but always best to make a new maze yourself as they will all be different. Still loads of accesses, likes, comments and makes on this puzzle, and even some people making the code direct from github (thought some of the comments were verging on trolling).

I was actually surprised to find at least two people selling these on ETSY! I hope they like the new version.

I did have fun making one the right size for an Annoy-A-Tron though - not sure where to put it :-)


Anyway, I have a bit of printing to get done for this small project :-)



2019-01-04

Maze complexity

Making a maze is relatively simple, or so you would think. In this case the maze only has one path to get from start to end, and no loops, and all squares are occupied.

Firstly I have to consider what makes the maze "hard" or "easy", and I did a lot on this when I coded the first version of my maze back in 2017. In that case I created random mazes and "scored" them, including factors like how many dead-ends there were. I picked one with a good score.

The issue is that some of the factors are not obvious. E.g. a good factor is how long the solution path is - longer the better, or so you would think. The problem is that the longer the path is, the fewer "squares" on the maze are occupied with dead-ends. The longest path has no dead ends so whilst it takes a while, the maze is ultimately very easy as you cannot take any wrong turns.

Similarly if the path is too short, e.g. straight line from start to end, it is far too easy to find the solution, especially if you can see the maze. So there is a compromise.

The number of dead-ends is also not an ideal metric - you want dead-ends, but they need to be long enough not to be obvious as dead-ends, especially if you can see the maze.

The simple algorithm

The basic algorithm I have used to make mazes in the past is one where we have a current point on the maze (you can start anywhere as ultimately every square is used, and so it will always create a path from any arbitrary start point to any arbitrary end point). You consider the options of moving to an adjacent vacant square, and pick one at random, drawing the maze to that next point. When you find you cannot move you back track until you can. Ultimately you back track to the start and the maze is full.

A minor enhancement is to bias the directional choice. E.g. starting at bottom of maze a bias to go back down can create a maze that has more ups and downs than just random. Similarly, with a wrapped maze (as we have here) a bias to left and right can create long horizontal paths which are fun.

Another minor enhancement is to pick the exit point at the longest path, if that is an option.

However, the algorithm as a whole as a major flaw - because, when you reach a dead-end, you back track until you can move, you are making dead-ends as short as possible. You always back-track as little as possible. The result is a path from start to end which has lots of short and obvious dead ends.

A simple fix

A very simple enhancement was to start two paths in parallel from the start point of solving the maze. This allows two long paths to exist and creates a "wrong direction" from square one, which is not obvious. The trick of picking the longest point for exit helps ensure the longest of these paths is the solution.

A more complex algorithm

I have now come up with a more complex algorithm. This works by having a set (queue) of points, each of which looks at the adjacent empty squares and picks a direction (as before), but the new point is added to the end of the queue of points to consider next. This means the maze spreads out like a tree from the start point. The trick of picking the longest point for exit helps ensure the longest of these branches is the solution.

This does not work in itself, as you create a maze that is way too simple - far too many paths at once means that they have no choice where to go and hence have to be simple. Even picking the direction randomly, the results are all stupidly simple.


When adding the next point to the queue, I can add to the start of the queue (for immediate consideration) or to the end of the queue (considering all other points in the queue first). If added to the start, then it makes for a long path that can travel unimpeded around empty space before the other paths are tried. If added to the end, then the other paths are handle in parallel with the above result. The same decision applies to the current point considering other directions it could take.

This creates an opportunity for a parameter - one that controls a random chance of adding to start or end. I have added this as a maze-complexity setting.

By allowing a bias as to which end of the queue is used, it creates a range of maze complexities. However, even at one extreme, always adding the next point to the start so it can continue (much like the original algorithm) the key difference is what happens when a dead end is reached - in this case the alternative path is the earliest added to the end of the queue, i.e. the longest "back-track" we can do. This alone makes for more complex mazes.


Of course if you push it too far towards short dead-ends you get some very odd mazes...


Needless to say, this makes for more challenging maze puzzles now.

2018-12-28

Amazing

Around 18 months ago I made a Russian Doll Puzzle Box on thingiverse. This was after initially doing a simple two part box. The idea was pretty simple - the box has a maze on it, so the lid has to be moved around the maze to close or open the box.

It is surprisingly popular, with over 150,000* views on thingiverse and no idea how many from my site that makes the random versions on the fly.


The original code was almost all done in OpenSCAD, with a small bit of C code to create a random maze and set the various parameters used by the OpenSCAD script. It worked, but rendering the OpenSCAD was quite slow.

This Christmas I thought I would have a bit of fun re-doing it. There have been various requests and suggestions since the original design was posted. So I have incorporated a lot of those. The big one was having the maze on the inside of the box so making it way harder to solve! I have also added a helical option, and ability to emboss an initial on the ends of the box.

I decided to take a new approach. Instead of designing in OpenSCAD, I designed it all in C code, making OpenSCAD from scratch from the C. This is only subtly different, and it uses OpenSCAD to carve the maze from a cylinder in much the same way as before - just more of a long list of functions generated by C code rather than iterative OpenSCAD script. This worked, after a lot of tinkering, and after a couple of days I had a whole new set of test mazes. There are loads of tweaks once you print something for real on a 3D printer, and that takes a lot of time, so the test cycle is slow...

Last night I ended up re-writing a whole chunk of it in my sleep! Today I coded the changes, and it works. The change was simple in concept - instead of using OpenSCAD to carve shapes from a cylinder, I would construct a polyhedron from scratch in the C code to make the maze surface.

This was not as easy as it was in my sleep as I learned a bit about manifold polyhedrons, but it works. It makes the OpenSCAD unreadable as it is a huge list of 3D points and faces.

The end result is a much neater maze, and it is away quicker. The most complex test I had was taking OpenSCAD over an hour to convert to STL, but the new version is just over a minute, and most tests are a few seconds.


The other big difference is I have also released the C code on github. Enjoy.

See https://www.me.uk/puzzlebox for a custom maze SCAD.

P.S. Updated many times since I started on Christmas day. Always one extra tweak :-)

*I do not trust the download count - the file download count goes up way faster, so even counting "download all" as one download it is way off, and there are 50 files. It seems someone downloads every minute or two, and just as many access my web site to make custom mazes - amazing!

P.P.S. One more tweak - I added a mode to alternate "inside" and "outside" maze :-


P.P.P.S. One of the things I have done in this case (as you can see from the source) is make use of popt more than usual. Apart from just using as command line arguments, the same structure is then used to parse QUERY_STRING args, generate the comments in the header of the output, and even generate a web form. This means I can add new options in one place and not repeat myself.

P.P.P.P.S. I worked out a way to make the maze more challenging: The maze is drawn by a path from a point, taking random turns (with some bias) and back tracking when no options. I have now made it run multiple paths from the starting point concurrently so that there should be multiple reasonably long paths from that point, all but one of which will ultimately be a dead end.

2018-12-24

Meaning of an Amazon Christmas?

I heard that Coca Cola managed to get the red coat on Santa due to advertising in the 30s - though wikipedia suggests not quite that (here).

It seems odd in many ways quite how quickly "tradition" changes, and when you have a tradition you assume it has been the case for all time. Basically, anything that was the way it is before you were born, and even more so, before your parents were born, has always been so...

The history (assuming this video is correct) is quite crazy, in fact...



So I was pondering where it will end up in another generation or two. Even if Coca Cola did not have as much influence as it seems, I can see how a large company may want to create a change in "tradition" for its own ends.

It probably just takes a book, or more likely a book and a film and maybe a theme park, to change a tradition. So what could come next?

My guess is Amazon do something where Santa's "North Pole" operation is actually an Amazon fulfilment centre. After all, under the brown paper wrapping, almost (not quite) all of the presents I have wrapped are then in Amazon boxes (some even unopened, just wrapped up when they arrived). And some that did not arrive in Amazon boxes have then been put in spare Amazon boxes as easier to wrap.


As I mentioned in an earlier post, unusually, I have ended up buying more presents this year, and a part of that is the ease of buying from Amazon. Several presents have been a result of a passing comment over coffee and I whip out my phone and quietly order the very thing my wife, or someone else, wants, even for delivery Christmas Eve!

P.S. Merry Christmas or other holiday to which you are looking forward, and have a happy Gregorian calendar new year.

2018-12-18

Is my LG TV haunted?

A few days ago my TV announced it had new s/w to download, so I let it do its thing and upgrade.

Maybe that was a mistake. Yesterday I came in to my man-cave and the TV was on, no signal. That is odd for two reasons: (a) I turned it off the night before, and (b) it turns off after a while with no signal (or used to).

I assumed I was being silly. But this morning the same, and I was suspicious.

Later during the day I popped out today for a coffee, and I definitely turned the TV off when leaving. My wife saw me do it - I am not going crazy. When I came back, there it is, on, no signal.

So I did a test - I turned off the TV.

It turns itself back on!

It also turns on the (connected) Apple TV (as I would expect), and after a while the Apple TV goes off leaving the TV on with no signal. It stays on!

I can only assume this is LG's latest "burn up your OLED pixels quickly" software update. I can't think of any other reason they would do this. Very annoying. Not quite sure what to do - the power socket is an option, but annoyingly all hidden behind the cabinet, and rather tedious to say the least.

FYI I went in to menus and it has "turn on by WiFi" and "turn on by bluetooth", both of which I have disabled, but no different.




P.S. Disabling the simlink stuff "fixes" it, but why was it suddenly broken. It was fine before. Arrrg!

Game Over for Stargate playing cards

I am really sorry to have to admit defeat.

After a lot of work on this, and a lot of obstacles, I believe it is impossible to get a licence from MGM. Whilst their contract has a number of issues, by far the most problematic is that in order to purchase a licence from them, they require me to assign all copyright in my product to them. No, they don't pay me for that! If this seems backwards to you, you are not alone.

I made it clear from the start that the designs included some creative commons work - so they knew it would never work all along. Even if that could be solved by a lot of re-design, it would mean rights in my playing cards designs assigned to them - which means all the other playing cards I have made being theirs - so I'd need to buy a licence to use those (even though I designed them!). This is not, in my view, how copyright is meant to work!

Anyway, this is the video I made earlier. I have not had any further reply from the licensing people, which I can only take as confirmation of my understanding. A bit rude to just ignore me, but seems to be typical of all of the interactions I have had on this. Shame.

I went to Cal Mah, and sadly there was not much merchandise using MGM copyright material (apart from "Stargate Command" stuff which I believe is MGM) - now I know why.

Sorry for getting anyone's hopes up. I'll be removing the Alteran Bridge Club pages, etc.

2018-12-15

Another new toy

I have posted before, saying I am trying to lose weight, and things have been going slow and steady. Thanks for all the feedback and advice.

With the weather getting worse the "walking" had somewhat stopped, which was a slight issue.

I now have a treadmill! It means I can walk and walk and walk and still be in front of the TV. It goes quite well with my new watch setting goals for daily activity.

Weight loss is once again happening. Yay!

P.S. The watch is still going


2018-12-12

Ho Ho Ho!

My wife usually manages most of the Christmas presents, but this year I have got a few.

It all started with seeing something and thinking "Oh, Lewis would like that", or "Oh, Bobby would like that". Before I knew it I had a few things stacked up for grandchildren and then something for my children.

Of course, with two more grandchildren, next year is going to get even more complicated.

I hope they like the wrapping paper :-)

2018-12-08

New watch

I got myself an early present. A new watch. To be honest, there was nothing wrong with my old one - it never needed charging (solar) and had radio clock so always accurate.

However, I saw this new watch and thought it was at last a vaguely "smart" watch that does not need charging.

I told myself I was not getting a "smart watch" until there was one that did not need charging. I had a Garmin one once, and it needed charging every night and I hated that.

My son, quite sensibly, berated me for buying anything off a Facebook advert on the basis that they are all scams (and sadly, one other thing I bought was a scam and I am waiting to get £40 back from Amex for that). However, to my surprise the watch does not seem to be a scam!


It's a Matrix Power Watch, waterproof, and to my surprise thermally powered! It links to my phone via bluetooth and does calories, steps, distance (how?), and sleep tracking. It has an e-ink type display. It actually has a choice of watch face display, and I hope they add more choices later as I'd rather see one like the above but with larger date and day of week rather than "REALTIME POWER" which is pointless being on the display. It even has a back light!

Also, the strap was crap (in my view), but it is a standard 24mm fitting, so I was able to get a nice metal black strap from Amazon, which is (in my view) much nicer.

So now I am doing the whole "completing the circles" thing, with a new treadmill (another new toy), and trying to get fit :-)

It will be interesting to see how it goes.

I am, however, of the view that these devices are really crap at even counting steps, let alone distance. But if it is consistent itself that will still help ensure I keep up the exercise.

Update: Yeh, it has odd ideas, like 500 steps already when I got up this morning (I don't sleep walk).

Update: After several weeks using it, very few quirks, it actually works, and it its counting steps sensibly it seems. Later s/w is nicer.