Skip to content

Instantly share code, notes, and snippets.

@mitya57
mitya57 / qtwebkit-test.py
Created August 28, 2012 12:31
QtWebKit + MathJax test
#!/usr/bin/env python
import sys
from PyQt4.QtCore import QFile, QFileInfo, QTextStream, QUrl
from PyQt4.QtGui import QApplication
from PyQt4.QtWebKit import QWebView
pageSource = """<html><head>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head><body>
@mitya57
mitya57 / mathjax-error-test.html
Created August 30, 2012 14:09
HTML after MathJax processing
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script type="text/x-mathjax-config;executed=true">
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Startup",function () {
var HTMLCSS = MathJax.OutputJax["HTML-CSS"];
HTMLCSS.Font.checkWebFont = function (check,font,callback) {
if (check.time(callback)) return;
if (check.total === 0) {
HTMLCSS.Font.testFont(font);
setTimeout(check,200);
@mitya57
mitya57 / addroute.py
Created November 16, 2012 14:26
Main script for the routes website
#!/usr/bin/python3
# Author: Dmitry Shachnev, 2012
import sys
import time
import os.path
R_NUMBER = 'Номер маршрута'
R_DIRECTIONS = 'Маршрут'
R_WAY = 'Трасса'
@mitya57
mitya57 / lab1.cpp
Created November 24, 2012 11:57
Лабораторная №1
#include <cmath>
#include <cstdlib>
#include <iostream>
#ifndef RANGE
#define RANGE 10000
#endif
#ifndef CORRELATION_OFFSET
#define CORRELATION_OFFSET 10
@mitya57
mitya57 / lab2.cpp
Created November 24, 2012 12:43
Лабораторная №2
#include <cmath>
#include <cstdlib>
#include <iostream>
/**
* Test data:
* 70 120 .5 .7 50 70 20 10 30
* W1 = 0.292
* W2 = 0.145
*/
@mitya57
mitya57 / lab4.cpp
Created November 24, 2012 13:53
Лабораторная №4
#include <cstdlib>
#include <cmath>
#include <iostream>
#define U 6
#define RMAX 100 // 300
#define K .1 // .5
#define Dx 50
#define Dy 70
#define Dz 80
From 67c9502672a5ee87fe1a7d493fb277fc7ff69cdf Mon Sep 17 00:00:00 2001
From: Dmitry Shachnev <mitya57@gmail.com>
Date: Fri, 11 Jan 2013 15:33:38 +0400
Subject: [PATCH] test_coverage_plugin.py: skip the tests when coverage is not
available (closes #597)
---
functional_tests/test_coverage_plugin.py | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
@mitya57
mitya57 / test.cpp
Created April 4, 2013 18:01
Test for QtWebKit fonts bug
#include <QtGui/QApplication>
#include <QtWebKit/QWebView>
int main (int argc, char **argv) {
QApplication app(argc, argv);
QWidget window;
QWebView view(&window);
view.setHtml("<code>Test test test...</code>");
window.show();
return app.exec();
@mitya57
mitya57 / control
Created May 9, 2013 08:13
PyQt5 WIP packaging
Source: pyqt5
Section: python
Priority: optional
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
XSBC-Original-Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
Uploaders: Torsten Marek <shlomme@debian.org>,
Michael Casadevall <mcasadevall@debian.org>,
Bernd Zeimetz <bzed@debian.org>,
Scott Kitterman <scott@kitterman.com>
Build-Depends: dpkg-dev (>= 1.16.1~),
======================================================================
ERROR: test_format_sparse_config (pandas.tests.test_index.TestMultiIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pandas/tests/test_index.py", line 1378, in test_format_sparse_config
pd.reset_printoptions()
File "/usr/lib/python2.7/dist-packages/pandas/core/format.py", line 1643, in reset_printoptions
reset_option("^display\.")
File "/usr/lib/python2.7/dist-packages/pandas/core/config.py", line 196, in __call__
return self.__func__(*args, **kwds)