Python HTMLParser and Vkontakte randomizer

Finally I’ve finish my first “program” on Python. The task is to parse people’s id from web page where reposter’s id stores. Main problems were: web-page code is loading dynamically so there is no simple way to get ids from it, the best solution was – save section where id stores in .html file I wanted to catch id + nickname but list of pairs was not a good decision when random works I can’t create a list which stores all found ids, it wiped every iteration I have some unsupported chars in nicknames and they’d broke iteration I’ve get a lot of junk while scan .html so I used regex to avoid them I can’t add various ids in list withoutShort Read more…

Python HTMLParser

How to spent two days if you know nothing about Python: need parse HTML page code, where VK id and username of every person who shared post stores  

Now I know more. First bug and first fix: UnicodeEncodeError: ‘charmap’ codec can’t encode character ‘\u0406’ in position 15: character maps to <undefined>

UPD2: I have found another one solution for this code, just re-thinking it’s logic. That way I use in vk = re.findall(‘/\S+$’, vk_id) can be simplified. I use vk_id = str(attrs) to convert list to string and then found there something matches regex. ! BUT I should just address to value from list ! example:

Will upgrade this section later.     Read more…

Заводим питончика дома или установка Python на Centos 6

Хороший гайд здесь: https://github.com/h2oai/h2o/wiki/Installing-python-2.7-on-centos-6.3.-Follow-this-sequence-exactly-for-centos-machine-only How to install Python 2.7.6 on CentOS 6.3 (6.2 and 6.4 okay too, probably others) stolen from Daniel Eriksson. Thanks Daniel! http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/ (modified a little) CentOS 6.2 ships with Python 2.6.6 and depends on that specific version. Be careful not to replace it or bad things will happen. If you need access to a newer version of Python you must compile it yourself and install it side-by-side with the system version. Here are the steps necessary to install Python 2.7.6. Execute all the commands below as root. Either log in as root temporarily or use sudo. Install development tools In order to compile Python you must first install the development tools:

You also need a fewShort Read more…

Perforce – Windows start investigation and install

Perforce is a commercial, proprietary revision control system developed by Perforce Software, Inc. by wiki Installation: Perforce requires at least two executables: the Perforce service (p4d), and at least one Perforce application (such as p4 on UNIX, orp4.exe on Windows). The Perforce service and applications are available from the Downloads page on the Perforce web site: http://www.perforce.com/downloads/complete_list Go to the web page, select the files for your platform, and save the files to disk. pics Windows installation is very easy. Config files and settings can be found and modified: This also can be used for Linux version of P4 Invalid Displayed Gallery Read more…

Perforce – Centos start investigation and install

The Perforce service and applications are available from the Downloads page on the Perforce web site: http://www.perforce.com/downloads/complete_list THIS is not a JOKE! Installation: Do not worked for me: Also do not work: Procedures above looks not complex, I cannot run P4 by them. Will try another: Another way don’t work: Doesn’t work:

FINALLY It’s worked: Probably there is no output after ./p4d runs, but server is up and listen   Useful commands: p4 info   — This should show if you can access the perforce server at all p4 counters — This should give you a list of all counters p4 counter change — This should give you the value of the change list counter, which is probably also requested byShort Read more…

All about Atlassian JIRA

Atlassian JIRA Пришло время взяться за исследование своего первого продукта на работке. На этот релиз мне выпала Atlassian JIRA вот она на фиц. сайте. В пользу продукта говорит то, что его очень просто установить, что он имеет бесплатную версию для некоммерческого использования и доступен как для Windows так и для Linux. По ходу работы мне предстоит выковырять из продукта всю необходимую информацию, после того как он будет установлен и настроен: install root – win+linux version: package active log or .reg license И пока все на этом, если дальше будут усложнять, то нужно будет, возможно проследить еще и каки-нибудь зависимости. Итак, установка: стоит сразу сказать, что установка до неприличного простая на обеих ОС, нужно просто скачать на указанном выше сайте самоустановщики-распаковщики требуемые дляShort Read more…

Python array

Начинаю учить Пайтон, буду набивать шпаргалки.

Это мой первый массив, детка. Спустя время, это может показаться для меня смешным, но сейчас я очень доволен собой. Read more…