Sorry, pikk ja segane tööpäev
Author: margusja
Mäluboss
Sex in my computer vol2
Hello World in different languages and speed
Assembler
.section .data
string:
.ascii "Hello world %d \n\0";
.section .text
.globl _start
_start:
movl %esp, %ebp
subl $4, %esp
movl $10000, %eax
movl $0, %ebx
loop:
cmpl $0, %eax
je loop_end
subl $1, %eax
pushl %eax
pushl $string
call printf
addl $4, %esp
popl %eax
jmp loop
loop_end:
movl $1, %eax
movl $0, %ebx
int $0x80
real 0m0.424s
user 0m0.004s
sys 0m0.254s
PHP
real 0m0.969s
user 0m0.034s
sys 0m0.219s
}
?>
Perl
for ($count=0; $count<10000; $count++) {
print "Hello World\n";
}
real 0m0.547s
user 0m0.014s
sys 0m0.267s
Python
#!/usr/bin/python
# Filename: hello.py
for i in range(0, 10000):
print "Hello, World!"
else:
print 'The for loop is over'
real 0m0.503s
user 0m0.018s
sys 0m0.273s
Mac OS X 10.6 wrong umask on samba share
edit or create a file /etc/launchd.conf
umask 002
Some useful MySql sentences
start in safe mode
/usr/bin/mysqld_safe –user=mysql –socket=/var/lib/mysql/mysql.sock –pid-file=/var/run/mysqld/mysqld.pid –datadir=/var/lib/mysql –skip-grant-tables &
It is annoying to type them from the scratch every time. So a little copy paste place for my. Lazy me!
insert into user (Host, User, Password) Values (‘localhost’, ‘username’, PASSWORD(‘xxx’));
insert into db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv) values (‘localhost’, ‘dbname’, ‘username’, ‘Y’, ‘Y’, ‘Y’, ‘Y’);
UPDATE `mysql`.`user` SET `Create_priv` = ‘Y’,
`Drop_priv` = ‘Y’,
`Reload_priv` = ‘Y’,
`Shutdown_priv` = ‘Y’,
`Process_priv` = ‘Y’,
`File_priv` = ‘Y’,
`Grant_priv` = ‘Y’,
`References_priv` = ‘Y’,
`Index_priv` = ‘Y’,
`Alter_priv` = ‘Y’,
`Show_db_priv` = ‘Y’,
`Super_priv` = ‘Y’,
`Create_tmp_table_priv` = ‘Y’,
`Lock_tables_priv` = ‘Y’,
`Execute_priv` = ‘Y’,
`Repl_slave_priv` = ‘Y’,
`Repl_client_priv` = ‘Y’,
`Create_view_priv` = ‘Y’,
`Show_view_priv` = ‘Y’,
`Create_routine_priv` = ‘Y’,
`Alter_routine_priv` = ‘Y’,
`Create_user_priv` = ‘Y’ WHERE CONVERT( `user`.`Host` USING utf8 ) = ‘h3.okia.ee’ AND CONVERT( `user`.`User` USING utf8 ) = ‘root’ LIMIT 1 ;
No milk today
Deem kuidas tahaks hipi olla!
How God works
Kui ma olin väike, palusin Jumalalt ratast. Midagi ei juhtunud 🙁
Hiljem varastasin omale ratta ja palusin lunastust 🙂
Jess!
Ilusaid jõule
[kml_flashembed movie="http://www.youtube.com/v/ca91kD76EY0" width="425" height="344" allowfullscreen="true" fvars="fs=1" /]