Monday, May 28, 2018

Polygonal knitting!

Hi folks, this is a quick little computational knitting thing.  Years ago, I looked into how you could work out knitting pictures into circular knitting - this is a little tricky because you first need to convert your picture into radial coordinates, but you would also like to account for the knitting not being perfectly circular (because there's pooling with the increases).  The solution I came up with was to purposely knit a polygon, then map these into 2D cartesian coordinates.  This, along with some radial curves led to this: https://www.ravelry.com/projects/Jhadur/aromantic-hat

This was quite cumbersome, took a lot of set-up, and particularly required me to express the heart shape as a mathematical equation - so it's pretty hard to generalise.  What I've aimed to do this time is to come up with a system which makes all of this automatic, using the existing declarative knitting framework I've got set up.
So, how does it work? You provide an image, and a target number of colours.  The system then picks out the dominant colours and flattens the image to use just those (this is important because I want to be able to do this with photos as well as block graphics).  Here's the sample image I made to test this with:
Next, you specify the number of sides you would like your polygon to have.  The system uses this to work out a pattern of increases.  The trick here is that you want an average of ~4 increases per row, and will have increases at both ends of each side.  Once that's done, we can take the location of each stitch in that pattern and work out it's location in cartesian coordinates - this isn't quite radial, instead you need to find the side it's on and interpolate between the two vertices.  This can then be output as a spreadsheet:
Of course, it's quite hard to know if that's right!  It looks plausible, but it's hard to be confident without doing a test knit.  So using this pattern, I made these two little doilies!  The shapes aren't perfect, but I think a lot of that is because the stranding has altered the tension slightly.  I'm definitely impressed with how close it came, and it's certainly better than I could have done by hand!

Next step with this will be to write up another little modules for Declarative Knitting Tools which provides a web front end to kick it all off!

Happy knitting,
Hugh.

Declarative knitting in the cloud!


I've talked a bit about getting this up and running, and now the website is live:
http://www.declarative-knitting-tools.com/

The idea will be that it's a place to put little knitting tools for generating different kinds of knitting patterns.  Each tool will be quite small, and probably quite niche, but the idea is to build up into a collection of curiosities.  For now it's just got one, which generates shadow knitting patterns, but over time I'll be looking to add more - ideally adding a new tool should be quite quick - particularly, the majority of the effort should go into solving the actual computational problem, rather than building the website.

For now it's hosted on an EC2 instance on AWS - I'm keen to transfer it over into a serverless arrangement, but this may be a little difficult since it has a dependency on an installed copy of OpenCV for image processing.  I don't believe this would be possible in Lambda, but it's possible there's an approach with containers and ECS which would be a good fit.

Sunday, May 13, 2018

Declarative knitting

Hi folks!
There's a project I've made a start at a few times, but not entirely followed through, to make a kind of programmable knitting pattern generation toolkit.  The aim of this would be to make a kind of API for specifying knitting patterns programmatically - this would allow patterns to be generated based on data and computation, where this would be complex or laborious to do by hand, and to make the infrastructure behind it shared and re-usable.
My motivation for this comes from a few different projects I've done in the past to make mathematical shapes - I found that usually the computation part was quite straightforward, but outputting this as something I could knit took up most of the effort.  For example, calculating surfaces of revolution, or mapping images into polar coordinates.  At the same time, I design a lot of toys, and find that the bulk of this, especially the shaping, uses a pretty small number of concepts, which can easily by layered on top of each other.
The big idea behind how I'd like this to work is for the patterns to be expressed in a "declarative" style - a designer should be able to express "work in stocking stitch, increase evenly along the edges, for 10 rows", and leave the program to work out which specific stitches needs to do what.  The system should then be able to generate a fully detailed pattern, and express it in common formats - as text, charts, or others.  And of course this should be extensible, so that it's easy to add in new "rules" which can be used, particularly as there are so many styles of knitting that it would be impossible to express them all beforehand.
Then my big aim with all of this is that it would become possible to create "rules" based on complex computation too.  I'm working on a few of these initially - one which creates shadow knitting patterns based on images, one which creates lace patterns using edge detection, and one which will makes lace patterns from cellular automata.  Of course, these are only examples, but my hope is that I'll be able to take quirky ideas like these and make them accessible as a website where knitters can automatically generate patterns of their own.

The code for all this will be open source, and is on github:  https://github.com/griffiths-hugh-git/declarative-knitting/issues
The web services I'm hoping to get deployed on AWS in the next few weeks.

I'm pretty excited about it all!
Hugh.

Data Structures

Hi folks, I haven't posted any new projects for a while, and I've got a few waiting!
What I'd like to write about today, is my set of data structures.  The big idea here is that concepts are easier to explain and understand when you boil them down to their essence, and make them as concrete as possible - it forces you to think about what you really mean by them.  And because of that, it also makes it easier to explain to other people - so these are designed to be educational toys.
At the same time, data structures are a key part of computer science.  Writing good algorithms usually comes down to how you structure the data they need to work on, and good algorithms allow us to solve problems cleanly, elegantly, and fast.  They're a key enabler for how computers have changed the world, and they will only become more important over time.

The idea of the pieces is that each structure has a starting point (the purple ring), a number of arrows (which act as references), and a number of brown cups.  The "data" is represented by the plastic balls, which can be put in, taken out and moved around.  These are removable, which shows that the structure doesn't depend on the data objects themself, it just organises them.
So, the structures I've made, and what they tell us: 

Linked list


One thing you definitely need to do with a set of data is look through it.  Linked lists are very good if you just want to look through all the objects you've got in order.  You start at the initial point, and follow the arrows to look through the items.  This is great, and very flexible, and makes it easy to add new items to the list.  What it's very bad at is if you want to find a specific object - then you might need to look through the whole list to find it.
So this is good if you're going to need to add and remove objects a lot, and if you mostly care about looking through them in order.

Array

So next up we have an array!  This time you have a rigid structure, with references at fixed intervals along it.  This means you can still look through the objects in order easily, but if you want to go to a specific entry (say the fourth), you know how far to go down the rod to find it (four steps), so you can go to that location in one step, without having to go through each of the other entries.  The down side is that if you want to add new entries, you might need to do a lot of work moving other entries around, and of course the array is a fixed size so if it's too short you'll just have to make a new one (and if it's too long, it's just wasted space.
So this is good if you've got a set of things which won't change much, and you want to pick out specific entries.

 Binary tree

But we can do better!  Suppose our data items come with some kind of order - here I've ordered the balls by colour, red to purple.  If we want to find a specific one now, we can start at the top and at each step ask, is the current one our item?  If not, is it further towards red than ours?  If so, go left.  Or is it further towards purple?  In that case, go right.  Clearly that's more complicated, but you can see that here we've got 8 objects and can find any of them in at most 3 steps.
I wanted to get across too that balance is difficult for binary trees.  Not all the branches have the same length, and you can see the one on the left only has one branch - this points to the problem you have with adding and removing entries in a tree, that you might have to do some extra work rebalancing the tree, or you might accept some inefficiency if you let it get out of hand.

(One structure I'd like to make in future is a red-black tree, to tell the next step in this story.  They're a wonderful concept, and already beautifully graphic!)

Hash table


The last of my data structures for now is a hash table - the idea now is that if you have a kind of summary of your data object (a hash function, here I'm using the colour of the ball), you can arrange it so that to find it, you just need to follow the arrow of that particular colour, and again this can be done without needing to look through all the entries.  But then we have an awkward question of what we do if two data items have the same colour (hash collisions!) - to be able to store both we need to fit both into a "hash bucket".  I'd hope this could lead to an interesting discussion of why a good hash function is important, and how using this structure efficiently can need us to think a bit about the distribution of our data.

So those are my data structures!  There's a couple more of these I'd like to do, and I am planning to write up a pattern for these.  I'm also interested in other data structures people would like to see - I've had requests for a 2D array, and for a ring buffer, which are both interesting challenges, so I'll have to see if I can come up with a way to represent them!

Happy knitting,
Hugh.

Saturday, April 15, 2017

Permutation cardi



There's some maths behind this one!  The idea here is that there are exactly 6 ways to permute 3 elements, and each of the cable represents one of these two permutations.

We can describe a permutation by writing down what it does to the elements 1, 2 and 3 - so the two cables on the front represent (1, 3, 2) and (2, 1, 3).

The ones on the back are slightly more complex - these ones represent (2, 3, 1) and (3, 1, 2), but in these cases you've got one element moving two places, which distorts the knitting a little more, so I've broken these into two steps each containing a single crossing.

The arms are the bit I'm most excited about - of the 6 possible permutations, there are two pairs which are mirror images (the ones we've seen), but the remaining two are their own mirror images, so they don't have a relationship - (3, 2, 1) and the trivial permutation (1, 2, 3), which leaves everything unchanged.  These give this nice asymmetry between the two arms.  (3, 2, 1) again has elements moving two places, but it's hard to break this up into two steps, so here I've added an extra chain stitch to extend the cables.

Also exciting, the length of the repeats varies between permutations -  this gives their order in the symmetry group: (1, 3, 2), (2, 1, 3) and (3, 2, 1) all have order 2, (2, 3, 1) and (3, 1, 2) are order 3, and (1, 2, 3) is order 1, so the lengths of their repeats is different.  It's cool too that these all divide 6, so if you could fit in exactly 6 repeats, all the cables would end up in the right place after the same number of rows.

You could go much further with this too!  These permutations are at the heart of bell-ringing, although taken much further - for example here.  I love the intricate patterns this gives, but I would be wary of doing this with intarsia cables - as much as I love the colours, this ends up with the yarn getting crossed and needing to be constantly untangled.  Still, imagine that beautiful scarf with rainbows weaving together!

Saturday, March 4, 2017

Foxtato pattern!

Also!  I should have mentioned here, I finally got around to posting my Foxtato pattern - you can see this on Ravelry here, and it's available for free download: Ravelry download

Looking forward to seeing other people's projects, and to see them Doing The Thing!

Hugh.

Data structures

Hi folks!  (I aten't dead)
I was thinking recently that I haven't made nearly enough things to do with computer science, the same way I did for maths, and it's time to fix that!
So this project is to knit a family of data structures.  The idea will be to take a bunch of plastic toy balls to represent data items, and knit wrapper cups, connected together in different ways, to represent the data structure itself.
I've got ideas for a few of these:

  • Linked list - each node has a link to the next node.
  • Doubly linked list - each node has forward and backward links.
  • Binary tree - each node has two children.  I'd like this to be unbalanced, so some of the branches will be longer than others.
  • Red-black tree - another binary tree, but with coloured nodes (and this one will be balanced).
  • Hash table - a single parent has a bunch of child nodes, each with a coloured rim to represent the hash value of the objects to place in it.  Some of the child nodes will also form (small) linked lists, of the same colour.
  • Array - a string of references, only some of which have a node attached.  (It might be more accurate if he nodes are all there, but only some of them are filled, but I think this would make it harder to distinguish from the linked list.
I'm planning to write up a pattern for this one - it should be pretty simple since the only components are the cups and the references.  But I'd love to see people knitting some other structures too, and maybe they'll be useful as teaching aids at some point?  The one drawback is this means I need to knit a *lot* of identical cups, I think the whole project will need about 40 of them.

Happy knitting,
Hugh.

Sunday, November 1, 2015

Ace-cephalopods

 The aim here was to make an ace-cephalopod, an asexual octopus, after seeing these awesome LGBT marine animals.

They're modelled on the giant pacific octopus, the main features are the head part, which leans backwards and has a slight fold where it attaches to the body.  There's then a bit of a waist, before it separates out into the arms.


The first one turned out a little more cute and cartoonish than I'd hoped - its body is too big and round, and the tentacles are too short.  I think the big problem though is that the eyes don't point outwards, so it's natural to see it as just having a big face, rather than seeing the eyes pointing sideway.  Regardless, it's pretty cute, and reminds me a lot of the dumbo octopus.  I really like how it stands up too - I'd consider adding a suction cup to the underside so it can be attached to things.

The second one I'm much happier with!  He has a real angry glare to him, and his features look great.  The main differences here are the tentacles are much longer, the head is a bit narrower and the waist more pronounced, and I've reworked the colours to give a bit more emphasis to the head.  And of course the eyes now come in little capsules so they protude and point outwards properly.

I had great fun wandering around out local docks taking pictures of them (and explaining to passersby what I was doing) - you can see the rest of them here: http://s12.photobucket.com/user/griffiths_hugh/library/Ace-cephalopods

Knitting these did make me realise quite how often the things I knit seem to end up having tentacles.  Going to try knitting a few more land-based things next!

Happy knitting,
Hugh.

Saturday, October 24, 2015

Getting ready for winter


 With winter coming, it's getting a little colder, and we're all keen to wrap up warm.  But among all the snug jumpers and mittens, let's not forget about our chlorophyll-bearing friends.
 (This comes from a suggestion from Facebook.  The hats are for the Innocent Smoothies campaign, and have been sitting in a box waiting to be sewn up for an embarrassingly long time.  No plants were harmed during the making of this.)

Enjoy,
Hugh.

Monday, August 31, 2015

Beethoven Mittens finished!

The Beethoven mittens are finished!
The basic design aims to be quite simple, with a single colour and minimal shaping. 
The flip tops are a little more involved - the fingers and the thumb both flip back, which I find really useful when moving in and out of cold places, and for fiddling with phones and things.  Making the thumb flip back is slightly unusual, but I find you need that too, particularly for smartphones.
I was expecting the openings to be more of a problem - with two layers of rib, they're quite thick, which I thought might be a bit awkward, but seems fine.


I changed the text from what I had planned, so the final two lines are:
"Alle Menschen werden Bruder"
"Und der Cherub steht vor Gott"
I decided that I liked the contrast between the two statements.
The font is aiming to be a little gothic, so the letters are tall, narrow and angular, and the heights are a little quirky.
This was quite fiddly, and took a few goes at it.  The problem with writing is that you have to figure out coherent rules and principles for all the letters, so they have a consistent look and feel.
I was amazed how much space they took too - I thought this would fit easily, but it was pretty close.

So, I'm pretty happy with how these turned out!  I'm enjoying wearing them, and they're a great reminder to be joyful all the time :)

*edit - realised later that I'd missed an "n" from "Menschen".  I went back and corrected that, but forgot to take a photo afterwards.  Ah well.*

Happy knitting!
Hugh.

Acephalopod

Just a quick project today:

I came across this, and thought it was pretty cool, being a fan of diversity, cetaceans and also terrible puns.  I'm quite tempted to make all of them, but have made a fair few whales before.  So in the meantime, I thought I'd continue the theme by making an acephalopod. 

This will be quite a small and simple octopus, in the colours of the asexual flag.  In the spirit of sexuwhales, I'll make the colour appear in bands (I did consider having tentacles of different colours, but think that would be harder to balance overall).  I'll also start with the head being the purple side, since this will show up the features better, but does mean it's technically upside down.

I think it needs saying too that if you think this is a terrible pun, Taylor Swift is even worse:
http://internet.gawker.com/taylor-swift-to-nick-jonas-in-alleged-leaked-dms-are-1682093508

You're whalecome.
Hugh.

Sunday, December 7, 2014

Lobster mittens




This project may be a bit self-explanatory.
They're influenced by these:
Duck booties
And a general love of animal clothing.
Whenever I where mittens, I find I have to adjust to the different types of hand movement they allow - you have to get used to moving your hand as a whole, and you can't use your fingers in the same way.  This means you end up developing a totally different way of handling objects.  So, with these mittens I thought with these mittens it'd be fun to play with this idea a bit.

Since you have to get used to this different style of movement, these mittens mean you also get to pretend you're a lobster!
The design is aimed to be slightly subtle, just a matter of shaping- The main section decreases from the outside, and the thumb is pointed and to the inside and extends a way beyond the end of the thumb.
They're fun to wear, not entirely impractical (you have to be careful with the thumb part), and you get to whoop like Dr Zoidberg!

Whoop-whoop-whoop-whoop-whoop!
Hugh.

Sunday, November 30, 2014

Ode to mittens

It's been a while since I last posted here, but I've found a little more time for knitting lately, so have some new projects to share!

With one thing and another, I've ended up listening to a lot of Beethoven lately, particularly the Ode to Joy (Beethoven is great music to code to).  It's a beautiful piece of music, but it's the lyrics which make it absolutely stunning:
 
https://en.wikipedia.org/wiki/Symphony_No._9_%28Beethoven%29#Text_of_the_fourth_movement

It's an incredible poem about the power of joy, bringing all people together as equals, touching on love, friendship, division, pain and longing for God.  If you're not familiar with it please do read it (and listen!), it will absolutely be worth your time.  It's also the anthem of the European Union, and if one piece of music can sum up all that's best and most noble about the EU project, it's this.

So, I'm a fan.  And what better way to express that than with mittens?  So my plan is to make a pair of flip-top mittens (because all mittens should have flip-tops), which will have a couplet from the Ode to Joy written across them.  It's hard to pick out just two lines, there's so much in there, but for me these are the central ones:

"Wollust ward dem Wurm gegeben
Und die Cherub steht vor Gott"

"The worm was given desire for life,
And the Cherub stands before God"

One other thing - rather than writing this across the backs, where it will be more visible, I want to write it across the palms.
I always feel that writing slogans on things is about how you present yourself to the world, how you would like other people to see you.  What I want here is quite the opposite, it's about how you live inwardly.
This'll mean that they'll be outwardly fairly plain, with the text not visible most of the time - I think that's quite appropriate too.

Happy knitting!
Hugh.

Wednesday, January 1, 2014

Hatful of sky (blogging returns!)

Hi folks!

I haven't blogged for a long long time, and haven't been knitting so much lately, but since I've been designing some more stuff lately I figured now would be a good time to start it up again.

The idea of this one is to make a two-sided hat, with the outside just plain colours, but the inside patterned using the cosmic microwave background (CMB) map.  The idea is that from the outside it looks simple, but hidden away is all the complexity in the universe.
I probably need to say more about the CMB - shortly after the big bang, the universe was dense, hot and opaque.  As the universe expanded it cooled, matter condensed, and galaxies and stars began to form, and the universe became largely transparent.  As this happened, that primordial light continued on its way, cooling as space expands around it.  It was calculated that given the age of the universe, this light would have a specific temperature associated with it, around 3K (-271 C).  Finding this experimentally was an incredible result, and crucial to our current understanding of the universe.  This was theorized in the 1950s, verified experimentally in the 1960s, and generally accepted in the 1970s.
Even more incredible, in the 80's, scientists then started looking at 'anisotropies' (small differences in the CMB).  There's a couple of large features, but the really interesting bit are the "fluctuations".  These are thought to be caused by quantum fluctuations in the early universe, tiny random changes which led to slight instabilities and were magnified as the universe expanded.  The idea is that these fluctuations led to the instabilities which would later form into clusters, galaxies, and stars, and all the structure in the universe.  If this is right, these fluctuations could record the very earliest history of the universe, the cause of all the large-scale structure of everything.  These fluctuations were first mapped by the COsmic Background Explorer (COBE) satellite in 1992, although more detailed maps have been produced since.

For knitting purposes, converting this map into a useable chart has some interesting challenges - the CMB map is complex and intricate, and the shaping of a hat is non-trivial, so producing a chart by hand would require a lot of work.
Instead I'll be doing this computationally (more on this another time) - using row and stitch numbers to map from individual stitches to a system of polar coordinates, which can then be found in the image and its colour determined.  Doing it this way also means that it's almost trivial to recalculate this for different sizings, just a matter of changing some parameters are re-running the program.
It also means that a different source image could be substituted - this will then make a hat pattern with the new image embedded in it.  That said, there's a few approximations made with the coordinate systems, and I'll need to try it out to see how much distortion these cause - of course the CMB map is quite forgiving of this kind of thing, but other images may not be.

That's the plan anyway - pictures when the hat is complete!
Hugh.

Sunday, September 18, 2011

I aten't dead!

Hello!
I haven't posted for *ages*, and was recently reminded that I really should.  So -- I haven't been knitting much lately following some pretty dramatic happenings in my life, which mean I don't have a lot of spare time lately.  That and forgetting to take pictures of things.
I have done some stuff though:
  • I made a collection of rockets for a friend's baby, who was born 50 years and a day after mankind first made it to space.  There was a US Saturn 5, the USSR's Soyuz rocket, and the ESA's Arianne.  The Saturn 5 was the hardest to do, because there's so little distinctive shaping to it. But I forgot to take pictures, and hopefully (because all good baby toys should be) they'll've been heavily mauled by now and not too photogenic.
  • Something decidedly NSF-blog-posting for (the awesome) Kate J.  I may put photos on Ravelry at some point, where there's a little more privacy.  I'd quite like to write a pattern for that one too.
  • The Little Prince!  I read the Little Prince recently(-ish), and was very struck by one of the pictures, in which he's wearing this very flamboyant outfit, so I wanted to knit that.  I've got just about all the pieces done, but the sewing up is going to be a pain, so I've been putting it off.  I love how that shaping turned out, which is part of why I don't want to rush sewing up.
In other news, I recently obtained a Kindle, and they're totally the future of how to read knitting patterns, particularly since PDF seems to be the standard format for Ravelry patterns, so all of those can go on it.

So yes, that's me.  I'm not likely to have much to post for a while, but I will try to write something here from time to time.  Hope you've all had a good summer!
Hugh.

Tuesday, March 8, 2011

International Women's Day! -- with Cthulhusaurus

Ok, just a quick post now cos I want to get this up for Women's Day.
As I explained, Cthulhusaurus is a combination of T Rex and Cthulhu, loosely based on this image. Being an elder god, Cthulhusaurus is genderless. It is, however, pink and wears ribbons in it's hair*. Naturally if an elder god/giant carnivore mix decides to wear ribbons, it's best not to argue.

So yes, I thought this would be a fun little project with interesting gendery consequences. The design is relatively simple -- it's made of a main body, a pair of legs, and a head, with the coloured strips being knit and sewn on later, and the arms are (mostly) i-cord.
I'm not totally convinced the head is the right size -- I usually make heads too small, so this time I aimed really big, and may have overdone it. I love how the frilly strips came out, they add just the right dash of colour and interest.
Possibly the hardest part was the bow -- there's an extra flap knit on the head for this to tie on to, which was nice and simple, but tying the thing turns out to be *way* harder than I'd imagined.

So yes, I'm rather happy about this :o) I should really take it out for some better pictures in the sun, but as I say, wanted to get this up today.
Happy IWD, everyone!
Hugh.

Sunday, February 20, 2011

Cthulhusaurus


Ok, another quick-ish project!
This was suggested by Leah, who said I should knit one of these. I agreed, but said that if I did, I'd want it to be pink and have a bow on it's head. Then things got a bit political.
While I do like pink things with bows on, I don't like that these are the universal symbols of femininity. So to reflect this, I decided that my Cthulhusaurus will not have a gender. Cthulhu doesn't, after all, so it makes sense. And like Cthulhu, if it wants to wear bows, you'd better not argue.

So that's the plan -- a T-rex, with tentacles, pinkness and bows, and is ungendered. Worryingly, this is still one of the less weird things I've knitted.
Hugh.

Thursday, January 27, 2011

Feminist Uruk Hai

Plan for the future -- I want to knit a little troupe (horde?) of feminist Uruk Hai. Why? An awful pun of course:
It is an army bred for a single purpose: to destroy the world of Men.
The plan is to make up a simple Uruk Hai pattern, and replace the 'white hand' logo with a feminist sign. The hard part, I think, will be figuring out what distinguishing features the Uruk Hai have which make them different from any other small green humanoids?

Happy knitting!
Hugh

Wednesday, January 19, 2011

Predicate scarf


Ok, new project! Following on from the 'e' scarf, I'm planning to make a second scarf from the same wool. The concept of this is a little hard to explain.
Fortunately it's easier to describe the design itself -- it will be a plain grey scarf, embroidered in the multi-coloured yarn with "+5 resistance to predicates".
So, why? It's similar to Tea Cosy of +4 Wellness I made a while back (and hence to Cayenne's original on which this was based). This refers to role-playing games, in which objects can add or subtract different attributes from players.
And predicates. People define themselves in many different ways, and each of these definitions comes with a range of expected behaviours. Often, I think, people seek out identities in order to know what they should do. By "resistance to predicates", I mean the opposite of this, creating your own identity rather than using a pre-made pigeonhole. It's also intended to be a bit silly -- predicates include any property which can be assigned to a thing, so it's a bit ludicrously broad to claim resistance to them all (and probably counts as a predicate itself).

So yes, bit of an odd project, and rather hard to explain. And possibly involving misrepresentations of grammar. But hey, complicated is good!
Hugh.

Sunday, January 16, 2011

e scarf

Hi folks.
This is a quick, simple little stripy scarf, made mostly because I like the idea of contrasting multi-coloured yarn with a nice solid main colour.
The design is based on the number 'e', or Euler's number. It's a remarkable number, and I'd say it's the second most important irrational number out there, and rather sadly neglected.
Euler's number is the base of the natural logarithm, as well as cropping up in differential equations, limits of sequences, and compound interest. It's also related to pi by the rather amazing equation e^(i*pi)=-1.

So, the scarf -- the lengths of the stripes represent the digits of e: the first stripe has 2 rows, the second 7, the third 1, and so on, giving e=2.71... (In fact it uses pairs of rows, since this makes the colours come out nicer)
As with most irrationals, unless you know exactly what you're looking for the pattern appears to be random, so it's just a nice stripy scarf.

So there it is, stripy e scarf!
Hugh.