Archive for the ‘Insanity’ Category

They seriously are, just look at how well they can take a joke!

Dude seriously, the answer to that is “HaHa oh you” not all of that.

Oh well, kudos for proving that caring about paradoxes is just silly because they either don’t exist or they do exist and you’re a jackass.

Also, did you know that if you assume any paradox to be correct you can mathematically prove/derive anything.

Point of fact:

Reblog this post [with Zemanta]

Last night I was faced with a daunting task of making a meta-heuristic process a non-trivial amount of data in no more than a tenth of the time it was taking now.

Just to help you embrace the herculean task this was: My goal was to make the algorithm’s runtime lower than 1.5 seconds for any realistic data sample. It was taking anywhere from 5 to 20 and even 30 seconds at the time.

So I set off. First some profiling and some tidbits here and there, then tweaking and poking and yanking and scraping code for hours upon hours upon hours.

Nothing, no increase in performance. Nothing even remote to sane behaviour at all. Even though the algorithm was working, my debugging/profiling data wasn’t making any sense.

And I said fuck this shit and went to chillax and rest my mind over Men Who Stare at Goats for two hours.

There were some good laughs and some pretty good chillaxing being done. My I-don’t-know-which-exactly-or-what’s-it-called part of the brain was probably busy processing the afore mentioned problem in the background. Or maybe it wasn’t, who knows.

All I know is that when I came back to the problem I noticed something funky.

HEY THAT FUNCTION ARGUMENT SHOULDN’T BE A FUCKING CONSTANT WHAT THE FUCK IS GOING ON!

Characters 1 and t look a lot alike …

So anyway, long story short. The meta-heuristic that used to take 1500 epochs to do something now takes only ten to do the same thing, but slightly better.

That’s a pretty fucking good improovement right there!

Now the algorithm is constantly taking about a second to do its thing and I’m happy. Pushed it into production where profiling data will be collected of a more varied sample of data to see if all is well.

Chillaxing! It really does work.

Reblog this post [with Zemanta]

This is a howto that might come in handy to some people, but mostly I just want to document how I poked around some very angry django dragons and created something marvelous. There are also people on twitter who were wondering what the fuck I was doing.

So let’s start by describing the problem. We have a base user model named pUser (yes stupid naming convention) that is tied to a cookie, which holds an id. These users are then tied to a number of different API accounts. In my case it is Delicious, Twitter and Facebook. The user_id is also used to tie a bunch of meta data in different other models to them.

The problem is that we do not want to trouble users with a special login for our service. But they are using different computers and browsers, so the same physical user can have multiple user id’s.

However through their Delicious et al. credentials we can tie them back together into a single entity. But we do not want to trouble the rest of the code with this detail, it should just work seamlessly because otherwise we’d be forced to introduce checking for this stuff at about 50 different places in the project.

My approach to solving this goes as follows; at the end will be the three tests that indicate that the solution is valid. A hardcore test through the actual UI also confirmed that everything works.

Funky geek stuff follows, you have been warned

First we introduce a model that connects different user id’s to the main user (i.e. the first id said user was given)

class UserNormalisation(models.Model):
	main_id = models.IntegerField()
	sub_id = models.IntegerField()
 
	class Meta:
		unique_together = ("main_id", "sub_id")

Then we give our Delicious model a ModelManager that will perform duplicity checking and tie different users together as needed.

class DeliciousManager(models.Manager):
	def create(self, **kwargs):
		try:
			old = Delicious.objects.get(username=kwargs['username'])
			new = super(DeliciousManager, self).create(**kwargs)
			try:
				UserNormalisation(main_id = old.user.id,
						  sub_id = new.user.id).save()
			except IntegrityError:
				pass
			new.delete()
			return old
		except Delicious.DoesNotExist:
			return super(DeliciousManager, self).create(**kwargs)
 
class Delicious(models.Model):
	user = models.ForeignKey( pUser )
	username = models.CharField( max_length=255 )
	password = models.CharField( max_length=255 )
	isScrobbled = models.BooleanField( default=False )
 
	objects = DeliciousManager()

