Vizible’s Blog

ทดสอบ TeamCity

Posted in Uncategorized by wearetherock on January 23, 2015

TeamCity เป็น Web Application สำหรับทำ Continuous Integrate

สิ่งที่ลองทดสอบดูแล้ว

  • ฺBuild .Net Solution โดยใช้ MSBuild
  • Hot Deploy ไปยัง IIS โดยใช้ MSBuild (เพิ่ม Command line parameter)
  • รัน Unit Test โดยใช้ MSTest
  • โหลด NuGet Package โดยใช้ NuGet Installer
  • สร้าง NuGet Package โดยใช้ NuGet Pack
  • Pack War โดยใช้ Gradle
  • สร้าง NuGet Feed บน TeamCity Server
Tagged with:

Xbmc on linux crash with my script

Posted in Logs by wearetherock on October 1, 2009
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

Posted in Python by wearetherock on September 18, 2009
$ 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
$

~

Tagged with: , ,

Python – Find Prime Number

Posted in Python by wearetherock on August 30, 2009
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

Posted in Python by wearetherock on August 30, 2009

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]

~