I use this blog as a soap box to preach (ahem... to talk :-) about subjects that interest me.

Tuesday, December 20, 2011

Lacing Shoes

Almost one and a half years ago, I posted an article about how to fold toilet paper (Toilet paper woes).  Today, I would like to write about another simple task that often doesn't receive much attention (except by me, that is): how to lace shoes.

After deciding to write about this neglected subject, I discovered a great website entirely dedicated to the different techniques for lacing up shoes: Ian's Shoelace Site.  Very thorough a professional.

Perhaps not surprisingly, the discovery of Ian's site didn't deter me from writing here my reflections on the subject.  Ian shows diagrams for 36 different ways to lace shoes, but I will concentrate on the three methods that, as far as I can see, are used by the vast majority of people.

Here is the first method, in which one side of the lace spirals through all eyelets and the other side goes through to one of the two top holes:

The advantage of this method is that, if the two sides can come close together, the loops are parallel to each other.  This appeals to many, and I have often found that this method is applied by salespeople.  Perhaps they do it because, with this method, you don't need to count holes.

I hate this method.  After a while, it tends to skew the holes, as one of the bottom ones is strongly pulled towards the top.  It is also somewhat more difficult to open up the shoe, and the side of the lace that loops through tends to remain loose in the middle.  Besides, I like symmetry.

One variation of this method is as follows:


As you can see, both sides loop through each second pair of holes.  The loops remain parallel in front, while the skewing effect is significantly reduced.  But I still don't like it, because it remains asymmetrical and (don't ask me why) somewhat unnatural.

The third method I would like to show you is completely symmetrical.  Here it is:

In the example shown, the lace always go through the eyelets from the outside to the inside.  This is in fact a variation of the most common technique, in which the lace starts from the inside and always go through from the inside to the outside.  The result is a zip-like pattern that is quite pleasing.  Like in the previous cases, it doesn't require you to count the holes.  But it has two disadvantages.  The first one is that you cannot bring the two sides of the shoe completely together.  It is not a problem in the example, but I had sometimes shoes in which the two sides even overlapped.  The second disadvantage is that the two sides of the lace rub against each other, thereby making it somewhat more difficult to open and close the shoe.

The final method is the one that I consistently use.  Although, for the best effect, it requires you to count the holes (in, out, in, ...), it represents in my opinion the most pleasing solution in terms of symmetry, low friction, and applicability.


It is also nice to see the Xs formed by the laces inside.  Or not?

A Puzzling year indeed

In yesterday's article, I forgot to say that in 2011 I also developed a CalcuDoku-solving game for the iPad (search iTunes for CalcuDokus and you'll find it in your local iTunes store).

I first made a $0.99 version with 100 puzzles, and then a free version with 17 puzzles and advertisements.

Despite my attempts at getting some review sites to look at it, the results were quite disappointing.  Apple's AppStore is saturated with applications, and it has become very difficult to get noted.  Big games-developing companies systematically hit jackpots, but nanodevelopers like me have close to no chance.

Far from me the idea that my application is exceptionally good and overlooked.  But I am pretty sure that a couple of years ago, it would have sold reasonably well.  So, why did I wait for 2011 and a saturated market before developing for the iPhone/iPad?  Because I am stupid.  That's why.  I did the same with the Web: in the early nineties, instead of being one of the first web developers on the market, I developed an application for the Mac (MacDOS) that went nowhere.

Another missed opportunity...

Monday, December 19, 2011

A Puzzling Year

This has been a year during which I have concentrated on developing puzzles and writing about it.  I had always been interested more in developing programs to generate and solved numeric puzzles than to solve the puzzles themselves.  Towards the end of 2010, I finally dedicated myself to it.

The first thing I did was to write two programs to generate and solve Sudoku Classic puzzles.  I also added to the Generator the code necessary to create pattern Sudokus (i.e., puzzles in which the initial clues are arranged in a pre-determined way).  Once I was done with Sudoku Classics, I wrote a program to combine five pattern Sudokus into a Samurai Sudoku puzzle.

This work on Sudoku resulted in my first puzzle book, Sudoku Programming, which I self published at the beginning of April.  365 pages of strategy explanations, walk-throughs of "C" code, and examples.

