Knit & Purl – The Knitting Pattern Generator

Last semester my study group was required to design and evaluate some random piece of software.  We chose to look into knitting pattern generators, because what is there available seems to be rather… abysmal (sorry to all the developers putting hard work in there, but a user study could have helped).

We did a Paper Mockup with a start screen:

The setup screen:

And the edit screen (look at the drag and drop function!):

We also created a computer based mockup version again with a start screen:

The setup screen:

And the editor:

I’m showing you both versions here, because they show different sides of the same thing.  The first one is more how we wanted the design to be while the second one maybe gives a feel for the interaction methods.

So, we didn’t get any further than this, but user tests showed that our knitting pattern generator is can be used more intuitively than the free programs available at the moment.  If you are interested in implementing our concept, just contact me and I can give you all the material and deal out the legal issues with my study group and university.

More toys!

See more toys I did:

The hello witchy!  This is a toy for a friend of mine who likes the colours blue and black.  Can be done at any time upon request, also with variations.

hello witchy!

Jim the Fish (yes, this is a Doctor Who reference).  Although he’s never really shown but only mentioned in the original series, I thought crocheting the fins in a hyperbolic structure makes sense there.  Also given to a friend.  Can be done at anytime.

jim the fish

Don’t think I’ve shown the elephant already.  The tiny one that is.  Sits with my husband at home and peaks from his shelfs.


A ladybug upon request.  Already sold.

a ladybug

And a bunny for a friend of mine.  It is actually supposed to look like it does, a bit donnie darko in the feeling and also made of washable stuff which will felt eventually, since the kid will grow up on a farm.

donnie darko bunny

Socks and Mittens! (and a vest)

I tend to forget to post everything I actually make and I also tend to forget to even take a picture of all the stuff I make.

So here are socks I made for my husband:

Also I made mittens for someone else:

I like the detail there, look at the leaves:

and the wristband:

Then there is this vest I finally finished, where the lace is interesting:

and a hat with my own design (it’s green with orange dots and at that point I haven’t quite found out how to work out my camera I’m afraid):

If you want knitted or crocheted accessories, you can always contact me.  I do existing patterns and create for your own needs too.

TF-IDF for Dummies

In connection to the latest paper I wrote I had to implement some TF-IDF analysis and since I didn’t find a quick understandable overview on the internet in one place, I’ll just try and give a brief explanation of things here.

So what is it?  TF is short for Term Frequency and IDF means Inverse Document Frequency.

What you simply do to get the Term Frequency of a term is, that you count all the occurrences of that term in one document and divide that over the total number of occurrences of every term.  You can also do this with a simple piece of python code. What I did there additionally was, removing all the stop words of the English language.

def makeSnippetDictionary( snippets ):
    snippetdict = { }
    stopwords = [ ]
    wordlist = makeSnippetWordList( snippets )
    with open( "stopwords.txt" ) as f:
        stopwords = "," )
    for word in wordlist:
        if not word in stopwords:
            if snippetdict.has_key( word ):
                snippetdict[word] += 1
                snippetdict[word] = 1
    for word, value in snippetdict.items():
        snippetdict[word] = float( value ) / ( len( wordlist ) )
    return snippetdict

So this is just one part of the code, but it tells pretty much what it does.  I split the document from its completely lower cased string format into one list of words..  Then I converted it into a dictionary (for other programming languages: a map or mapping) and counted how often the same word occurs.   The line before the return statement then just divides each value by the length of the list of words and there you go: relative term frequency done!  Of course you can do some sorting then to make it look prettier, but that’s basically it.

Now how to calculate/implement the inverse document frequency?  Good that you asked!  The inverse document frequency describes the relation of the general occurrence of a term in your document collection.  To solidly calculate this, you should use at least 2 different documents that are relevant to your analysis, though the more the better.  You then basically divide your number of documents by the number of documents the term occurred in and take the logarithm from it.  Multiplying that with the relative term frequency gives you the much wanted TF-IDF values.

def idfCorpus( snippets, reviews ):
    wlreviews = makeWordListDict( reviews )
    idf = { }
    for tf, terms in snippetTFRank( snippets ):
        for word in terms:
           for reviewnr, review in wlreviews.items():
               if word in review:
                   idf[word] = idf.get( word, 0 ) + 1
    for word, df in idf.items():
        idf[word] = math.log( len( wlreviews )/idf[word] )
    return idf

def tfidfCorpus( snippets, reviews ):
    tf = makeSnippetDictionary( snippets )
    idf = idfCorpus( snippets, reviews )
    tfidf = { }
    for term, frequency in tf.items():
        tfidf[term] = tf.get( term ) * idf.get( term, 0 )
    return tfidf

The piece of python above basically shows you how to do this.  To interpret it there is basically one rule:  The higher the TF-IDF value of a term in one document the more important it is.  Bear in mind that the relative term frequency is different for every single document and applying TF-IDF values should be done in such a way, that they are different for every document you have.

So why would you want to use this?  In my case it was that I wanted to determine whether certain parts within product reviews (in the code called snippets) have a higher likelihood for certain words (yes they do!).  Implementing a TF-IDF analysis in your text processing machine learning algorithm can help improving it!

Frog Button Pattern

I figured, since it is a pattern of my own anyway, here for others to make the pattern of the frog button.  It’s a free pattern and you can use it whenever you want and modify and whatever.  Note though, that these are used as a political campaign material by the Green candidate for the mayoral elections in Weimar.

