The month of shaving my leg

december 10, 2011

{ This is not supposed to be anything similar to serious discussion of the subject }

Background

I have always had a kind of fascination with norms. Not the norms themselves, but their background and reasons. I often stop myself to ask: ”how am i supposed to act in this situation, and why?”. I do feel that the ones related to behaviour (like why we always face the doors and don’t talk to anyone after entering an elevator) are quite easy to understand, if not from a social perspective, but from a biological one.

Among the norms of looks there are some that are easy to understand, and some that aren’t. I wouldn’t call it blatantly obvious, but I have always found the hair hate that is going on a bit weird. (”[...] that’s how you know you aren’t fucking a minor” – Dan Savage). You could argue that it has something to do with trying to look youthful, but unless you are actually a hebephile, that doesn’t really make sense to me.

I don’t really want to ponder these things, since it is not the scope of this post. I should however actually get to the point.

I have never really had any preference when it comes to flirts, one night stands and significant others. I have been together with girls that did not shave, and it didn’t bother me the least (statistically they are more than just a bit over-represented, so maybe I do have a preference, but that is once again way beyond the scope). I have never understood the phenomena, but that hasn’t stopped me from being intrigued by it. So, about a month ago I decided to try it out – I shaved my left leg.

So, Why exactly?

Why not? One day looked out through a small opening in the shower curtain and saw my shaving gel and my razor. It was more something i did in the heat of the moment than something I had actually been thinking about for a long time. I shouldn’t attribute to a burning interest what can be much more easily explained with boredom (I mean what else can be done in a shower???).

And to actually understand it, shouldn’t I at least try it out myself?

How?

As with so many things, the first time is the hardest. I thought it would just be to apply the shaving foam and shave away, but it proved to be pretty hairy business. The razor clogged and wasn’t effective at all, but I soon figured out that if i did a back and forth movement (shaving with the direction of the hair) it went like a charm. Afterwards, since i still had a slight stubble, so I shaved again but against the direction of the hair.

I found that I had to shave every other day to avoid getting a stubble, but after my first pioneering shave this wasn’t really a problem. It did however dry my skin out, so I had to go buy a lotion.

The good

Apart from the silky smoothness you mean? Well, nothing. The weather in Västerås hasn’t been cold enough for me to use long johns, but from those I usually get sore follicles from the hair laying in the wrong direction. I would guess shaving your legs helps out.

None of the people I asked for feedback gave a conclusive answer. Apparently it felt nice to touch, but ”a man is supposed to have leg hair”, which didn’t make me any wiser, since it was those kind of statements I was trying to shed some light on. Personally i preferred my hairy leg to be caressed. The other one left something more to be desired. It felt a bit like bathing in rainwear.

The bad

Apart from the time it took I and that it dried my skin out I only have one real complaint. I recently started running, and after every time i trained some of the follicles on my left leg turned red (like blood read. at first i thought they were bleeding) and stayed like that for one or two days. I asked around a bit, and apparently that problem disappears with time.

Oh, and my jeans became itchy, but i would probably get used to it.

Conclusion

I am as non-understanding as ever. Neither I nor the ones that tried my leg out liked it shaved. It felt weird to touch (probably takes some getting used to), and it felt weird to have it touched. From what I can conclude, there isn’t any real practical reason for shaving, but rather (as i would have been stupid not to expect all along) it is more a normative thing.

For anyone actually interested in serious discussion and something not written in half an hour you could read: http://www.springerlink.com/content/x3v4321143554757/

Next month will be the month of shaving my armpit. Stay tuned.

Jetzt ist es nochmal Zeit für einige Worte über mein Leben. Die letzte Zeit ist wirklich spannend gewesen, mit Revolution, Plagiat und nicht zuletzt latenter Nationalsozialismus in der Blogwelt Schwedens! Was habe ich während dieser Zeit gemacht? Mein Geburtstag gefeiert, natürlich. Ich will nicht so viel darüber schreiben, es hat viel zu viel Spaß gemacht, und mein Deutsch kann es nicht gut genug schildern. Was gesagt werden muss ist dass ich ein Bett gekriegt habe. Ich habe ein Bett, also bin ich erwachsen.

Ich bin übrigens neulich ein Quadratenmann geworden. Ich wohne nicht mehr in kleiner Türkei (am Brunnengarten), sondern in der Mitte Mannheims! Die Einziehung ist vor etwa 2 Wochen stattgefunden, und es war alles ziemlich einfach als ich dann keine Möbeln hatte. Mein neuer Mitbewohner heißt Lorenzo, kommt aus Italien und ist Chordirigent.