Shortly after that, I thought that a book describing in detail the strategies to solve Sudoku Classic puzzles could be useful, and wrote Sudoku Explained, a booklet of 94 pages that I published at the end of May.  I offered it to the game shop Mind Games, that has since sold some copies.  Forget what they say about eBooks.  In terms of satisfaction, nothing compares with seeing your printed books on the shelves of a physical, old fashion, shop.

I had designed the head with the "Sudoku Brain" for my first book, and had the idea of placing small heads on the two sides of my name.  But, after flipping the small head to place on the right-hand side of the cover, given my perfectionism, I flipped each digit inside the brain back to its original direction, so that they could be read.  The devil is indeed in the details...

At that point, I decided that "C", after all, was less popular than Java, and decided to rewrite all my Sudoku programs in Java. This took a few months during the middle of the year.  After that, it seemed natural to rewrite "Sudoku Programming" for Java.  This time, I chose the more catchy title How to Create Your Own Sudokus with Java.  I contacted some publishers and also some agents, but nobody was interested in publishing it.  They all claimed that it was a very difficult book to place.  As a result, once more, I decided to publish it myself.

But while I was looking for a publisher for my Java book, I started working on another puzzle: CalcuDoku (see several recent articles in this blog).
I developed a program to generate and solve CalcuDokus, but this time I decided not to write books that explain how the programs work.  Similarly to what I had done with Sudokus, I wrote a program to compose CalcuDokus into larger puzzles.

Over the past couple of months, I have published three books of puzzles: 200 Puzzling Hearts, with 200 heart-patterned easy Sudokus, 200 Puzzling Shamrocks, with 200 difficult Sudokus patterned like four-leafed clover, and 100 Double CalcuDokus.

     

I am currently publishing what is going to be my last puzzle book (at least, that's what I am thinking now): 50 Samurai CalcuDokus.  This book has a larger format because the samurai puzzles are LARGE!



Next year, I will have to work on something else.  I confess that I feel a bit saturated with puzzle programming.  Perhaps, I will resume writing my historical novel Ciao Biondina.  But also a crime novel or an alternate history might inspire me.  We shall see...

Thursday, December 8, 2011

Double CalcuDoku #2

I can now generate Double CalcuDokus with any overlapping, although, at least for the time being, the overlapping region can only be a square.  Here is an example of a 6x6 overlap:



I find puzzles with large overlaps more interesting. It makes it easier to exploit the fact that the cells of each row and columns that are not share must coincide.  For example, in the above example, the three bottom cells of the middle column of the right puzzle include two singles: a 4 and a 2.  This means that also the top three cells of the same column must include a 4 and a 2.  As the 2-cell cage "9x" cannot possibly contain an even digit, it means that the they must be in the other two cells.

And here is an example of a 7x7 overlap:



The "edge effect" is particularly strong when the overlapping is 7x7, and makes the solution of the overall puzzle easier.  To keep the difficulty at a challenging level, I have therefore tweaked the configuration parameters and made the individual puzzles a bit more difficult.  Notice that in the above example there are three 5-cell cages and seven 4-cell cages.

I have just published a book with one hundred puzzles:


You can buy it in print from Lulu for US$9.99 or in several eBook formats from Smashwords for US$0.99.

Friday, December 2, 2011

Double CalcuDoku

I imagine that you are familiar with the double Sudokus like the following one:



I though: wouldn't it be nice to make overlapping CalcuDokus? Well, here is the first one I generated:


As you can see, I overlapped a 3x3 area. To explain how this works, I have coloured the puzzle, which is normally in B&W. The two squares are two normal CalcuDokus, but the green area belongs to both the yellow and the blue puzzles.

Notice that cages can cross the boundary. For example, the right-side cell of the 2-cell cage "2:" belongs to both puzzles, while its left-side cell only belongs to the yellow puzzle.

As I don't like puzzles that admit multiple solutions, I ensured that the program delivers a unique solution. The interesting thing with overlapping CalcuDokus is that they can overlap by any amount of rows and/or columns, while Sudokus, to maintain the integrity of the boxes, can only overlap by 3 or 6 rows and/or columns.

For the time being, my program only supports an overlapping of 3 rows and 3 column, but I am going to parameterise it. Then problem is not in generating and solving the puzzle, but in displaying it.

Concerning the name to give to these puzzles, I thought that Niken would be a nice possibility. This is because "Ni" means "two" in Japanese and KenKen (which is a registered trademark of Nextoy LLC) is much more widely known than CalcuDoku. In any case, "CalcuDoku", as a name, is quite long on its own. As "Ken" is a normal Japanese word (which, as you probably know, means "wisdom"), I don't believe that Nextoy could accuse me of infringing their trademark. I could also call it KenTwo or TwoKen but, somehow, it doesn't seem right. Also Kenni is not good. What do you think?

Saturday, November 26, 2011

KenKen and CalcuDoku

I found three websites that let you play daily KenKen (® Nextoy LLC) /CalcuDoku puzzles: kenken.com, calcudoku.org, and my website zambon.com.au.

While the other two websites include puzzles of different sizes, and calcudoku.org also includes variants, my website only includes 9x9 puzzles. KenKen and CalcuDoku are the same puzzle, but their implementation is done by different people. Each implementation has a different feel and, on average, different levels of difficulty.

I know how my puzzles are developed, but, obviously, I have no idea what algorithms the other developers use. I thought it would be interesting to identify some of the differences from a statistical point of view.

For this purpose, I analysed 10 puzzles taken from each website. I know that 10 is too small a sample to make good statistics, but it was a lot of counting...

Anyhow, what follows is a summary of what I came up with. To avoid repeating the domain names, I will use K to identify kenken.com, Z for zambon.com.au, and C for calcudoku.org. ‘A’ indicates values obtained by averaging all. The triplets of numbers indicate minimum, average, and maximum values.

Number of cages: K=[31, 33.2, 38]; Z=[32, 34.3, 37]; C=[33, 34.2, 35]; A=[32.0, 33.9, 36.7].

The average number of cages is for everyone around 34. But it is interesting to note that K's spread is 7, Z's is 5, and C's only 2. This might indicate that, while K and Z do not set any limits to the number of cages, C determines the cages not completely as a result of random choices. This might be consistent with the fact that C sometimes presents puzzles that have the cages arranged in particular patterns (although none of the puzzles I randomly picked belonged to that group). It would be interesting to know what Patrick (C's developer) would have to say about this.

