9
Mar

The Slavic Esperanto

   Posted by: Swizec   in Uncategorized

Codex Zographensis in the Glagolitic alphabet ...
Image via Wikipedia

Sometimes when I’m out and about and not being careful about my clothing my penis slips out.

No wait that’s not right. My linguistic geek slips out.

Yeah, that one! Linguistic geekdom! All over the place! Like a vulgar Andy Warhol rip off painted on a pornstar’s fake boobs.

So last time that happened it was because I stumbled upon something called a Slovianski Jezik, which is apparently something not unlike an Esperanto exclusively for slavic languages.

Of course I went full monty on it and was all like “Omigosh omigosh this is liek SO brilliant yeah!?” in my best cockney accent impersonation.

But the thing is that, all joking aside, us slavs are in dire need of a language such as this. The most painful thing we have to deal with is that already, as it is, in our natural state, it’s almost like we were talking dialects of the same language. Well not really, but still, there are many many similarities.

Like I’ve read once that Slavic languages are the only family of languages in the world where speakers talking to one another feel like the other person should be understandable, but has such a horrible speech impediment that they just can’t quite make them out. Combined with regional differences in vocabulary and you’re in a fucked up situation where you instinctively feel like you should be able to converse normally …

… but just can’t.

For example I went to Prague last week. When there I could almost understand everything I saw in written language and could understand something like 50% of the things I was told. 70% when I tried really hard.

But as soon as I tried to do some proper communication there was a big fail and we were all forced to default back to English, which is just horrible. Come on, a Slovenian and a Czech conversing in a stupid germanic language. EW!

The Andy Warhol Bridge (7th Street) Bridge in ...
Image via Wikipedia

That’s where Slovianski comes in. It is specifically designed to be instantly and intuitively intelligible to anyone who understands slavic languages, more specifically, anyone who is a Slav. You can try this on the Slovianski language front page

Personally I can make out just about everything it says. Even when a word is missing I can very simply understand it from the context.

This is without ever having learnt any other Slavic languages than Slovene and I guess I learned some Serbocroatian by ear simply from … well those who know why know, the rest don’t really have to know.

I think every Slav out there should learn this language, I sure know I want to. It looks easy enough anyway.

Reblog this post [with Zemanta]
5
Mar

Philosophers are crazy people!

   Posted by: Swizec   in Insanity

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]
21
Feb

The real-time WebCamp bash

   Posted by: Swizec   in Uncategorized

Carol Cleveland as the stereotypical "blo...
Image via Wikipedia

Yesterday another WebCamp took place in Ljubljana and it was the best *camp event I’ve ever been to. Congrats to all involved in making it happen, you guys rawk.

For some strange reason though I seem to have done almost nothing but hang out in the hall and only caught little bits and pieces of the talks here and there.

Perhaps the most surprising thing that I learned is that nobody writes good software anymore. Hell, why would you make your algorithms and page generators run faster … just slap some caching on there! First you make it cache all database calls. Then you start saving straight to cache too and sort of make commits to the actual storage happen a bit later when they don’t bother the user. If that’s not enough you can still just “cache” the whole output of your app in a static html file and serve that. And so on.

HELLO guise!? Bad sign ™ if you need to store the whole output of your software so it runs sufficiently well? O.o What are web developers smoking these days … I want some.

That’s the impression I got anyway from so many talks about optimisation and caching …

Another very cool talk, although I wasn’t in geek-mode enough to listen in on the whole thing, was by @refaktor who showed some funky simplistic server thingies that can perform real-time communication amongst each other. I did see the demo and it was very pretty. Hope he puts the code and talk somewhere public so I can give it a study some time.

I happened to steal two sessions of people’s time. The first was a public release of LazySharer that went alright I guess, some things went wrong but it all turned out well in the end.

And in a spur-of-the-moment kind of inspiration I also made a talk where we did nothing but watch stupid and silly youtube videos. We burned through our 20+10 minutes and ate away at half of next talk. Sorry Jure, hope you had enough time to talk about XMPP.

Group shot of the Monty Python crew in 1969
Image via Wikipedia

Seeming as how stupid videos were a marginal enough success for my tastes I got together some people and we set up a booth of sorts in the hall where we then played Monty Python and other silly videos for the rest of the day. Well actually we sort of got bored with it and then other people started playing whatever they wanted to see. It was great fun.

The WebCamp concluded a bit early because there were no more talks people wanted to give and half the public went MIA. So then the real party started because all the boring people had left.

Imagine this scene: 30-ish people, two cases of beer, a lot of pizza, 70 sooper chocolate muffins.

Yeah it was a blast. Apparently spiking those muffins with extra sugar and cocoa was the best idea we ever had at Preona. People went berserk for those things, eating three or more and stealing them for home consumption. Hell, if all this Synaptic Web stuff doesn’t work out for us we’ll open a muffin bakery.

