text stringlengths 256 65.5k |
|---|
I was recently working on one small tool for Midgard Project, and had to deal with a new framework: PyGI. Strictly speaking, it’s not “totally new”, but it is: a) new for me b) just starts to get attention from application developers.
PyGI is a project, which implements dynamic bindings to GObject based libraries for P... |
Testing with Google Music, I realized that it's all about the ID3 tag. Whatever you put there, Google uses it. it doesn't matter what the name of your files are, it's all about the ID3.Even if you have songs where the Artist and Album Artist are different, Google will display both correctly without any confusion.I sugg... |
you can timeit:
>>> import timeit
>>> timeit.Timer('values[99]', 'values = range(100)').timeit(number = 10**7)
0.44513392448425293
>>> timeit.Timer('values[99]', 'values = range(100)').timeit(number = 10**7)
0.45273900032043457
>>> timeit.Timer('values[-1]', 'values = range(100)').timeit(number = 10**7)
0.4443149566650... |
I’ve finally had a little extra time to get back to working on Singlet. There’s been a lot of progress since the first iteration. To start with, Singlet had to be upgraded to work with the new Lens API introduced when Unity 5.0 landed in the Precise repos. Luckily the Singlet API didn’t need to change, so any Singlet l... |
gtk.ItemFactory — creates menus, menubars and option menus from a data description.
class gtk.ItemFactory(gtk.Object):
gtk.ItemFactory(container_type, path, accel_group=None)
def construct(container_type, path, accel_group)
def get_item(path)
def get_widget(path)
def get_widget_by_action(action)
... |
I want to use Python to send commands to an EV3 brick. In C++ things work as expected - for instance, this starts the motor on port A and then stops it after a while:
#include <unistd.h>
#include <fcntl.h>
int main()
{
// command to start motor on port A at speed 20
char start_motor[] = "\x0C\x00\x00\x00\x80\x0... |
Use polymorphism and duck-typing before isinstance()
You generally define what you want to do with the shapes, then either use polymorphism to adjust how each shape responds to what you want to do, or you use duck typing; test if the shape at hand can do the thing you want to do in the first place. This is the invocati... |
simohamed5130
bureau 3d
bonjour, j ai iinstallé ubuntu 12.04 et je veux personnliser mon bureau en 3d,
puisque je suis debutant , j ai cru que j ai tout fais, j ai suivi les instructions au: http://doc.ubuntu-fr.org/bureaux_3d
pour glxinfo | grep "direct rendering" , la reponse etait : direct rending : yes
puis , j ai ... |
Using python and pygame I've built a collision detection system according to the instructions in this YouTube tutorial.
This is updated 40 times per second and controls movement and collision detection between some number of "agents", which are circles, each with a radius of 20:
for a in self.agents:
dir = a.target... |
Webpy + Google App Engine
This cookbook entry explains how to run web.py as a google app engine application
Requirements
Google App Engine Python API
web.py .38 or later
Resources
Notes
The mechanisms for running GAE in python2.7 and 2.5 are different, change the app.yaml accordingly
code.py is the main file of your ap... |
aeacides
Re : Ultimate Smash Friends: un smash bros like en python
Kewl! Bon boulot! De mon côté il me reste une semaine et demi de labeur, et après je devrais pouvoir m'y mettre :- )
@+
http://www.q-be.ca
Hors ligne
tshirtman
Re : Ultimate Smash Friends: un smash bros like en python
cool .
Mon petit frère (qui a dessi... |
This code starts up an infinity of processes and subsequently crashes my PC.
import multiprocessing
def f(process_name):
print process_name, 'says hi'
p1 = multiprocessing.Process(None,f,'1',('1st',))
p1.start()
In the console i see '1st says hi' over and over again, in the task manager i see a bazzilion of interp... |
Leo 7
Re : A quoi ressemble votre environnement - printemps/été 2012
J'adore ton unity Mario_26
Est-ce que tu peux me donner le lien du wall STP, je le touve très zoli.
Merci d'avance
A+
hp 625: Ubuntu LTS xfce / Mac Mini ppc G4: Debian stable xfce / Les choses les plus simples sont les meilleures !
Hors ligne
Major Gr... |
Information theory (IT) is a foundational subject for computer scientists, engineers, statisticians, data miners, biologists, and cognitive scientists. Unfortunately, PHP currently lacks software tools that would make it easy to explore and/or use IT concepts and methods to solve data analytic problems. This two-part s... |
jQuery API Update: offline and anywhere(edit)
The key change I've made is to de-couple the API search engine from the front end. What this has resulted in, is a fairly simple API to create any number of bespoke front ends to the jQuery API browser.
Since the engine now runs separately, it's been easy to create differen... |
A couple of comments on Simple Attribute-Based Template Exporting have asked for an example. I'll show off more of this code in my YAPC::NA 2012 and Open Source Bridge 2012 talk about how to write the wrong code (along with a handful of other techniques).
(I assume some knowledge of Template Toolkit (besides far too ma... |
Rackspace Cloud Queues is backed by the open source project, Marconi. Below, Oz Akan, Development Manager for Rackspace Cloud Queues and an active contributor to Marconi, walks us through the project. Want to try out Marconi without managing your own environment? Want to explore open source code with the comfort of Fan... |
This is something of a followup to earlier posts Drawing Hexmaps and Saving PNG from PyGame. A recent comment from Roger Aisling on the second of those posts asked about drawing with opacity in the Python Image Library (PIL). A check of the PIL API didn't turn up anything, but there is an optional add-on to the PIL cal... |
This question already has an answer here:
The Python documentation says about keyword arguments (glossary):
...The variable name designates the local name in the function to which the value is assigned...
Thus I thought different instances of a class are truly different unless stated explicitly. Yet the following code ... |
If I check with google, I can see my public IP. Is there something on the Ubuntu command-line which will yield me the same answer?
If you are behind a router, then your computer will not know about the public IP address as the router does a network address translation.
If you are not behind a router, you can find it ou... |
Jx7
Re : [script] Télécharger de nombreuses quotidiennes de canal+ (suite)
J'ai l'impression que tu as un problème de droits d'écritures.
Hors ligne
Jx7
Re : [script] Télécharger de nombreuses quotidiennes de canal+ (suite)
Où as-tu placer le script?
Hors ligne
Jx7
Re : [script] Télécharger de nombreuses quotidiennes d... |
The line with the issue is
ret=subprocess.call(shlex.split(cmd))
cmd = /usr/share/java -cp pig-hadoop-conf-Simpsons:lib/pig-0.8.1-cdh3u1-core.jar:lib/hadoop-core-0.20.2-cdh3u1.jar org.apache.pig.Main -param func=cat -param from =foo.txt -x mapreduce fsFunc.pig
The error is.
File "./run_pig.py", line 157, in process
... |
I'm also struggling with this and the problem seems to be in the way that Flask imports the extensions. If you open the flask/ext/__init__.py file you'll see it uses importer. I don't think PyDev likes this much, so I've edited this file with the fixed imports:
import flask_login as login
import flask_sqlalchemy as sql... |
I have some problem:
f = open('OUTPUT.txt', 'w')
def function
if ........
......
f.write(XXX) #this must be in this loop #1.write
else:
....
....
....other code...
................
with open("INPUT.txt") as f_in:
for line in f_in:
for char in line:
... |
The Python language
About Python
Python is a general-purpose high-level programming language. Its design philosophy emphasizes programmer productivity and code readability. It has a minimalist core syntax with very few basic commands and simple semantics, but it also has a large and comprehensive standard library, incl... |
Let's say you have a model to store media files (images, movies, etc)
db.define_table('album',SQLField('media','upload'))
and you have Auth and Crud enabled via:
from gluon.tools import *
auth=Auth(globals(),db)
auth.define_tables()
crud=Crud(globals(),db)
In order to allow login/logout, post media files and retrieve... |
(gdb) r
Starting program: /media/data/home/tschwinge/tmp/h
[New Thread 26731.15]
Breakpoint 1, 0x08048236 in main ()
(gdb) info threads
5 Thread 26731.15 0x080a97fc in mach_msg_trap ()
* 4 Thread 26731.14 0x08048236 in main ()
(gdb) thread 5
[Switching to thread 5 (Thread 26731.15)]#0 0x080a97fc in mach_msg_trap ... |
void testStackTrace()
{
ExceptionStackTrace helper;
try
{
doSomethingWhichMightThrow();
}
catch ( std::exception & ex )
{
std::cerr << "Exception occurred: " << ex.what() << std::endl;
helper.printStackTrace( std::cerr );
}
}
prints out a stack trace for t... |
I have two problems:
Button 'Today' does not work because the calendar is not initialized with the selected value, and initialize the current month.
I need override onclick for button 'Done' - how do this?
script:
$('.datefield_month').datepicker({
changeMonth: true,
changeYear: true,
... |
Everything began one fine day when I visited our storage room to see if there was anything interesting for me to look at. Soon I came across an old shabby dark-gray Toshiba notebook thrown there amidst different computer rubbish long ago, from the time when Intel's Pentium I was the top of performance. I couldn't pass ... |
#1476 Le 27/06/2013, à 20:53
The Uploader
Re : /* Topic des codeurs [8] */
Je ne suis pas sûr de comprendre la question pour le coup.
En fait, je rajoute ceci :
position: relative;
À ce code de app/assets/stylesheets/application.css :
#preview {
float:left;
width: 46%;
height: 100%;
border-left:5px solid gray;... |
Claude LENDREVIE
Re : [Résolu] Libérer de la place sur le disque
Voici le résultat :
root@claude-System-Name:~# sudo add-apt-repository ppa:tualatrix/ppa
You are about to add the following PPA to your system:
The official Ubuntu Tweak stable repository
More info: https://launchpad.net/~tualatrix/+archive/ppa
Press [E... |
it depends, if your xml element have sub element, and that sub element also need to be compared, use DOM,
your elements to be compared only has attributes, thant using SAX is best way, I post some SAX code here you can ref:
import xml.sax
from xml.sax.handler import ContentHandler
class TableHandler(ContentHandler):
... |
use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
~31 users here now
Welcome to r/DailyProgrammer!
First time visitors of Daily Programmer please Read the Wiki to lea... |
#8526 Le 21/02/2013, à 22:33
The Uploader
Re : Topic des Couche-Tard (cinquante-sept)
Pas chez moi.
Passer de Ubuntu 10.04 à Xubuntu 12.04 LTS
ASUS N56VV (UEFI + GPT, Core i5-3230M @ 2.60GHz, Intel HD4000 + GeForce 750M, 12 Go de RAM, SSD 1 To)
Système principal : Archlinux (amd64), avec KDE
Système oublié la plupart d... |
From time to time I come to ideas of actions I'd like to have available in a menu which pops up when I right-click on files in Nautilus. How to add them there? Is there something like Thunar UCA plugin for Nautilus?
Context menus of Nautilus can be customized by Nautilus extensions.
You can also place plain shell scrip... |
The major weakness of your algorithm is that, for every subword, you need to compare it to every other word in the dictionary. You don't need to do that, really - if your word begins with 'a', you don't really need to see if it matches words that begin with 'b'. If the next letter is 'c', then you don't really care to ... |
I am told to
Write a function, square(a), that takes an array, a, of numbers and returns an array containing each of the values of a squared.
At first, I had
def square(a):
for i in a: print i**2
But this does not work since I'm printing, and not returning like I was asked. So I tried
def square(a):
for i ... |
Here is a pattern object that I tried to make in python using the re module. What I am going for is something that will take the string "(\exists x)(Px*Qx)" and find just the "Px*Qx" portion. I thought that I would try to use the lookahead and lookbehind assertions. I'm not sure if I am using this wrong or if there is ... |
I am really struggling with this language issue.
I went to System->Administration->Language Support and moved Turkish (Türkçe) to the top. Then I clicked "Apply System-wide" and restarted.
However, after restarting, echo $LANG reported en_US.utf8, so I logged out and back in - and now it reports tr_CY.utf8.
Now here'... |
Module pickletools
"Executable documentation" for the pickle module.
Extensive comments about the pickle protocols and pickle-machine opcodes
can be found here. Some functions meant for external use:
genops(pickle)
Generate all the opcodes in a pickle, as (opcode, arg, position) triples.
dis(pickle, out=None, memo=... |
This is a very simple task to do but I can't understand the right syntax.
I have a shapefile whose attributes are similar to the following:
FID Shape FIELD1 FIELD2 FIELD3 ...0 Polygon 0 1 01 Polygon 3 0 72 Polygon 3 4 7...
The number of fields and their names are always different.
I need to create a new field (let's na... |
Unless your graphic is huge, many of those 3 million points are going to overlap.(A 400x600 image only has 240K dots...)
So the easiest thing to do would be to take a sample of say, 1000 points, from your data:
import random
delta_sample=random.sample(delta,1000)
and just plot that.
For example:
import matplotlib.pypl... |
This is not really an answer; it is some analysis, and a request for a lot more information.
Analysis
The Arabic data appears in my browser as UTF-8:
0x3C = U+003C
0x70 = U+0070
0x3E = U+003E
0xD9 0x84 = U+0644
0xD9 0x84 = U+0644
0xD8 0xAA = U+062A
0xD9 0x83 = U+0643
0xD8 0xB1 = U+0631
0xD9 0x85 = U+0645
0x20 = U+0020
... |
Problem Statement:
Manasa is out on a hike with friends. She finds a trail of stones with numbers on them. She starts following the trail and notices that two consecutive stones have a difference of either a or b. Legend has it that there is a treasure trove at the end of the trail and if Manasa can guess the value of ... |
I am trying to use GdkPixbuf.Pixbuf.new_from_data() as shown in gtk 2.x and I am passing 7 arguments. But it gives me an error that I need to pass 9 arguments.
What I am doing now was working for gtk2.x . So I figured out the other 2 arguments that I need to pass.
One of the arguments is of type GdkPixbuf.PixbufDestroy... |
Using python.....I have a list that contain names. I want to use each item in the list to create instances of a class. I can't use these items in their current condition (they're strings). Does anyone know how to do this in a loop.
class trap(movevariables):
def __init__(self):
movevariables.__init__(self)
... |
I want to perform an SVD on a 12*12 matrix. The numpy.linalg.svd works fine. But when I try to get the 12*12 matrix A back by performing u*s*v , i dont get it back.
import cv2
import numpy as np
import scipy as sp
from scipy import linalg, matrix
a_matrix=np.zeros((12,12))
with open('/home/koustav/Documents/ComputerVis... |
I believe I'm getting bitten by some combination of nested scoping rules and list comprehensions. Jeremy Hylton's blog post is suggestive about the causes, but I don't really understand CPython's implementation well-enough to figure out how to get around this.
Here is an (overcomplicated?) example. If people have a sim... |
I am having an difficult time conceptualizing how to implement Strassen's version of this algorithm.
For background, I have the following pseudocode for the iterative version:
def Matrix(a,b):
result = []
for i in range(0,len(a)):
new_array = []
result.extend(new_array)
for j in range(0,... |
life == "good"
Here's some things you should know about me.
Don't wake me up earlier than 7:30, unless you want your face dented in.
I have no life. I once spent 1 solid day, programming.
I have a raspberry pi. That's it.
I really only play one game. Minecraft.
What's my name again?
Here's a program I made to emulate P... |
I am trying to use BeautifulSoup to get text from web pages.
Below is a script I've written to do so. It takes two arguments, first is the input HTML or XML file, the second output file.
import sys
from bs4 import BeautifulSoup
def stripTags(s): return BeautifulSoup(s).get_text()
def stripTagsFromFile(inFile, outFile):... |
I'm looking for a way to change a color's tone, knowing it's RGB composition, then replace all instances of the old RGB with the obtained RGB. For example, I'd like red to become purple, light red, light purple, etc... It can be done in photoshop by changing a color's hue.
What I've thought so far is the following: con... |
I'm trying to rewrite some old python code with requests module. The purpose is to upload an attachment. The mail server requires the following specification :
https://api.elasticemail.com/attachments/upload?username=yourusername&api_key=yourapikey&file=yourfilename
Old code which works:
h = httplib2.Http()
... |
Grunt is a powerful task runner with an amazing assortment of plugins. It's not limited to the frontend, but there are many frontend-oriented plugins that you can take advantage of to combine and minify your static media, compile sass and less files, watch for changes during development and reload your browser automati... |
I did see a couple similar questions, but they didn't quite seem to answer the problem I'm having.
So far, I've only been doing the manage.py runserver, running locally.
At first I tried just putting this in my settings.py:
import allauth
ACCOUNT_EMAIL_REQUIRED = True
then tried extending it to:
import allauth
ACCOUNT... |
I am trying to improve a function in python. It takes several arguments, some of which could be missing.
def some_function (self, a, b, c, d = None, e = None, f = None, g = None, h = None):
#code
The arguments d through h are string type, and have different meaning - and it is important that I can pass a, b, c, d,... |
The regex solution (to me) seems like it would be pretty easy:
import re
def split_string(source,separators):
return re.split('[{0}]'.format(re.escape(separators)),source)
example:
>>> import re
>>> def split_string(source,separators):
... return re.split('[{0}]'.format(re.escape(separators)),source)
...
>>> ... |
How do I reduce the number of ticks on the axes with matplotlib (without using pyplot)?
self.figure = Figure((2.0, 2.0))
self.canvas = FigureCanvas(self.figure)
self.canvas.setParent(self)
self.axes = self.figure.add_subplot(111)
self.figure.subplots_adjust(left=0.18)
self.axes.fill(x, y, 'b')
now.... |
If you are dealing with an API that you didn't write that returns truthy values on success and falsy values on failure, that seems like a reasonably readable and compact way to do it. If you have control over the API, I'd encourage you to use exceptions instead of return values to indicate errors.
If you use the functi... |
You're not actually adding a new axes.
Matplotlib is detecting that there's already a plot in that position and returning it instead of a new axes object.
(Check it for yourself. ax and newax will be the same object.)
There's probably not a reason why you'd want to, but here's how you'd do it.
(Also, don't call newax =... |
COVERITLIVE API (V. 2.0)
Purpose
The
Basic Developer Information
Methods
Comment Management Methods
Content Management Methods
Event Management Methods
Pin Content Management Methods
Reply Management Methods
Newsflash Management Methods
Poll Management Methods
Scoreboard Management Methods
Miscellaneous Methods
Request... |
I'm working on a very simple app for Ubuntu. I've asked a question on stackoverflow, and it seems that the issue I am having is caused by signals, not by the scope of variables, as I originally thought. The problem I am having is that when TextBox emits a signal through activate the whole code works without a glitch. B... |
mol1
Re : Hortus belli projet de tower defense (finissons le jeu d'helly)
Un lien vers une esquisse de musique :
http://ubuntuone.com/7RqEp9oXkT6K338qog5WlX
Hors ligne
Ypnose
Re : Hortus belli projet de tower defense (finissons le jeu d'helly)
La zike est pas mal.
J'aiderai bien mais je suis pas bon codeur C, donc si v... |
I've written a server using Python and the Twisted library that communicates via UDP. This all works well.
What I would like to do is extend that server so that it can accept messages on multiple UDP ports simultaneously (I use the different ports to segregate the information returned, and it's less about the source of... |
malbo
Re : Windows 8.1+Ubuntu...
Ton Boot-Info est là :
Boot Info Script e7fc706 + Boot-Repair extra info [Boot-Info 27Sep2013]
============================= Boot Info Summary: ===============================
=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector
175118912 of the same hard ... |
FTG
[script/python] Nautilus et picasaweb!
Bonjour à tous,
depuis longtemps je voulais réaliser un petit script python a l'aide des API Google, me permettant d'uploader en 2 temps 3 mouvements un paquet de photos de Nautilus vers Picasaweb par un clic droit de souris.
Je n'avais pratiquement rien à faire aujourd hui et... |
Hello! I have an interesting problem that seemed simple to me, but I'm unable to solve it on my own.
Suppose I am drawing k numbers out of n numbers labeled from 1 to n.Considering all $\binom{n}{k}$ combinations of numbers drawn, how often does the maximal difference q between two consecutive numbers â but also betw... |
This is my first question here.. :) Well.. I'm wondering if anyone has achieved this in an effecient way.
I want to search through friends friends and possibly their friends to see if some of them are present in my datastore. I've thought up several ways to do this, but they all have weaknesses.. :/
My first plan was t... |
I have a program which takes a long time to complete. I would like it to be able to catch SIGINT (ctrl-c) and call the self.save_work() method.
As it stands, my signal_hander() does not work since self is not defined by the time the program reaches signal_handler().
How can I set it up so self.save_work gets called aft... |
I'm writing a plugin for an application (Autodesk Revit Architecture 2011, if you need to know).
During debugging, I'd like to recompile my plugin and reload that in the host. My specific host even provides an Add-In Manager that simplifies this process, using Assembly.Load. For Windows.Forms plugins, this works like a... |
Hagar de l'Est
[How-To] Installer OpenOffice.org avec les RPMs officiels
Si vous n'avez pas la patience d'attendre que les dépôts soient mis à jour pour installer la dernière version d'OOo, voici la méthode manuelle à partir des RPMs officiels.
NB: avant d'installer, si vous avez modifié la configuration des dictionnai... |
I am trying to match a template with a binary image (only black and white) by shifting the template along the image. And return the minimum distance between the template and the image with the corresponding position on which this minimum distance did occur. For example:
img:
0 1 00 0 10 1 1
template:
0 11 1
This templa... |
I have the following function that coverts an image into a list of hash values (using PIL):
def _GetImageHash(image):
st = time.time()
image_list = list(image.getdata())
(columns, rows) = image.size
hash_vals = [0]*rows
for i in xrange(0,rows):
hash_vals[i] = hash(tuple(image_list[i*columns:(i+1)*columns]... |
I have a grid of m X n cells. Some of them are on and off state. Find an efficient algorithm to count the no of connections.
Many dots connected in top, left, right, bottom still be considered 1 connection.
I have a grid of m X n cells. Some of them are on and off state. Find an efficient algorithm to count the no of c... |
Someone wrote to me today that they found some of my public Github Gists "publickeydecrypt|encryptgpgbase64.go and encryptdecryptgpg_armor.go - incredibly helpful! Thanks for sharing those. I'm using the latter for storing bitcoin private keys."
I originally wrote them as there weren't any good examples on the web that... |
How do i take multiple arbitrary values from different index positions in an iterator?
How to get the n next values of a generator in a list (python) and Get the nth item of a generator in Python describe the use of itertools.islice for taking arbitrary element or continuous subset from an iterator. But what if i want ... |
I am writing a simple class that will basically accept 3 parameters, execute a series of commands and return the result.
Now the problem is that i am not clear about how to write a proper class in Python (i use C++ mainly); so is kinda weird for me to figure out what and how to write the class.
I have 3 parameters: nam... |
michcauch
my-weather-indicator ne fonctionne plus après mise à jour
my-weather-indicator ne fonctionne plus, juste après une mise à jour de my-weather-indicator sous 12.04. J'ai ce message d'erreur quand je le lance depuis un terminal :
michel@bureau:~$ my-weather-indicator
Traceback (most recent call last):
File "/usr... |
My preferred method for doing this is to find n evenly-spaced points along the colour wheel.
We represent the colour wheel as a range of values between 0 and 360. Thus, the values we will use are 360 / n * 0, 360 / n * 1, ..., 360 / n * (n - 1). In doing this, we've defined the hue of each of our colours. We can descri... |
Here's the deal and reason I'm asking for your help. Last night I went on upgrading my Xubuntu 12.10 installation to 13.04, so at tty1 I run the command
sudo do-release-upgrade
and everything seemed to went well except that after rebooting and when I run
sudo apt-get update && sudo apt-get upgrade
I get this error:
s... |
Using Python and XML with Microsoft .NET My Services
by Christopher A. Jones, coauthor of Python & XML
12/03/2001
Microsoft piqued developer interest when it announced a new project code-named HailStorm in the spring of 2000. The idea of a distributed, XML-based data store that would allow your information to follow ... |
I couldn't find an alpha composite function in PIL, so here is my attempt at implementing it with numpy:
import numpy as np
import Image
def alpha_composite(src, dst):
'''
Return the alpha composite of src and dst.
Parameters:
src -- PIL RGBA Image object
dst -- PIL RGBA Image object
The algorit... |
I am wondering why I am receiving this error:
cmd = "INSERT INTO resulttest (category, value, timestamp) VALUES (" + key + ", " + str(value) + ", " + str(timestamp) + ")"
c.execute(cmd)
db.commit()
INSERT INTO resulttest (category, value, timestamp) VALUES (composed, 2, 1343186948.8)
Traceback (most recent call las... |
The get and setdefault methods are important to know, they should be in any Python programmer's toolbox.
Another important way of doing this is to use collections.defaultdict, because then you can define your "default" in a single place without having to scatter it throughout your code wherever the dictionary is used, ... |
hectorau_ben
Re : [tuto]Installation de Dofus 2.0 par paquet debian et rpm (pour la doc)
Même si tu m'as toujours pas répondu, dofus marche parfaitement, sans AUCUN ralentissement, mais le son ne marche pas ... Même si l'Updater est ouvert et que j'ai activé le son dans le options et biensûr, je n'ai pas trouvé la solu... |
Some Notes on Tim Bray's Wide Finder Benchmark
Fredrik Lundh | Updated October 12, 2007 | Originally posted October 6, 2007
The Problem #
Tim Bray recently posted about his experiences from using Erlang to do some straightforward parsing of a large log file, inspired by a chapter he wrote for the book Beautiful Code. A... |
Sissio
Boot kernel 3.5.0-17
Bonjour,
Ce matin j'ai eu la mise à jour du kernel en version 3.5.0-17 sur voyager 12.04 Lts.
Lors du reboot l'animation de démarrage se charge correctement et avant d'arriver sur le bureau cela reste figé et je perd totalement la main car même le clavier ne répond plus.
La seule solution qu... |
web2py trunk ver 1281, modified base on stable Version 1.67.2 (2009-09-28 16:29:33)
beaware, no browser can handle file over 2GB,
related article http://www.motobit.com/help/scptutl/pa98.htm
and, this code is just a simple patch that only works when you running web2py standalone,
it just shows the concept about how to ... |
Introduction
Google App Engine (GAE) is a useful platform on which to developPython-based web applications. But a GAE application runs in a sandboxthat prevents it from opening a socket, which makes the standard Pythonxmlrpclib module inoperable.
Fortunately, there’s a simple solution to this problem.
This article is b... |
my code is below. it loads only the first image form 'posts' database. how can i load the all image from the database????
import webapp2
import os
import jinja2
from google.appengine.ext import db
from google.appengine.api import images
jinja template code
template_dir = os.path.join(os.path.dirname(__file__), 'templa... |
Python’s logging module from the standard libarary has over stayed its welcome for far too long.
Logbook is an extremely well documented and powerful logging handler library. Out of the box, it includes log handlers for Standard Logfiles, Email, Syslog, NTEventLog, and Custom Notifiers. It even supports Growl and LibNo... |
Python-Powered Templates with Cheetah
by Andrew Glover
01/13/2005
XML transformation via XSL Transformations (XSLT) is quite popular and indeed powerful. Well-constructed XSL can produce HTML, PDF, XML, and just about any other text format imaginable. XSLT, however, requires that the subject data be a well-structured X... |
smo
Re : logiciel creation/remasterisation/clonage de distributions base ubuntu
mwoe effectivement y s arrete direct y cree pas les fichiers et sort... je regarde
ht5streamer, streaming youtube/dailymotion...: http://forum.ubuntu-fr.org/viewtopic.php?id=1299461 / http://ht5streamer.free.fr
ubukey, createur ubuntu custo... |
The easiest way that I have found was to do something along the lines of:
el = driver.find_element_by_id('id_of_select')
for option in el.find_elements_by_tag_name('option'):
if option.text == 'The Options I Am Looking For':
option.click() # select() in earlier versions of webdriver
break
This may ... |
I found an old version of adeskmenu on launchpad and figured it would be nice to take advantage of tint2's new launcher feature. So with a help from MoD from silver.irc we re-worked the script to just open the menu when clicked. Here is a screenshot.
All you need is the single page menu script and a .desktop pointing t... |
I have the following script:
#Import ArcPy site package
import arcpy
from arcpy import env
from arcpy import Raster
from arcpy.sa import ZonalStatistics
from arcpy.sa import CreateConstantRaster
# Set Environment Workspace
ws = env.workspace = "MY_WORKSPACE_PATH\\FGD.gdb"
# Set Environment Raster Cell Size
env.cellSize... |
I want to post a file to a server via python, for this I need to name this file as "xmlfile" so that server recognizes the input.
import urllib2
url = "http://somedomain"
to_send = open('test.xml').read()
data = {}
data['xmlfile'] = to_send
f = urllib2.urlopen(url, data)
This doesn't work, in addition, how can I retri... |
Rodney
Création d'un logiciel libre de reconnaissance de sinogrammes
Bonjour à tous,
Étant étudiant en japonais, j'ai longtemps cherché un équivalent pour Ubuntu du IME Pad proposé dans Windows. N'ayant rien trouvé, je me suis tourné vers des solutions en ligne, qui se révèlent bien moins efficaces. Pour ceux qui ne co... |
Extensions
firebird_fdw 0.2.5
A PostgreSQL foreign data wrapper (FDW) for Firebird
README
Contents
Firebird Foreign Data Wrapper for PostgreSQL
This is an experimental foreign data wrapper (FDW) to connect PostgreSQL to Firebird. It provides basic functionality, including both read (SELECT) and write (INSERT/UPDATE/DEL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.