Survival (Without super markets)

August 20th, 2014
by leviathan

Rice with spring onion, sweet pepper and Lạp Xưởng

image

image

image

Our mirabelles tree in our garden (布拉斯李树)

image

image

Posted in Daily life | Comments (0)

Calibration progresses

August 3rd, 2014
by leviathan

Still gotta fix the issue with small perimeters... And the temperature still variates too much.

image

Posted in Daily life, Tech | Comments (0)

MendelMax2.0

August 3rd, 2014
by leviathan

image

Posted in Daily life | Comments (0)

MendelMax 2.0

August 2nd, 2014
by leviathan

Calibration progesses (from left to right)

image

Posted in Daily life | Comments (0)

Urban gardening

August 2nd, 2014
by leviathan

My todays lunch, from my own balcony. Blue potatoes! :-D

image

image

image

image

image

image

Posted in Daily life | Comments (0)

geekdarling.ch - Matching algorithm

July 22nd, 2014
by leviathan

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.

Posted in Tech | Comments (1)

Linux support for z2760

May 2nd, 2014
by leviathan

The following branch contains my attempts to develop support for the intel atom z2760 clovertrail platform.
Help appreciated.
http://git.o2s.ch/?p=linux-stable.git;a=shortlog;h=refs/heads/v3.15-z2760

Posted in Daily life, Tech | Comments (0)

int reactOnShitSituation(struct situation s)

April 4th, 2014
by leviathan
int reactOnShitSituation(struct situation s) {
    while(!s.eof) {// end of fuck
        open(s.beer);
        drink(s.beer);
        smoke(s.cigaret);
    }
    return BARF;
}

Posted in Daily life, Jokes | Comments (0)

sending HTML emails with inline images attached

February 20th, 2014
by leviathan
#! /usr/bin/python
# -*- coding: utf-8 -*-
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from email.header import Header
 
def sendEmail(you,greatingLine):
        # me == my email address
        # you == recipient's email address
        me = "VFSN Praesident <praesident @vfsn.ch>"
 
        # Create message container - the correct MIME type is multipart/alternative.
        #msg = MIMEMultipart('alternative')
        msg = MIMEMultipart('related')
        msg['Subject'] = Header("Verein Flugschneise Süd - NEIN","utf-8")
        msg['From'] = me
        msg['To'] = you
 
        # Create the body of the message (a plain-text and an HTML version).
        f = open('Mail_4.html', 'r')
        mail_content = f.read()
        f.close()
        mail_content = mail_content.replace('%Anrede%',greatingLine)
        mail_content = mail_content.replace('vfsn.gif','cid:vfsn.gif')
        html = mail_content
 
        # Record the MIME types of both parts - text/plain and text/html.                                                                                                                       
        part2 = MIMEText(html, 'html')                                                                                                                                                          
 
        part3_data = open('vfsn.gif', 'rb').read()                                                                                                                                              
        part3 = MIMEImage(part3_data, 'gif')                                                                                                                                                    
        part3.add_header('Content-ID', '<vfsn .gif>')                                                                                                                                            
        part3.add_header('Content-Disposition', 'attachment', filename='vfsn.gif')
        part3.add_header('Content-Disposition', 'inline', filename='vfsn.gif')
 
        part4_data = open('Bauverbot im Sueden_2_LQ.pdf', 'rb').read()
        part4 = MIMEImage(part4_data, 'pdf')
        part4.add_header('Content-Disposition', 'attachment', filename='Bauverbot im Sueden_2_LQ.pdf')
        part4.add_header('Content-Disposition', 'inline', filename='Bauverbot im Sueden_2_LQ.pdf')
 
        # Attach parts into message container.
        # According to RFC 2046, the last part of a multipart message, in this case
        # the HTML message, is best and preferred.
        msg.attach(part2)
        msg.attach(part3)
        msg.attach(part4)
 
        # Send the message via local SMTP server.
        s = smtplib.SMTP('localhost')
        # sendmail function takes 3 arguments: sender's address, recipient's address
        # and message to send - here it is sent as one string.
        s.sendmail(me, you, msg.as_string())
        s.quit()
 
csv = open('Adressen_4.csv','r').read()
for line in csv.split('\n')[1:]:
        lineArray=line.split(',')
        try:
                ret=lineArray[7]+" "+lineArray[4]+" "+lineArray[5]
                ret=ret.strip()
                if ret=="":
                        ret=False
        except:
                ret=False
 
        Anrede=ret
 
        try:
                ret=lineArray[12]
                ret=ret.strip()
                if ret=="":
                        ret=False
        except:
                ret=False
 
        Mail = ret
 
        if Mail and Anrede:
                print 'Sending to '+Mail+' with rcp message '+Anrede
                try:
                        sendEmail(Mail,Anrede)
                except:
                        continue
</vfsn></praesident>

Posted in Daily life, Tech | Comments (0)

openerp on CentOS-6 (with RPM)

February 8th, 2014
by leviathan

Howdy
First fit the package depencies like described here: http://gurn3ys.tuxfamily.org/?p=65
Somehow the installation prefix of the RPMs from the daily build service(http://nightly.openerp.com/7.0/nightly/rpm/) points to /usr/local which is... unhandy
The solution is to overwrite some rpm macros which check for unpacked files...
echo "%__os_install_post %{nil}" >> ~/.rpmmacros
And then installing and rebuilding the srpm with rpmbuild -ba

Posted in Daily life, Tech | Comments (0)