Basically when the createfunction is called it checks whether a Delicious model with the same username already exists and if it does, then a row is added to the UserNormalisation table to tie the two user id’s together.

And here’s the real magic, the changes we did to the pUser model.

class pUserManager(models.Manager):
	def get(self, **kwargs):
		user = super(pUserManager, self).get(**kwargs)
		try:
			id = UserNormalisation.objects.get(sub_id=user.id).main_id
			user = super(pUserManager, self).get(id=id)
		except UserNormalisation.DoesNotExist:
			pass
		return user
 
class pUser(models.Model):
	username = models.CharField( max_length=50 )
	password = models.CharField( max_length=255 )
	creation = models.DateTimeField( auto_now=True )
 
	objects = pUserManager()
 
	def __init__(self, *args, **kwargs):
		super(pUser, self).__init__(*args, **kwargs)
		try:
			id = UserNormalisation.objects.get(sub_id=self.id).main_id
			self.id = id
 
		except UserNormalisation.DoesNotExist:
			pass

The pUserManager should have a few more functions that do essentially the same thing for other operations (filter comes to mind). Essentially whenever a pUser is fetched from the db the manager will return the real user as per the UserNormalisation model.

Another trick that makes this work seamlessly even when used as a connecting model (primary key for instance) in a different table is that __init__ function. What I’ve discovered is that there it’s enough to just change the user’s id in place and everything will work.

Here are the tests that confirm all of this funky stuff actually performs as expected

	def test_normalisation(self):
		user = pUser(username="test", password="test")
		user.save()
 
		user2 = pUser(username="test2", password="test")
		user2.save()
 
		norm = UserNormalisation(main_id=user.id, sub_id=user2.id)
		norm.save()
 
		fixture = pUser.objects.get(id=user2.id)
		self.assertEquals( fixture.id, user.id )
 
	def test_normalisation2(self):
		user = pUser()
		user.save()
		user2 = pUser()
		user2.save()
 
		user.delicious_set.create(username="test", password="test")
		fixture = user2.delicious_set.create(username="test", password="test")
 
		self.assertEquals( fixture.user.id, user.id )
		self.assertEquals( UserNormalisation.objects.get(sub_id=user2.id).main_id, user.id )
		self.assertEquals( fixture.user, user )
 
	def test_normalisation3(self):
		user = pUser()
		user.save()
		user2 = pUser()
		user2.save()
 
		user.delicious_set.create(username="test", password="test")
		fixture = user2.delicious_set.create(username="test", password="test")
 
		norm = UserNormalisation.objects.all()
 
		Concepts.relate(user=user2, concept1="tag1", concept2="tag2")
		relation = ConceptRelation.objects.filter(user=user2, concept1="tag1")[0]
		self.assertEquals( relation.user.id, user.id )
		self.assertEquals( relation.user, user )

Take special note to the latter two examples. In test_normalisation2 you can see that when a delicious_set is created for user2, the two users become the same thing because both we’re using the same delicious username both times. Something similar happens in test_normalisation3, but there we see that creating a ConceptRelation for user2 actually creates it for the first user because they both behave as if they were the original user.

Walking penis. Gay pride parade, 2005.
Image via Wikipedia

Size matters!

But obviously that’s a very lame argument so let’s work it out a bit.

Everybody knows that when it comes to impregnating homo sapienatic females any and all but the weirdest of male homo sapienatic instruments will do. It can be wide, it can be small, it can be whatever. As long as it’s longer than 5 inches you’re good and obviously since you’re here and we have this thing called evolution and inherited traits, chances are your phallic instrument is longer than 5 inches mister.

And 5 inches is quite alright, I wouldn’t want a 5 inch knife in my back …

But homo sapiens are smart cookies and they needed something more out of sex. This thing called an endorphinal high, we like drugs maaan, because after all, if sex would hurt nobody would do it and then we’d all be fucked. Not to mention that’s no fun at all.

So most of the time when a homo sapiens female and a homo sapiens male get together it isn’t to make little hobbits, it’s to make fun and create natural occuring brain drugs. Woo.

