Xbmc on linux crash with my script
X Error of failed request: BadDrawable (invalid Pixmap or Window parameter) Major opcode of failed request: 136 (XFree86-DRI) Minor opcode of failed request: 9 () Resource id in failed request: 0x5200002 Serial number of failed request: 29677 Current serial number in output stream: 29677 X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 4 (X_DestroyWindow) Resource id in failed request: 0x4a00015 Serial number of failed request: 19544 Current serial number in output stream: 19546 X Error of failed request: BadColor (invalid Colormap parameter) Major opcode of failed request: 79 (X_FreeColormap) Resource id in failed request: 0x4a00014 Serial number of failed request: 19545 Current serial number in output stream: 19548 CRITSEC[0x8beb5e4]: Trying to enter destroyed section. CRITSEC[0x8beb5e4]: Trying to enter destroyed section. CRITSEC[0x8beb5e4]: Trying to enter destroyed section. CRITSEC[0x8beb670]: Trying to enter destroyed section. X Error of failed request: BadDrawable (invalid Pixmap or Window parameter) Major opcode of failed request: 136 (XFree86-DRI) Minor opcode of failed request: 9 () Resource id in failed request: 0x5200002 Serial number of failed request: 29678 Current serial number in output stream: 29678 CRITSEC[0x8bed0e0]: Trying to enter destroyed section. CRITSEC[0x8bed0e0]: Trying to leave destroyed section.
cython cause install skype4py failed
$ sudo python setup.py install
running install
running build
running build_py
running build_ext
cythoning Skype4Py/utils.py to Skype4Py/utils.c
Error converting Pyrex file to C:
------------------------------------------------------------
...
self._EventHandlerObj = Obj
@staticmethod
def __AddEvents_make_event(Event):
# TODO: rework to make compatible with cython
return property(lambda self: self._GetDefaultEventHandler(Event),
^
------------------------------------------------------------
/dos/library/Skype4Py/tar/Skype4Py-1.0.31.0/Skype4Py/utils.py:462:24: Expected an identifier or literal
building 'Skype4Py.utils' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I. -I/usr/include/python2.6 -c Skype4Py/utils.c -o build/temp.linux-i686-2.6/Skype4Py/utils.o -O3
gcc: Skype4Py/utils.c: No such file or directory
gcc: no input files
error: command 'gcc' failed with exit status 1
$
~
Then
$ sudo apt-get remove cython $ sudo python setup.py install running install running build running build_py copying Skype4Py/API/windows.py -> build/lib.linux-i686-2.6/Skype4Py/API copying Skype4Py/API/faked_dbus.py -> build/lib.linux-i686-2.6/Skype4Py/API copying Skype4Py/API/darwin.py -> build/lib.linux-i686-2.6/Skype4Py/API running install_lib ... byte-compiling /usr/local/lib/python2.6/dist-packages/Skype4Py/Languages/bg.py to bg.pyc byte-compiling /usr/local/lib/python2.6/dist-packages/Skype4Py/Languages/lt.py to lt.pyc byte-compiling /usr/local/lib/python2.6/dist-packages/Skype4Py/Languages/sv.py to sv.pyc byte-compiling /usr/local/lib/python2.6/dist-packages/Skype4Py/Languages/ro.py to ro.pyc byte-compiling /usr/local/lib/python2.6/dist-packages/Skype4Py/conversion.py to conversion.pyc running install_egg_info Writing /usr/local/lib/python2.6/dist-packages/Skype4Py-1.0.31.0.egg-info $
~
Python – Find Prime Number
def get_prime_list(n):
n = int(n)
maked_list = [False] * (n + 1)
prime_list = []
for i in range(2,n+1):
if not maked_list[i] :
prime_list.append(i)
for j in range(i**2, n+1,i):
maked_list[j] = True
return prime_list
print get_prime_list(10001)
~
Python – Find Factors of Number
Code :
========================================
from math import sqrt
import sys
input = int(sys.argv[1])
factors = []
min_fac = 2
while input > min_fac - 1 :
if (input % min_fac) == 0 :
factors.append(min_fac)
input = input / min_fac
else :
min_fac += 1
print factors
~
Example :
========================================
$ python prime.py 600851475143 [71, 839, 1471, 6857]
~
Perl – Example Data Types
1. Scalar
=============================
$first_name = "Wearetherock"; $last_name= "Ok"; $salary = 20; print $first_name, $last_name, $salary;
~
2. Array
=============================
@names = ("Java", "C", "Python", "Perl");
print "@names";
print "$names[0] and $names[2]";
print "$names[-1]\n";
$names[4] = "Lisp";
function : pop, push, shift, unshift, splice, sort
~
3. Hash
=============================
%employee = (
"Name" => "Wearetherock",
"Phone" => "119",
"Position" => "ZEO"
);
print $employee{"Name"};
$employee{"SSN"} = "9999-0000-5555";
function : keys, values, each, delete
~
1 comment