This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QStringList images; | |
QTextBlock b = document->begin(); | |
while (b.isValid()) { | |
for (QTextBlock::iterator i = b.begin(); !i.atEnd(); ++i) { | |
QTextCharFormat format = i.fragment().charFormat(); | |
bool isImage = format.isImageFormat() | |
if (isImage) | |
images << format.toImageFormat().name(); | |
} | |
b = b.next(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
from random import choice | |
import re | |
class Cup: | |
""" A class defining a cup that will hold the words that we will pull out """ | |
def __init__(self): | |
self.next_word = Counter() # will keep track of how many times a word appears in a cup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
class HoverException(Exception): | |
pass | |
class HoverAPI(object): | |
def __init__(self, username, password): | |
params = {"username": username, "password": password} | |
r = requests.post("https://www.hover.com/signin", params=params) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Thanks for all the votes, I never expected that much, just 1 or 2. | |
noCursor() | |
frameRate 20000000000000000000000000000 | |
colors = [] | |
board = [2000000000000000, " RNBQKBNR", " PPPPPPPP", " ........", " ........", " ........", " ........", " PPPPPPPP", " RNBQKBNR"] | |
sides = [0, " bbbbbbbb", " bbbbbbbb", " ........", " ........", " ........", " ........", " wwwwwwww", " wwwwwwww"] | |
possibleMoves = [0, " 00000000", " 00000000", " 00000000", " 00000000", " 00000000", " 00000000", " 00000000", " 00000000"] | |
#var board = [0, | |
#" RNBQKBNR", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# * Simulation of telescope on Earth looking at the night | |
# * sky (ignoring the rotation of the Earth). | |
# * | |
# * Telescope angles relative to vernal equinox (First Point of Aries). | |
# * | |
# * - Planets - | |
# * Green: Mercury | |
# * Gray: Venus | |
# * Brown: Mars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#======================================================================== | |
# Description: Tokenise an Excel formula using an implementation of | |
# E. W. Bachtal's algorithm, found here: | |
# | |
# http://ewbi.blogs.com/develops/2004/12/excel_formula_p.html | |
# | |
# Tested with Python v2.5 (win32) | |
# Author: Robin Macharg | |
# Copyright: Algorithm (c) E. W. Bachtal, this implementation (c) R. Macharg | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Video of the code in action: http://www.youtube.com/watch?v=BtmRBxRsMk4 | |
#! python | |
# -= encoding=utf-8 =- | |
############################################################################## | |
# | |
# uibtre.py $Rev:$ | |
# $Id$ | |
# | |
# Copyright (c) 2011, shimoda as kuri65536 _dot_ hot mail _dot_ com | |
# ( email address: convert _dot_ to . and joint string ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
$('#mybutton').click(function() { | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# views.py - django app called ajx | |
from django.shortcuts import render, get_object_or_404, redirect, HttpResponse, render_to_response, HttpResponseRedirect | |
from django.core.urlresolvers import reverse | |
from django.contrib.auth import authenticate, login | |
import json | |
def mygetview(request): | |
if request.method == 'GET': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Use jQuery 1.9.1 --> | |
<script src="http://code.highcharts.com/highcharts.js"></script> | |
<script src="http://code.highcharts.com/modules/exporting.js"></script> | |
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div> | |
<!-- javascript --> | |
$(function () { | |
var chart = { |
OlderNewer