Lorenzo mag zu Kochen. Er kocht oft, er kocht viel und er bietet gern was an. Es wird manchmal angedeutet dass Männer die gut kochen können populärer bei den Frauen sind. Ich bin keine Frau, aber wenn ich Lorenzos essen riechen kann wünsche ich das ich wenigstens ein Bisschen schwul wäre. (aber sag ihm nichts!)

So, ich werde jetzt das essen dokumentieren, um alles selbst später machen zu können. Hoffentlich habe ich Motivation genug um alles zu durchführen. Ich muss sowieso mehr auf Deutsch schreiben, und diese Projekt ist ja nicht schlechter als etwas anderes.

tschüßieli tschauchen

1

juli 25, 2010

Jagen gör mig grön
stånk och stön, råd och rönn
finns i sjön!
Själen barrar, publiken knarrar
Hur lång är filmen?
ungefär 23 centimeter.

Lyssnar i spegeln, på ljudande sår
Mitt kroppsspråk har budskap jag inte förstår.

I just spent half an hour trying to get python to insert a bunch of strings into my sqlite db and I kept getting this typeerror. So I started my google fu and got to a bunch of unsolved forum posts.

I found the solution myself. You see, I had been doing this:

self.db.execute(‘INSERT INTO bookmarks(a,b,c) VALUES(?, ?, ?)’%(a,b,c))

(with correct placeholders for sqlite3: ‘?’), when I should have sent the tuple as a second argument to the execute function:

self.db.execute(‘INSERT INTO bookmarks(a,b,c) VALUES(?, ?, ?)’, (a,b,c))

So stupid. Might help someone in the future.

Jag är ungefär lika bra på att uppdatera den här bloggen som jag är på att hålla kontakt med vänner. Hur som helst, här händer det grejer. Igår flyttade Dave (han presenterar sig så, vet inte om det är en förkortning av något. Hans efternamn är omöjligt att uttala) in i rummet tvärsöver mitt. Han kommer ifrån Calcutta och pratar den mest oförståeliga engelskan jag någonsin hört. Hur som helst.

Idag hade jag en minst sagt ögonöppnande upplevelse: Klockan 10 hur någon håller på med ytterdörrslåset. Efter typ två minuter går jag dit och öppnar dörren, och där står Dave böjd över handtaget; ”Could you explain how this thing works?”. Så, jag hivar fram mina enorma pedagogiska kunskaper och lär en människa hur man använder en dörr. Rätt spektakulärt, om jag frågar mig.

Lite senare går vi igenom gemensamma ytor och grejer, och han frågar om städningsgrejer. Jag visar honom dammsugaren, och han ser ut som ett frågetecken. Återigen slår jag på pedagog-switchen.

Hur som helst slutade kvällen med att jag och Antje (den snygga tyska tjejen i WGt) satt och tittade på när Dave lagade mat, och jag måste säga: vilken virtuos! Jag vill ju inte påstå att jag smådömde ut killen för att han inte kunde öppna en dörr eller visste vad en dammsugare var, men  han steg fett i anseende när han bjöd på världens godaste bröd.

If you are looking for a Qt only solution, I am sorry, but that is not available (according to a bug report on qt which I now can’t find). If you are against using the KDE libraries, I am pretty sure you can do it with SDL.

import sys
from PyKDE4 import kdeui
from PyQt4.QtGui import QApplication
from PyQt4.QtCore import Qt

app = QApplication(sys.argv)
a = kdeui.KModifierKeyInfo()
print(a.isKeyLocked(Qt.Key_NumLock))

The keys are in the PyQt4.QtCore.Qt class (and the names of the keys can be found in the qt docs).

En tjej i stockholm skulle skriva för blåskvintett och kom och frågade mig om råd. Nu är det ju så att mitt projektarbete i gymnasiet handlade om just detta, så jag letade rätt på det (eller rättare sagt ett av utkasten) och mailade det till henne. Tänkte att någon mer kanske skulle kunna ha användning av det, så här kommer det.

Jag känner att jag inte riktigt kan stå för detta (det är som sagt inte den färdiga produkten), men det kan ändå säkert komma till användning: Att lära känna blåskvintetten.