This however introduces a problem, the lukewarm hole most females sport is very stretchy and the more fun it’s having the more it stretches. The damn thing does not in the least care about what you’re putting inside, it just wants more and more and more and it gets bigger and bigger. Then the lady stops getting pleasure because she can’t feel anything.

Hell, there’s very little friction left!

What do? Well obviously you put a bigger instrument into the hands of the master male homo sapiens so that he could pleasure the female better. Problem solved!

By the by, many animal species have tricks to make the female more … uhm … willing. Like cats have spikes on their instruments and ducks have a spiral penis! Wow, amazing, shocker!

Ok so no bitching about “Size doesn’t matter, it’s how you use it” Sod off with those, size, in humans, is about 80% of the equation when it comes to pleasurable activities of the sort.

Therein lies the problem. The more the woman wants to have fun, the bigger instrument she needs. But how can you tell who’s got a big instrument when the damn bastards keep it neatly tucked away in their garment?

Confidence!

The more confidence a male sports the bigger their schlong! The mechanism for how big schlong == big confidence is probably self-evident so let’s leave it at this. The reason why bigger schlong equals bigger confidence is that lasses need a heuristic for finding bigger pleasure.

Reblog this post [with Zemanta]
8
Jan

The best copypasta ever copy pasted

   Posted by: Swizec Tags: ,

Erotic art by Édouard-Henri Avril.
Image via Wikipedia
OMFG Guys… I seriously always thought that those wincest stories were bullshit, I have two sisters, though one’s a baby and the other is two years older than me. The thought of having sex with her was both simultaneously really creepy and in the realm of ‘would-never-happen-to-me’. My sister’s sort of a flower child, garlands and stuff all around her room. So I’m sound asleep one night, I’m a junior in High School and she’s at community college, she hasn’t moved out yet… and she knocks on my door much louder than she needed to, but she whispers through my door ‘Can I come in?’…
Well of course she can, she’s my sister. Anyway, she comes in in the skimpiest fucking night gown I’ve ever seen. I didn’t know she even had a night gown. She tells me that she thought she heard a gunshot in the woods and she doesn’t want to be alone. She asks if she can sleep with me, and before my mind gets out of the gutter, I recoil… but realizing what she means, I tell her of course and I let her into the bed. As she climbs in, I can smell honey on her breath, it’s mesmerizing. That sweet smell brings me closer to her and I curl up next to her like we were just little kids again.
Her snoring has always been loud, especially deep into the nights, but half-an-hour into trying to get some winks, she’s still not snoring. “What do you think of us?” she says randomly. I stammer because I’m fighting the fact that I’m turned on right now AND what she just asked. I tell her that she’s a wonderful sister and I loved her. She told me “What if I was more than her sister? Something much more?” And I shit bricks… It all became so clear to me now.
All those years of wondering, staring at her door, waiting for her, laying awake at night just thinking, rolling crazy suspicions around in my head, all of it came down to this Wednesday night, this very moment, everything I had wondered about her became very… very clear. It was an epiphany at its purest and most tense, most… terrifying in its own way. I could finally say it with no regret, no fear, only truth.
“You’re a bear, aren’t you?” I say. The honey, the gunshot in the woods… there are NO WOODS around here, the berries strung up all around her room. She lept out of bed and ripped off her mask, roaring and making other bear noises! I jumped out of my window and it gave chase, out into the streets! Moving as fast as my legs will let me, eventually she gives up and moves back into the house. Standing on the street, I know it in my heart… she’d always be my special bear.

OMFG Guys… I seriously always thought that those wincest stories were bullshit, I have two sisters, though one’s a baby and the other is two years older than me. The thought of having sex with her was both simultaneously really creepy and in the realm of ‘would-never-happen-to-me’. My sister’s sort of a flower child, garlands and stuff all around her room. So I’m sound asleep one night, I’m a junior in High School and she’s at community college, she hasn’t moved out yet… and she knocks on my door much louder than she needed to, but she whispers through my door ‘Can I come in?’…

