Testing on Ubuntu 12.04.4 x64.
Install to your system Pygame requirement
sudo apt-get install python-opencv python-pygame
| <?php | |
| class AbstractManagerBase extends \PHPUnit_Framework_TestCase | |
| { | |
| protected function getEmMock() | |
| { | |
| $emMock = $this->getMock('\Doctrine\ORM\EntityManager', | |
| array('getRepository', 'getClassMetadata', 'persist', 'flush'), array(), '', false); | |
| $emMock->expects($this->any()) | |
| ->method('getRepository') |
| >>> from math import ceil | |
| >>> ceil(1.3) | |
| 2.0 | |
| >>> | |
| >>> | |
| >>> ceil(1.00002) | |
| 2.0 | |
| >>> ceil(48/45) | |
| 1.0 | |
| >>> 48/45 |
| <?php | |
| // http://www.elasticsearch.com/docs/elasticsearch/rest_api/ | |
| class ElasticSearch { | |
| public $index; | |
| function __construct($server = 'http://127.0.0.1:9200'){ | |
| $this->server = $server; | |
| } |
| { | |
| "translate_tabs_to_spaces": true, | |
| "tab_size": 4, | |
| "rulers": [80, 120], | |
| "caret_style": "phase", | |
| "match_brackets_angle": true, | |
| "trim_trailing_white_space_on_save": true, | |
| "fallback_encoding": "UTF-8", | |
| "show_encoding": true, | |
| "show_line_endings": true, |
| <p style="font-size:13px;font-family:tahoma,sans-serif;"> | |
| <font style="color:#333333;font-weight:bold;"> | |
| Haydar KÜLEKCİ | |
| </font> | |
| <br/> | |
| <font color="#548DD4"> | |
| @kulekci - @somedya | |
| </font> | |
| </p> |
| import argparse | |
| import zmq | |
| from time import sleep | |
| parser = argparse.ArgumentParser(description='zeromq server/client') | |
| parser.add_argument('--bar') | |
| args = parser.parse_args() | |
| if args.bar: | |
| count = 0 |
| // form field separator | |
| $delimiter = '-------------' . uniqid(); | |
| // file upload fields: name => array(type=>'mime/type',content=>'raw data') | |
| $fileFields = array( | |
| 'file1' => array( | |
| 'type' => 'text/plain', | |
| 'content' => '...your raw file content goes here...' | |
| ), /* ... */ | |
| ); | |
| // all other fields (not file upload): name => value |
__new__ : First run this methos when the class object is created!
__init__ : Construtor of a class. You can send parameter to your class with __init__ method.
__del__ : Deconstructor method of the class. But this method is not secure to use a garbage collector. It is not guarantee when the object is deleted.
| #!/usr/bin/python | |
| # coding=utf-8 | |
| import os | |
| import sys | |
| import codecs | |
| args = sys.argv | |
| file = "" | |
| encoding = 'iso-8859-9' | |
| if len(args) == 2: |