Skip to content

Instantly share code, notes, and snippets.

program sprawdzian;
uses Crt;
var
a,a1,a2:array[1..10] of byte;
i,x,j:integer;
procedure array_init;
@zlw
zlw / sqrt.py
Created February 8, 2009 11:43
from math import sqrt
print sqrt(4)
@zlw
zlw / pow.py
Created February 8, 2009 11:44
print pow(2,2)
a = u'Hello World!'
print a.count('l')
@zlw
zlw / len.py
Created February 8, 2009 11:46
a = u'Hello World!'
print len(a)
a = raw_input('a: ')
print a
a = 'Hello World!'
print a.isupper()
$ sudo ln -s ~/.icons/* /root/.icons
$ sudo ln -s ~/.themes/* /root/.themes
@zlw
zlw / handlers.py
Created March 9, 2011 23:00
attrs added to create() and update()
from piston.handler import BaseHandler
class MyHandler(BaseHandler):
def create(self, request, *args, **kwags):
attrs = {
'user': request.user
}
return super(BaseHandler, self).create(request, *args, attrs=attrs)
@zlw
zlw / has_one_of_keys.rb
Created August 25, 2011 12:17
Check if Hash include one or more of passed keys
class Hash
def has_one_of_keys1?(array=[])
array.map {|v| self.has_key? v }.include? true
end
def has_one_of_keys2?(array=[])
array.select { |v| self.has_key?(v) }.any?
end
def has_one_of_keys3?(array=[])