Well of course she can, she’s my sister. Anyway, she comes in in the skimpiest fucking night gown I’ve ever seen. I didn’t know she even had a night gown. She tells me that she thought she heard a gunshot in the woods and she doesn’t want to be alone. She asks if she can sleep with me, and before my mind gets out of the gutter, I recoil… but realizing what she means, I tell her of course and I let her into the bed. As she climbs in, I can smell honey on her breath, it’s mesmerizing. That sweet smell brings me closer to her and I curl up next to her like we were just little kids again.

Her snoring has always been loud, especially deep into the nights, but half-an-hour into trying to get some winks, she’s still not snoring. “What do you think of us?” she says randomly. I stammer because I’m fighting the fact that I’m turned on right now AND what she just asked. I tell her that she’s a wonderful sister and I loved her. She told me “What if I was more than her sister? Something much more?” And I shit bricks… It all became so clear to me now.

All those years of wondering, staring at her door, waiting for her, laying awake at night just thinking, rolling crazy suspicions around in my head, all of it came down to this Wednesday night, this very moment, everything I had wondered about her became very… very clear. It was an epiphany at its purest and most tense, most… terrifying in its own way. I could finally say it with no regret, no fear, only truth.

“You’re a bear, aren’t you?” I say. The honey, the gunshot in the woods… there are NO WOODS around here, the berries strung up all around her room. She lept out of bed and ripped off her mask, roaring and making other bear noises! I jumped out of my window and it gave chase, out into the streets! Moving as fast as my legs will let me, eventually she gives up and moves back into the house. Standing on the street, I know it in my heart… she’d always be my special bear.

Reblog this post [with Zemanta]
4
Jan

3 pikchurs of a pretty goat

   Posted by: Swizec Tags: , ,

While I was browsing through my blackberry a few moments ago to find a certain photo I stumbled upon some photos I took this Christmas.

They’re of a very bloody cute small boy goat thing. My grandmother says this is as big as they get and by god the little rascals are awesome. Soon as I came into the barn this guy jumped on me and demanded petting!

PETTING!

A goat!!

:D

Here he is, now let’s make him famous just because he’s so cool.

IMG00104IMG00097IMG00090

Since it’s new year’s eve day party thingy mcthing I’ll keep this short because nobody is going to read it anyway.

Last night I went to see A Clockwork Orange at the playhouse and it was just a thing of joy. Shit was so cash.

No seriously, everybody who has ever even thought about doing far out things that bend the mind and touch you deeply and truly. I don’t think I’ve ever been this affected by a theatre performance before. It was weird. It was strange. It was fucking brilliant.

Such perfect captivation of the story, so amazingly performed. Half the time I was afraid they might actually start pounding away at the audience and doing all manner of strange things to us. And half the mind I was just left with a giant WTFLOL in my head. And then there were times when it was so mindboggling, so sick, so perverted it was painful to watch.

If you can possibly find the time, if you can spare the few euro it takes, fucking go see this show. You shan’t regret it; hat’s off to Mladinsko Gledalisce.

Now if you’ll excuse me, I’m feeling a deep urge to go fuck somebody up with a stick.

Reblog this post [with Zemanta]

Today I spent five solid hours programming (so far) and didn’t write a single line of code, nay, not even a single character. All I did was think with the whiteboard.

Eventually covering about 15 square meters of whiteboard in squiggly lines and weird characters and all sorts of stuff that I probably shouldn’t explain in too great a detail publicly. Let it suffice to say that I believe to have solved the problem of translating machine vocabulary to personalised user vocabulary.

IMG00137IMG00135IMG00133

Reblog this post [with Zemanta]
18
Dec

How the card is chosen

   Posted by: Swizec Tags: , , ,

The Hat
Upon first meeting people most of their attention is devoted to the card I have stuck in my hat.

Upon second time meeting a person their questions about the card suddenly become hey didn’t you have a different card last time? Well yeah, I do change it every day dude …

This quickly becomes, well why the fuck do you keep changing it? How the fuck do you pick? Blahblahblah.