With larger samples, I expect that Z's (i.e., my) number of cages would turn out to be normally (i.e., randomly) distributed. Actually, as I generate the puzzles, I don't need to do the counting, because the computer automatically lists for the number of cages. I can check it out right now.

...

It turns out that the number of cages calculated for 100 Z's puzzles is [32, 34.83, 38].

The following image shows how the normal distribution (the magenta squares) fits to the measured values (the blue diamonds; these are the default of Excel and I didn't bother to change them). The vertical bars represent a standard deviation from the normally distributed values. In other words, if the distribution reflects reality, there is a 68.2% probability for each measurement to fall within the bars. At the very least, the plot confirms that the number of cages in my puzzles is not in disagreement with a normal distribution. I confess I would have been shocked if it had not been so, because the distribution is the result of several [pseudo]random choices...


The following table summarises the counts of operation codes and cage sizes.


C has about 6 times the number of 1-cell cages that K and Z have, and half the number of 2-cell cages.  I will go out on a limb and say I believe that such differences are not due to statistical fluctuations within the samples. C also seems to have fewer divisions (1.3 vs. 3.5 and 5.5) and more cages with more than 3 cells (6.4 vs. 3.1 and 3.9). It seems reasonable to assume that the lower number of divisions (and perhaps subtractions) is due to the lower numbers of 2-cell cages.

In general, I have the impression that C's puzzles are more difficult than those of K and Z, and it seems reasonably safe to assume that the higher number of large cages is a contributing factor.

To deduce more from such a small sample would be inappropriate.

Sunday, November 13, 2011

Catholic Church? No Thanks!

I just published with Smashwords a short book titled Catholic Church? No Thanks!.

It collects a series of short pieces about the Catholic Church that I wrote over a period of time. They describe some events that occurred to me and some of my reflections on how the Church operates. I was never a fervent Catholic, but this booklet explains some of the events that contributed to my Atheism.

Tuesday, November 1, 2011

You can buy CalcuDoku for the iPad

My application to play CalcuDoku on the iPad is finally available in the iTunes App Store:



You can also check it out on itunes.apple.com

What are you waiting for?  http://planetsmilies.net/happy-smiley-567.gif

Sunday, October 23, 2011

Same-sex Marriage

Yesterday I talked about boat people.  Today, I feel compelled to write a short note about another issue that is being hotly debated in Australia.

Saturday, October 22, 2011

Boat People

Every year, some thousand people are desperate enough to attempt the dangerous crossing from Indonesia to Australia on rickety boats.  They pay thousands of dollars to the unscrupulous operators who own the boats, in the hope that they will be allowed to remain in Australia as refugees.

The CalcuDoku application for the iPad is ready

I have just uploaded the CalcuDoku application for the iPad to Apple’s application store.  They could still find something I didn’t do right and reject it, but I think (and hope) that everything will go smoothly.  I don’t know how long it will take before it will appear in the AppStore, though...

Unfortunately, I am also not sure that it will be available in the Australian Apple store.  The problem is that I am not registered for GST (for the non-Australians: GST stands for Goods and Services Tax and is Australia’s 10% value-added tax).  It is only compulsory to register for GST if your Australian business revenue exceeds 75 kAUD, and it is such a bureaucracy that you don’t really want to get into it unless you do have such an income and/or incur significant GST-deductible expenses.

It is not clear to me whether Apple will simply not pay me when they sell my application in Australia or (more likely) the Australian residents will be unable to buy the application locally.  In any case, they should still be able to buy it from the US store for USD 0.99 instead AUD 0.99 (actually a cent or two cheaper).  We shall see.

Now that this application is done, I will go back writing fiction.  I confess I am a bit fed up with programming.  As I said in a previous article, Apple’s development environment is great, but not bug-free.  In a couple of occasions, I had to find some workarounds to get done what I needed.

Monday, October 17, 2011

Why a bladder?

I have always had some of my most interesting ideas during the periods of drowsiness that precede and follow sleep.

Friday, October 7, 2011

The CalcuDoku application for the iPad is almost done!

Hopefully, in the next week or two, you will see the application in the Apple Store.  There will be a version with ten puzzles for free and a version with one hundred puzzles for a few dollars.  This is obviously to allow people to try out the game for free, and then, if they like what they see, buy the version with many puzzles to play.

Since the last article on this blog, I added a tool bar and a menu to select the puzzles, as shown in the following snapshot.


Tuesday, September 27, 2011

Progress on the CalcuDoku application for the iPad

This is to report on my progress on the development of the application I announced in my previous article. Here a snapshot that gives you an idea on some of the functionality:


Wednesday, September 14, 2011

A CalcuDoku application for the iPad

Perhaps you have visited my DailyCalcuDoku page. There, I provide interactivity with JavaScript, but all the work is done offline by a C application that runs on my server. Every day, a few minutes after midnight AEST (Australian Eastern Standard Time), the system launches the application, which uses the current date as a pseudorandom seed, and generates an HTML file with the daily CalcuDoku.

Actually, I have just realised that if you attempt to play immediately after my midnight, the program will fail. I have to fix it. It’s not nice when a program fails with no explanation. It might not seem a serious problem, but midnight here is 10 AM in Boston and 6 PM in Moscow...

Anyhow, after developing the Daily CalcuDoku software, I thought: wouldn’t it be nice to create an application for the iPad that does a similar thing? I started on 1 September, and the following snapshot gives you a taste of it:

Monday, September 12, 2011

How to identify some email scams

Some days ago, I received the following email (with my email address removed and the links disabled):

Subject: Your package has arrived!
From: UPS Shipments
Date: Wed, 7 Sep 2011 21:42:50 +0900 (KST)
To:

Dear client
Your package has arrived.
The tracking # is : 16B9159622A040A2 and can be used at :
http://www.ups.com/tracking/tracking.html
The shipping invoice can be downloaded from :
http://www.ups.com/tracking/invoices/download.aspx?invoice_id=16B9159622A040A2

Thank you,
United Parcel Service

*** This is an automatically generated email, please do not reply ***