Creative Commons License
Verket är licensierat under en Creative Commons Erkännande-Dela Lika 2.5 Sverige Licens.

Alla förslag till förbättringar tas emot.

ps. Typsnitten är för övrigt dom fantastiska, och fria, Linux Libertine och Linux Biolinum
linuxlibertine.sf.net

I have been a lazy programmer. In fact, I haven’t been a programmer at all. This has led to the suspension of my grand project to relearn gui programming, and thus also putting the most interesting blog-series online on hold.

”Don’t attribute to inspiration when boredom will suffice!”
But then something changed in my life. I became bored. Very bored. I idly started to look through my computer for entertainment, and stumbled across my programming folder (the Mecca of unfinished projects). At first
I just chose not to see it, but after I got even more bored I dove in. As some of you might know: there is this limit to how much time you can waste in front of a computer before actually doing something productive.

Since I am studying German I began by writing my own vocabulary training program (there are tons of these out there, but none of them were easy enough (i.e. console based)). After a while I thought that a vocabulary-training GUI would be swell, so I started writing one. I immediately stumbled into trouble.

I had mostly forgotten everything I learned the previous time, so I ended up doing the same errors over again (stupid python2 not using unicode. I can’t wait to use pyqt with python 3).

So, headfirst into the problems(and solutions):
At first I thought about making a table-based UI, with every word in a two-column table. The left side in the table would be the swedish words (un-editable of cource),
and the right side would be empty for me to fill in the German translations. This ended up sucking major balls since it overly complex and boring.

But, good thing for another project of mine, I learned how to create a table using Qt’s Model-View-Controller-stuff. The trick: cheating. Qt provides fantastic comfort-classes for creating this. The display widget (the table) i used was QTreeView. Nothing magic there. The data model (like the ”database” (bad choice of word) where QTreeView gets the data do be displayed) I used was QStandardItemModel. That is where the magic happen. I sat a couple of hours trying to implent a decent model, but I am way too stupid.

This makes it really simple. Just check the following example code:

# -*- coding: utf-8 -*-
from PyQt4.QtGui import *
from PyQt4.QtCore import *

import sys