So here’s the answer guys, this is how I choose my card every day and all the considerations that go into the selection.

First and foremost – simplicity uber alles! The simpler and less complex the card is, the more likely it is to end up on my hat. This also means that only hearts and spades get chosen. Diamonds are too pointy and weird, and that other thingy I don’t even know the name of in english, is just too complex and convoluted a symbol. Euch!

Secondly, the colour of the card alternates between days. If the prior day had a spade, next day it will be a heart and so on. I also try my best not to wear the same card twice in a week because that’s just silly.

Thirdly, if the hat hasn’t been worn all day and is being put on just for a party or some other social event – the joker is chosen. It used to be that I had a nudie card stuck between the normal card at all times and then would swap them for social events (it’s ‘bad luck‘ to change cards twice in a day). But I lost that one.

The rest is completely random. So you could say my subconscious mind picks a card according to the weights I’ve put in place. Now, some people say this is a terribly bad answer because it doesn’t tell a story. But it does, it tells a great story.

You’ll notice that most of the world’s religions, belief structures and pretty much everything humans ever do in life, is governed by randomness. We call them acts of god, faith, yada yada, but at their core, they are simply events so damn random human minds can’t wrap around them so they pull a reason out of thin air to feel a bit better about it. We don’t like thinking things are random, we want to feel there is at least some structure … somewhere … somehow.

But I reject that! I embrace randomness! I love randomness! Randomness is king!

And that’s why the card is random. The weights give selections a bit of a pattern, but mostly it’s very random.

Now stop asking me.

Reblog this post [with Zemanta]
14
Dec

The webcomics I love

   Posted by: Swizec Tags: , , , , ,

Webcomics have been an internet constant for a while now and while I’ve become a fan almost in their infancy back when Elftor and PA were king (I never read PA) … oh must’ve been something like *gulp* eight years ago … fuck I’m old.

Anyhow, my second big love was CAD, which I’ve been reading to this day. Sometime during the whole affair I was quite popular on their forum, then a certain revolt happened, which I magically survived and then I got banned a few months later … oh well. But I loved that forum, learned a lot about painting there.

It would seem that there are even more comics that I used to read, but don’t read anymore, than there are comics I do read. There are such marvels as Pewfell, the Dreamwalker Chronicles and Lackadaisy – in all the bookmarks folder for webcomics holds 58 different links. Out of those I only read twelve today, with a few new ones still in the buffer for me to go through the archives. So in no particular order:

Ctrl-Alt-Del

Screen shot 2009-12-14 at 1.34.50 AM

AppleGeeks

Screen shot 2009-12-14 at 1.35.20 AM

Bardsworth

Screen shot 2009-12-14 at 1.35.44 AM

Bunny

Screen shot 2009-12-14 at 1.35.09 AM

Commissioned

Screen shot 2009-12-14 at 1.35.00 AM

Girl Genius

Screen shot 2009-12-14 at 1.42.14 AM

Not Invented Here

Screen shot 2009-12-14 at 1.38.56 AM

PHD Comics

Screen shot 2009-12-14 at 1.35.31 AM

Sheldon Comic

Screen shot 2009-12-14 at 1.35.37 AM

Wulffmorgenthaler

Screen shot 2009-12-14 at 1.35.50 AM

Johnny Wander

Screen shot 2009-12-14 at 1.44.28 AM

Lackadaisy

Screen shot 2009-12-14 at 1.45.30 AM

Two honourable mentions also go to Copper, which should really start updating again, and Ugly Hill, which ended, but @paulsouthworth awesomely went on to do Not Invented Here.

Sadly, most of the comics I stopped reading lost my attention due to my simply forgetting to click the bookmark for a while. Henceforth this is remedied because I have resolved to continue reading only through RSS. Life is too hectic even if the only really proper way to enjoy a webcomic is by going to the home page.

PS: of course there is also XKCD, but I refuse to even bookmark that one. There’s a special charm in entering the URL by hand every Monday, Wednesday and Friday.

Reblog this post [with Zemanta]
Page 1 of 212