You will need:

  • some green, pink and white wool. (I use wool, that is specifically designed to make puppets out of them.)
  • a 1.5 mm crochet hook
  • a sewing needle
  • a tiny amount of stuffing (or scrap yarn, but I find that more complicated to deal with at this size)
  • a small safety pin

Head top (make 1, uses green wool):

crochet a chain of 2.

round 1: crochet 6 stitches into second stitch from hook

round 2: crochet 2 in each stitch (12)

round 3: crochet 2 in the first stitch and one in the next, repeat for round (18)

round 4: crochet 2 in the first stitch and one in the two next, repeat for round (24)

round 5: crochet one in all stitches (24), fasten off.


Inner mouth (make 2, uses pink wool):

crochet rounds 1-4 of head top. fasten off.


Chin ( make 1, uses white wool):

crochet like head top, fasten off.


Legs & feet (make 1, uses green wool):

crochet a chain of desirable length (I usually do 16 to 20 stitches plus 1 to turn).

crochet down the chain.

crochet a chain of five where you finished, slip with the end of legs. (do this three times on either side) and fasten off.



Put a tiny amount of stuffing in the top head and sew one inner mouth onto it.

Don’t put any stuffing in the chin, sew the other inner mouth onto it.

Sew those together in the back of the head (which you define on your own), about half way through, so the frog has an open mouth.

Sew legs in the middle of chin.

Add a safety pin.




About half a year ago, after I left Canada I started crocheting again.  The reason was so that I could thank those people, that were supporting us financially with our wedding.  Since they all were from dw-mud, we thought, turtles would be a good idea.  So I made a few turtles (if you are reading this, supported us and haven’t yet got one, you might have one soon or I just haven’t gotten your address yet.).

Yes, in the background is a glass of honey.  So these turtles are rather small.  Especially the ones in the front.  They are usually made from patterns with slight modifications to account for the size or sometimes just children safety.  Here you can find the pattern for the big one in the middle, here the one for the striped ones and here the one for the tiny ones.

However, then I got interested and tried out more things.  Also other people saw about my enthusiasm and Carsten Meyer for example uses little frog buttons now for his campaign.

That one even made my name being mentioned in the gossip section of the local newspaper, which is rather neat for free advertising.

At some point I also realised that I’m getting older, you know, one of these days, and that more and more of the people I know have kids or are pregnant.  While I usually did baby socks for them, I thought, I could try my luck with toys.  Since I already made so many turtles, why not start with a turtle toy?

Isn’t she a curious cutie?  So off I went to make more different toys. I offered some friend on discworld, to make his son something, and we agreed upon a fish.

I adore the little frillies and had troubles packaging it, because I just wanted to keep it.

While offering the toy to this friend, I mistold ‘I could make a toy for you’ to another player.  They said, they wanted a toy too and when I asked about their favourite animal, they responded with ‘a tiger!’.  So I made a tiger – much to their surprise, they were expecting something coded.

Next time, I’ll do something different with the ears, but I’m quite satisfied on how it worked out.

I still have an elephant somewhere lying around and might take a photograph of my latest knittings too, so I can show you more of stuff I make.  If you want stuffed toys for your kids too, contact me about the specifics.  Making toys is fun, doesn’t take too much time, even in large sizes and I find it very rewarding, even if heartbreaking when I have to give them away.

How I work

So.  Since I decided I should get up a proper online representation of stuff I do for people who want to keep in touch, here I am.  I will post about my research and my crafts and other things I will think about.  However, I will do so semi-randomly.

What I mean with this is: There will be no ordered schedule per se, but it will be an item on my todo list.  My todo list consists of many things and several entries.  If they are important (like writing on a paper or on my thesis at the moment), it appears there more often to increase the likelyhood that an item gets chosen and hence, done.  So how is an item chosen?  With a dice! And then the item gets written in the end of the list again (at least if it is some regular task or one that consists of several steps, also making it possible to chunk larger amounts of work down into feasable sizes).

I am not a very structured person, but I do need structure to sort my life out and get stuff done.  However, why I’m not a structured person is, that I am easily bored of those structures that are put upon me and I would get nothing done if I always had to put cognitive load into deciding what to do next.  So I chose a semi-random approach, which actually works quite well.  Upon deadlines I sometimes change it a bit (so that for example studying for the exam will be every i-th item, so that I can ensure that I get things done), but all in all the beauty of it is something else.

This list is now sorting also my free time.  And it works remarkably well.  While I have less troubles to get enthusiastic about my work or remembering that it is my duty again to clean the bathroom (or water the plants), the list also contains stuff like ‘watch a movie’, ‘play a game’ or ‘crochet a bit’ (for that matter: ‘do your nails’ is a big one, since it ensures that they are never looking _too_ soddy.).  And the fascinating thing is: I sometimes have entire days off and in general the ratio is such that it works out quite nicely.

There are still sometimes rows of doing work tasks, be it political, uni or what have you.  However, in general I can always bring up the motivation, interest and enthusiasm for what I do at that point.

Choice is very hard for me, routine bores me, but this is something that finally worked!  Just if there is some geek out there having similar problems:  Try it, maybe it’s something for you too!

So the next time ‘do something with your blog’ is on my todo list, I’ll show some stuff I do.