Today, I was reading the BBC news and I stumbled upon this GCHQ puzzle: Take the digits 1,2,3 up to 9 in numerical order and put either a plus sign or a minus sign or neither between the digits to make a sum that adds up to 100.
For example, one way of achieving this is:
1 + 2 + 34 - 5 + 67 - 8 + 9 = 100, which uses six plusses and minuses. What is the fewest number of plusses and minuses you need to do this?
I love to challenge myself with these kind of puzzles, so I solved this and here is how:
We have 9 numbers [1 to 9] and also we have three possible separators [+, - and nothing] which to fill the gap between numbers we have 8 combinations of separators, e.g. we have 1+2+3+4+5+6+7-89 which in this case we have six times plus, one minus and one time nothing. So, I need to find all possibilities of combination which total is: 6561
Then, hook the possible combinations into numbers and check the total, easy enough. Now print the solution.
I have worked with Prestashop 1.6 long enough to know inside/outside of the application and even I developed few modules myself, all is simple and great but in small scale. My application is big, I am talking about millions rows in database. Two databases weight almost 18G (see the picture).
One day at 2AM I received a notification that my website/application is down. I looked at the server the application seems OK but the databases gone crazy big, (see the picture) it has gone from 18G to over 90G less than 6 hours.
Since there was almost none free space left on the server, all server running really slow even I could not restart NGINX. All was frozen. All my websites/applications run on dedicated server on UKFast, so none of websites would work because all is glued together.
There are many issues here, e.g. the server infrastructure is wrong (I know that already), there should be monitoring service in place which there was no such thing (I know that too) etc. but why this happened,…
I am sure everyone knows the comfort of being on autopilot, less decision to make, apparently it's more reliable and with less potential mistakes as someone else tested and worked for them therefore it should be safe. but it is true?
But life is not that simple, although the easy way(for now) is to avoid thinking about it. To me at this points of the time (this may not be true in the future) life is a book which you need to write it so you write as you wish. You can write a sad story and make the main character a victim or write a happy story be a strong characters.
The best way to predict the future is to create it
Abraham Lincoln or Peter Drucker or Alan Kay (don't matter who said it)
In summer 2016 I had an interview with a startup so few days before the interview date I was preparing myself for the interview and I came across this quote and made a note of it. When I entered the interview room, obviously I looked around the room and as my surprise I saw this frame hanging o…