class Win(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        
        # creates a model with 0 rows and 2 columns
        model = QStandardItemModel(0,2)
        model.setHeaderData(0, Qt.Horizontal, QVariant('Horizontal Header 1'))
        model.setHeaderData(1, Qt.Horizontal, QVariant('Horizontal Header 2'))
        
        model.insertRow(0) # 0 = at the top
        model.setData(model.index(0,0), QVariant("Columnt 1"))
        model.setData(model.index(0,1), QVariant("Columnt 2"))
        
        treeview = QTreeView(self)
        treeview.setRootIsDecorated(False) #removes the "branches" from the treeview
        treeview.setModel(model)
        
        self.setCentralWidget(treeview)
        

app = QApplication(sys.argv)
window = Win()
window.show()
sys.exit(app.exec_())

 

resulting in the STUNNIG, ORGASMIC and FANTASTIC (but still not very useful) window:

example_list

Neat, huh? (except for maybe my copypasted ”columnt”)

Now, as I said, this was a bit too boring when it comes to a vocabulary training program. You sorta see all the words you have to type in, and instead of becoming a fun ”what is to come next” experience, it just becomes a dreadful process of typing words. It also wasn’t nicely integrated with my plans on how the program should work, so i ditched that design.

Instead I went for a more traditional QLabel/QLineEdit design. On the top there is a QLabel that shows you the greeting, but also the result from the last word you typed in. It is green if you are correct, and red if you are not (more on this later). Below the green_red_widget I have another QLabel to display the word-to-translate. Below that one there is a simple QLineEdit to input the German translation of the word displayed.

Here is what it looks like (I am sorry it is fucking ugly, ok?):

Reinventing the Linux GUI

Yay! A visual basic GUI from the early nineties! Anyways. The only extremely cool thing here is of course the puke-green background of the uppermost widget. That one is actually easier than it looks. Example code of a window that changes the background color to green when you click it:

# -*- coding: utf-8 -*-
from PyQt4.QtGui import *
from PyQt4.QtCore import *

import sys
import time

class Win(QWidget):
    def __init__(self, parent=None):
        QWidget.__init__(self)
        self.setAutoFillBackground(True)
        self.pal = self.palette()
        
    def mousePressEvent(self, event):
        self.pal.setColor(self.backgroundRole(), Qt.green)
        self.setPalette(self.pal)
        

app = QApplication(sys.argv)
window = Win()
window.show()
sys.exit(app.exec_())

(the setAutoFillBackground(True) is a must, otherwise qt wont update the background color)

This concludes the writing-part of this blogpost. Now to some short examples of what I have found out.

Changing fonts of a QStandardItem and probably almost every other Qt object is done with the setFont(QFont) function. Example:

# -*- coding: utf-8 -*-
from PyQt4.QtGui import *
from PyQt4.QtCore import *

import sys
import time

class Win(QWidget):
    def __init__(self, parent=None):
        QWidget.__init__(self)
        font = QFont()
        font.setPixelSize(25)
        
        a = QPushButton(self)
        a.setText("Push Me!")   
        a.setFont(font)

app = QApplication(sys.argv)
window = Win()
window.show()
sys.exit(app.exec_())

Setting the size of objects is a bit different. There can be a set setSizeHint, or a setMinimumSize often with a QSize(). Look through the Qt docs (which I presume you do regularly btw). Here is how you set a qpushbutton to be a minimum 300×300 px:

# -*- coding: utf-8 -*-
from PyQt4.QtGui import *
from PyQt4.QtCore import *

import sys

class Win(QWidget):
    def __init__(self, parent=None):
        QWidget.__init__(self)
        
        a = QPushButton(self)
        a.setText("Push Me!")
        
        size = QSize()
        size.setHeight(300)
        size.setWidth(300)
        a.setMinimumSize(size)
        
app = QApplication(sys.argv)
window = Win()
window.show()
sys.exit(app.exec_())

And last, ofcource, the everlasting unicode problem (at least if you speak other than ascii). When putting some text in your gui that you got from elsewhere, encode it to utf-8 first by doing:

unicode(string_to_encode, 'utf-8')
.
When going the other way around, first get a QString from the widget (QLineEdit.text() for example does this) and then do the QString.toUtf8() function, and then make it to a python string (might be better ways to do this…):
stringen = str(line_edit.text().toUtf8())

I have been catching up on my python programming the last week. Even more so, I have been catching up on GUI programming with PyQt4. I haven’t programmed anything graphical since maybe early 2005, so beginning again was a bit of a chock. I have spent two days on a ”New beginning” with python and Qt, and it is actually starting to shape up.

My first app was a small chatt client for an even smaller chat server I programmed earlier this week (it just delivers messages between the connected peers, and it has buggy-as-hell groupchat capabilities). Needles to say I encountered many small problems – and of course a couple of huge ones as well.

Out of nowhere I started getting some really weird ”XRender Bad glyphset 152″ output in my app, and All I was doing was appending UTF-8 text to a QTextEdit. Seems I overlooked a small thing:

You cannot access and change Widgets created in another thread. From what I remember from using GTK, and previous versions of Qt this has always been. (Qt was a bit better back then, though). You just cannot in any way modify the GUI from another thread.

Anyways: the way to get around this is of course to use signals and slots.

Another small promlem I kept getting was that a QTextEdit always got me ascii text when I converted  the QString to a pyhton string. I fiddled around with some various str.encode() and str.decode() before I found the QString.toUtf8(). That did the job.

I thought I would make this a small pyqt series with a bit of information about the problems I have had. People seemed to appreciate my lite info-thingie about how to get knemo running in KDE4.1, and perhaps someone might find this page through google. While googling for some pyqt stuff.

The resources I have found valuable are:

The Qt C++ reference – requires some aptness in understanding c++
ZetCode – Really not that great as a reference, but it helps the beginner in grokking the basics
Rempt’s book – Quite outdated, but still a great read. (can be downloaded with HTTRack)
Infopage on pyqt4 – not very explaining, but a good read.

EDIT: also found the Qt reference convertet to python:

http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/classes.html

And now, a screenshot of my editor, just to impress my brother:

dogshit

Valspråk

januari 17, 2009

Mitt tidigare valspråk var tråkigt nog identiskt med Svenska Akademiens valspråk ”Snille och smak”. Nu är den tiden över. Jag kände att det inte riktigt passade i tiden, men med tanke på att det valspråket har några hundra år på nacken är det rätt imponerande. Nu är den tiden förbi dock. Mitt nya valspråk är:

”Mot oändligheten, tills vidare”

Follow

Get every new post delivered to your Inbox.