Later on when almost everybody had left the evening evolved into Hekovnik’s first movie night. Inglorious Basterds on a huge LCD and four people on a sofa munching on stuff. Fun times.

Although those people having a brainstorming session on the other side of the room were a bit loud at times :P

PS: there were three pizzas (out of 40) left over and no muffins (out of 70). I think this is a great achievement.

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.

Major Crandall's UH-1D helicopter climbs skywa...
Image via Wikipedia

Ah, finally, we can breathe again!

The last couple of weeks … was it two, was it three? Can’t really tell, feels like I’ve left the office just yesterday while at the same time seeming like it’s been years since I last set foot in the office to do any real work.

This my friends, this ejection from the stream of time, this rejection from life, this abortion from the normality of our daily lives, this horrible feeling of floating in time like naught is happening but what you can see on your immediate palm …

… this is what exam season does to you.

For me it is, luckily, already over. Some of my best buddies have another week of wartime ahead of them. Waring with evil warlords, waging battle with delusional teaching assistants. To them I wish good luck! Good luck I say!

To the rest of us I say, Gidday mate! Finally, finally we have come out of that Vietnam that is the few weeks of exams. Those stressful days when your future hangs precariously at a balance and your parents are wagging their eternal finger into your face “you better pass those exams mister lest we reject you from the family unit and make you get a real job”

But alas dear mother! Alas I say! Alas! For I have passed three out of five exams and that means I’ve got a 60% success rate and not even all of those were a weak mere pass! Nay! For I am victorious! Victoriously have I come out of that hell that is pure suffering.

Could’ve done better though. Crap.

PS: said season also fucks with your mind.

Reblog this post [with Zemanta]
4
Feb

Maths is purdiful

   Posted by: Swizec   in Uncategorized

This whole week I’ve been doing a lot of maths studying. Things like parametric curves, LaGrange theorems and funky functional sequences.

Naturally I’ve developed a bit of a love for pretty mathematical objects, so I wanted to share some with you.

1. Our first contestant is the cardioid. She’s a bit chubby on the sides but has a heart of gold.

Cardioid

2. The second contestant is an implicit heart and was contributed by a bloke on Facebook whom I believe has had this saved somewhere because it would be just mindblowing if he even know it from heart, let alone could create it.

Implicit heart

3. This little nugget followed from my experimentation with parameters of a curve I don’t know the name of … it’s a flower if you haven’t noticed.

Flower

4. The Butterfly Curve is well known in some circles, but I found it by stumbling around wikipedia like a drunken madman

Butterfly Curve

5. There are likely to be other contestants I have yet to discover.

So, which curve do you think is the most beautifulest mathematical construct?

Reblog this post [with Zemanta]
27
Jan

Apple pulls another Newton with the iPad

   Posted by: Swizec   in Uncategorized

Lately we’ve been hearing a lot, and I mean a bloody metric shitload, of rumours, speculation and other fun things about the soon-to-be-announced Apple tablet. You know how those Apple fanboys get, the first time hype started building about this thing was several years ago, but lately it’s been getting soooo pervasive you just knew it was the real deal this time.

Of course after all this hype the features I expected were:

  • the casing is made of solid gold
  • it can make me a sandwich
  • it brings coffee
  • it fits in my pocket
  • it is very very useful
  • it can wipe my arse after I take a dump
  • it can fly me to the moon and back
  • it works like The Guide mk.2 (If you don’t know what this means you should be ashamed of yourself)

So let’s see what Apple gave us:

  • oversized iPhone that can’t make calls

Errr … what!? Seriously Apple? Seriously? This!? Really!? We’re doing this again!?

Ok look, I love Apple, hell I even want an iPhone. And I really believe the devices they create are marvelous pieces of technology that work very well. But this fucking piece of crap is the biggest technological let-down I have ever had the displeasure of seeing.

I mean seriously, what the fuck was Apple smoking when they designed this thing? They’re supposed to be this sooper innovative company performing feats of magic right before our eyes, but instead, they take all the old technology, add nothing of the new, and call it the next big awesomest thing.

Fuck off Apple. Call me when you start making useful and exciting stuff again.

At least with the Newton it was marvelous technology that was too far ahead of its time, the iPad is just boring, mundane and boring.

Oh and you can tell they know it’s boring and useless because it’s PRICED THE SAME AS THEIR OLD PRODUCT!

Reblog this post [with Zemanta]
23
Jan

Caek!

   Posted by: Swizec   in Uncategorized

My little bugger of a sister had a birthday today and I decided to break tradition and make her a cake. It was very omnom and almost purdiful!

20
Jan

Why bigger penis == bigger confidence [nsfw-ish]

   Posted by: Swizec   in Insanity

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]
Page 1 of 5512345...Last »