All posts by leviathan

printfs syscall in ARM assembly

You can assemble and link it with

arm-linux-gnueabi-gcc --static hello.S -o hello
.data
LC0:
	.ascii  "%d\n"
.text
.align  2

.globl main
main:
	stmfd	sp!, {r0, r1, r2, r3, r4, r5, r6, lr}	@ save the registers we use to the stack
	movs	r4, $0
loop:
	ldr     r3, L3
	movs	r0, r3
	movs	r1, r4
	bl	printf

	adds	r4, r4,$1
	cmp	r4, $100
	bne	loop

exit:
	ldmfd	sp!, {r0, r1, r2, r3, r4, r5, r6, pc}	@ restore registers before exit
	movs	r7, $1                  @ set r7 to 1 - the syscall for exit
	swi	0                       @ then invoke the syscall from linux

L3:
	.word	LC0
	.size	main, .-main

geekdarling.ch – Matching algorithm

Hey folks
Since the GPLed dating platform code out there is crappy PHP work and not suited to help geeks meet each other either, I started designing a new matching algorithm in course of the rewrite of geekdarling.ch as a Ruby application.
Basically the idea is quite easy. First I travel the bipartite tree and cut it into subtrees matching the basic requirement of matching sexual orientation and this way saving CPU power by checking for bidirectional preferences.

Second step: I will then value additional attributes based on a two way connection and average the weight of every forth and back arrow.

For the example on the upper graphics that would mean: R=(((6+1)/2)+((3+4)/2)+0)/3=2.3
Illuminated! 😉

Another practical example: Let’s say I choose under “preferred editor” select that it’s absolutely important to me that my partner like vim too, then anyone who likes vim as well will be given 100 additional points when being weighted in our matching algorithm, and so all the vim using geek girls are listed first (followed by the emacs users ;-)).

I’m not quite done yet, but that’s where I’m going 🙂
Please gimme feedback.