text stringlengths 256 65.5k |
|---|
Given the following simple program:
import wx
class TestDraw(wx.Panel):
def __init__(self,parent=None,id=-1):
wx.Panel.__init__(self,parent,id,style=wx.TAB_TRAVERSAL)
self.SetBackgroundColour("#FFFFFF")
self.Bind(wx.EVT_PAINT,self.onPaint)
self.SetDoubleBuffered(True)
self.ci... |
I'm trying to create a messaging system where a message's sender and recipients can be generic entities. This seems fine for the sender, where there is only object to reference (GenericForeignKey) but I can't figure out how to go about this for the recipients (GenericManyToManyKey ??)
Below is a simplified example. Per... |
Author zdg
Submission date 2012-04-22 01:12:31.098745
Rating 7534
Matches played 439
Win rate 76.31
Use rpsrunner.py to play unranked matches on your computer.
# greedy history pattern match
# greedy - use highest available order and most recent
# order 7
# use my hands, op hands, as well as both to predict next op han... |
I have this strange problem, I am unable to access imgur.com from Ubuntu !
I have checked the /etc/hosts file, there seems to no entry related to imgur. I can access it from Windows(same connection).
I cannot ping it or traceroute it, I cannot even ping the IP of imgur. I have cleared iptables too, what could be the ca... |
Storable: "freeze" versus "nfreeze"
I was doing a code review and discovered that one of our developers wrote code using Storable's freeze() function. This turned out to be a bug because we store objects in memcache with nfreeze() instead. Storable's docs have only this to say about nfreeze().
If you wish to send out t... |
Thanks to a certain recent Open SSL bug there’s been a lot of attention paid to passwords in the media. I’ve been using KeePassX to manage my passwords for the last few years so it’s easy for me to find accounts that I should update. It’s also a good opportunity to use stronger passwords than ‘banana’.
My problem is th... |
What would be easiest way to use MediaWiki cookies in some Python CGI scripts (on the same domain, ofc) for authentication (including MW's OpenID, especially)?
Access from python to MediaWiki database is possible, too.
You could connect to and modify the SQL-database without HTTP and cookies using the MySQLdb module, b... |
I am having problems with installation with everything in the software center.
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 968, in simulate
trans.unauthenticated = self._simulate_helper(trans)
File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", l... |
kevlar
Ella : projet de logiciel d'animation Flash & SVG pour Linux
Le projet est aujourd'hui bien avancé : version 0.3.1.2 au 2 Novembre 2010 !
Ella (Elegant Light Linux Animator) est un projet amateur destiné à fournir à la communauté linuxienne un générateur d'animations Flash & SVG wysiwyg, fonctionnel, léger, bien... |
SHORT VERSION: External methods bound to an instance can't access private variables directly via self.__privatevarname. Is this a feature or a bug?
EXTENDED VERSION (WITH EXPLANATION AND EXAMPLE):
In Python: Bind an Unbound Method?, Alex Martelli explains a simple method for binding a function to an instance.
Using thi... |
I'm using feedparser in a deferred task in google app engine like this:
class RSSFetchHandler(webapp.RequestHandler):
def get(self):
deferred.defer(parse_dk_indeed_com, feed)
and then in parse_dk_indeed_com I have the following code snippet:
import feedparser
def parse_dk_indeed_com(feed):
d = feedpar... |
Oracle Fusion Middleware Tag Reference for Oracle ADF Faces
11g Release 2 (11.1.2.2.0)
E17491-04
The forEach tag is a replacement for the JSTL <c:forEach> tag. Though as of JSF 1.2/JSP 2.1/JSTL 1.2, <c:forEach> can be used with any JSF components or tags, it does not support "varStatus" when used with deferred evaluati... |
yossarian
Réponses : 8
Bonjour,
Je commence à chercher un portable pour remplacer mon Inspiron 1520 et j'aurais besoin de conseils alors je me tourne vers les connaisseurs qui passeraient par là.
Mon cahier des charges est le suivant :
- le meilleur écran possible (c'est pour mon boulot : des heures à lire, relire, tap... |
michel2652
(pas résolu, mais...) mise à jour depuis dépots plf
Bonsoir,
Je viens d'installer Breezy sur un poste, tout s'est bien passé, mais pour installer différents paquets libres et non libres, j'ai eu quelques petits problèmes...
Après avoir modifié mon sources.list pour les PLF et les backports, des mises à jour ... |
import smtplib
fromaddress = 'me@example.com'
toaddress = [fromaddress]
message = """
From: %s
To: %s
Subject: test
Hello
Goodbye
""" % ( fromaddress, toaddress)
server = smtplib.SMTP('mydomain.com')
server.set_debuglevel(1)
server.sendmail(fromaddress, toaddress, message)
This code opens a socket ok but then fails ... |
This question is still unsolved! Please answer if you know
Bug
I have filed a bug here
While working on my gdrive-cli project, I ran into this error attempting to upload a UTF-8 markdown file, using the "text/plain" mime-type. I also tried with "text/plain;charset=utf-8" and got the same result.
Here is the stacktrace ... |
After watching Raymond Hettingers talk Transforming Code into Beautiful, Idiomatic Python I got back to a function I wrote.
I'm not quite sure how to make it more pythonic but I think this might be a use-case to use the map function.
import logging
import string
import os
def _mounted_drives(possible_device_letters=str... |
Other recipes
Upgrading
In the "site" page of the administrative interface there is an "upgrade now" button. In case this is not feasible or does not work (for example because of a file locking issue), upgrading web2py manually is very easy.
Simply unzip the latest version of web2py over the old installation.
This will... |
Chris__
Re : gReemote, télécommande + prog TV pour Freebox HD
Voilà, comme prévu, la version maverick du ppa est dispo.
Du coup nouvelle version 1.73 mais aucune modif vraiment visible je crois. Je ne sais plus si j'avais déjà la possibilité de chercher une chaîne par nom par exemple (Fichier > filtrer les chaînes)
Enj... |
General method:
def checkEqual1(iterator):
try:
iterator = iter(iterator)
first = next(iterator)
return all(first == rest for rest in iterator)
except StopIteration:
return True
One-liner:
def checkEqual2(iterator):
return len(set(iterator)) <= 1
Also one-liner:
... |
Python was created by Guido Van Rossum in the early 90’s. It is now one of the most popular languages in existence. I fell in love with Python for its syntactic clarity. It’s basically executable pseudocode.
Feedback would be highly appreciated! You can reach me at @louiedinh or louiedinh [at] [google’s email service]
... |
I am working on python and came across some concept of finding the statistics and execution time of the code
Suppose i had the following code
from time import gmtime, strftime
import timeit
def calculation():
a = 2
b = 3
res = a + b
return res
if 'name' == 'main' :
exec_time = timeit.timeit(cal... |
The following code creates a function Which_Line_for_Position(pos) that gives the number of the line for the position pos, that is to say the number of line in which lies the character situated at position pos in the file.
This function can be used with any position as argument, independantly from the value of the file... |
As somebody now spending all his time in NoSQL land, my brain perked up when working through The Three Minute SQL Performance Quiz. It was a blast from the past for me, a chance to remember all the little ins’n’outs of SQL performance from a quaint old time when I used to be able to write JOIN statements.
So I thought ... |
fgin
Impossible définir les langues du système/ kcmshell4 language-selector
Je viens d'installer 12.10, depuis le DVD d'install.
Je veux installer le chinois, pour une utilisation dans toutes las applications. Ibus s'intalle sans problème, de meme que tous les packs de langue.
MAIS, impossible de changer les langues du... |
Voy a redactar distintas maneras de hacer pruebas en Python. En este sentido, veremos diferentes estilos, desde el más sencillo al más complejo; desde las pruebas unitarias hasta las pruebas de sistema.
Estoy convencido de que me voy a dejar mil historias en el tintero… os ruego un poco de paciencia y de ayuda :D
En es... |
I am having problems with bluetooth SPP on a samsung galaxy note with android 2.3.6 - it works for a while but suddenly the connection is terminated - works continous on other phones. Here the part of the log where it happens
D/BLZ20_ASOCKWRP(11288): asocket_read
I/BLZ20_WRAPPER(11288): blz20_wrp_poll: nfds 2, timeout ... |
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 ... |
I had the same symptoms, lirc would not work when run as a service, but would work as a command. Note that in my case some of the keys worked, but only when lirc was not running (neither as a service nor a command).
The problem was that evdev (an input driver for Xorg) was picking up the remote as a keyboard input devi... |
I have a function which returns a list of tuples, that I would like to iterate through:
def get_parameter_product(num_parameters, lower_range, upper_range):
param_lists = [ xrange(lower_range, upper_range) for _ in xrange(num_parameters)]
return list(itertools.product(*param_lists))
for p in get_parameter_pr... |
I have the following directory structure
RawRepo contains a simple class:
class RawRepo:
pass
init.py contains:
__all__ = ["RawRepo"]
And yap-analysis.py, my "main file", uses either of the following, but it doesn't work:
from yap import RawRepo
from yap import *
when I try to instantiate it, saying:
TypeError: '... |
Unify and Synchronize Your iTunes Libraries
Pages: 1, 2
A Simple Script to Get You Going
The following Python script computes the differences between two iTunes Music Library.xml files. Copy it into a file named "diffMusicLibs.py" or download it here; invoke it from a terminal by typing python diffMusicLibs.py <file2> ... |
I have been using Google app engine to host my web pages where I rehearse my coding skills. My site is built on top of Foundation framework. I started playing around with Angular and the appengine returns an error message:
Traceback (most recent call last):
File "/base/data/home/runtimes/python/python_lib/versions/1/g... |
I'm trying to build an application that will prompt the user for a string, and then add that string to a Scrolling Listview object using quickly and PyGTK.
I've been following this tutorial:
When I hit the add button, the prompt comes up properly and I'm able to enter the string. The column appears correctly but the li... |
phiphi076
Re : La mise a jour clamAV et clamtk
@awass
la commande te permet de lancer le programe en mode graphique
avec les droits "root" administrateur (avoir accès au système) .
lorsque tu lance clamav "normalement" sans les droits administrateur
, tu peut pas faire les mises a jour des liste de virus et programe
de... |
I have a mass of KML files, approx 350+ that I need in a single fGDB. I lifted a string of code from ESRI help to attempt to do this - I got it working to the point of creating all the individual gGDBs (one per KML) but its failing with an invalid character in a variable somewhere. Below is the code, and then the error... |
look at the following snippet:
>>> import unicodedata
>>> from unicodedata import normalize, name
>>> normalize('NFKD', u'\xb4')
u' \u0301'
>>> normalize('NFKD', u'a\xb4a')
u'a \u0301a'
>>> normalize('NFKC', u'a\xb4a')
u'a \u0301a'
>>> name(u'\xb4'), name(u'\u0301')
('ACUTE ACCENT', 'COMBINING ACUTE ACCENT')
I am tryi... |
If you are willing to use an external tool, then t-vim provides highlighting for many languages. You can use it as follows: define a typing
\usemodule[vim]
\definevimtyping [RUBY] [syntax=ruby]
and then use it either as an evnironment
\startRUBY
...
\stopRUBY
or inline
\inlineRUBY{...}
This module does... |
benoitfra
[Script] reconnaissance vocale avec google
Voilà pas mal de temps que le projet avait été lancé (2012) mais je n'avais pas les compétences et le temps pour amener le projet là où je le désirais. J'ai donc repris tout le projet à 0 afin de fournir un système beaucoup plus souple et rapide de prise en main.
Pri... |
Hi
I am tring to use the function ImageChops.dulpicate from the PIL module and I get an error I don't understand:
this is the code
import PIL
import Image
import ImageChops
import os
PathDemo4a='C:/Documents and Settings/Ariel/My Documents/My Dropbox/lecture/demo4a'
PathDemo4b='C:/Documents and Settings/Ariel/My Docume... |
souen
Re : Arte +7 recorder version 5
Bonjour beudbeud,
je l'ai lancé ds le terminal comme tu me l'as dit et le programme c'est simplement ouvert...sans aucune indication.
Quand je sélectionne une émission pr l'enregistrement dans la fenêtre sous progression il est indiqué en attente...donc j'attends et rien. Alors si ... |
So I was trying to dive into Python because I want to write an Agent for the Plex Media Server. This Agent will access the MyAnimeList.net API with HTTP Authentication (more about that here) my Username and passwords work but I don't have a clue why I still get a 401 error from the server as response.
Here is some code... |
liketo be able to do is something like this:
class Root(controllers.Root):
def __init__(self):
self.customers=Customers()
class Customers(controllers.Root):
def lookup(self, custid):
'Some lookup function which will continue traversing the URL'
self.customer=Customer(custid)
class Customer(co... |
FelixP
[Résolu] ! Script pour noms de musique
Salut à tous ! J'ai une petite question à vous poser… (Eh oui !)
Je cherche un script pour me créer un fichier avec la liste des noms des musiques qui sont dans un dossier donné, avec la syntaxe de Wikipédia (histoire de remplir ses serveurs de données !) en sachant que les... |
I am playing with Python's logging system. I have noticed a strange behavior while removing handlers from a Logger object in a loop. Namely, my for loop removes all but one handler. Additional call to .removeHandler removes the last handler smoothly. No error messages are issued during the calls.
This is the test code:... |
I had solved that interpolation task I was working on previously, by the way. I post my approach here, in case someone finds it useful.
If the bad pixel regions are big, standard methods of interpolation are not applicable. Interpolation works under assumption that the regions are contiguous, whereas this is not necess... |
I would like a table with rational indexes - thus it would be practical to use a dictionary, which, in Mathematica are implemented with the indexed variables. I would like to be able to do:
...
If[a[1/2] is defined, a[1/2] = a[1/2] + 1, a[1/2] = 1]
...
If[a[4568/8746] is defined, a[4568/8746] = a[4568/8746] + 1, a[4568... |
Download
FREE PDF
The DZone Refcard #43 is an introduction to system high availability and scalability terminology and techniques (http://refcardz.dzone.com/refcardz/scalability). The next logical step is the scalable handling of massive data volumes resulting from having these powerful processing capabilities.
This Re... |
Can anyone give me example about shell sort? I'm a new person in here who must learn about shell sort, but first I must find a Java shell sort example. I found one example in Google but it's too difficult.
Have you tried reading the wikipedia article first here? It provides a pretty good basics with illustration and ex... |
Liraz Siri - Tue, 2011/06/14 - 11:14 - 6 comments | Latest by Jtvfrynt
If you like using a single getter/setter function for your properties, watch out if using None for the default. If you do that you won't be able to set your property to None!
Example code and workaround...
class CantSetNone(object):
def __init__... |
memcached is nice and framework-agnostic, and you just have to write a bit of code to interact with it. The general idea of memcached is:
object = try_memcached()
if not object:
object = real_query()
put_in_memcached(object)
That will likely be done in your SQLAlchemy abstraction, in your case. Since I'm unfam... |
The REST of the Web
Pages: 1, 2
Adding Velocity to the Mix
Velocity is a templating engine I've written about before, and including a template engine with Jython makes a big difference in simplifying development.
To use Velocity with Jython, we'll need to add a few more .jar files to Jetty's ext directory: log4j, Veloc... |
I have two resources (Tastypie), one of which has a ToManyField field:
class SongResource(ModelResource):
class Meta:
queryset = Song.objects.all()
resource_name = 'song'
authorization = Authorization()
class AlbumResource(ModelResource):
songs = fields.ToManyField('core.api.SongResource... |
Unlike some other devices the Raspberry Pi does not have any analogue inputs. All 17 of its GPIO pins are digital. They can output high and low levels or read high and low levels. This is great for sensors that provide a digital input to the Pi but not so great if you want to use a sensor that doesn’t.
For sensors that... |
Ras'
Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4]
Hors ligne
ljere
Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4]
voici le code
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# auteur Gabriel Pettier
# license GPL V3 or later
# sert uniquement a compter le... |
I have an old wireless adaptor that I used to use in Ubuntu until it seemed like it was no longer supported, I can't remember exactly when, but think it was around 10.10 Maverick.
I have just dug it out as my children's laptop wireless card has gone kaput.
My old usb wireless card is not seen by Network-Manager.
Doing ... |
I'm fairly new to this so please bare with me!
I recently installed pyusb for this project, which is trying to attempt at writing to a USB LED Message Board and received this error:
AttributeError: 'module' object has no attribute 'backend'
I don't know why this is, I checked the pyusb module files and it clearly has a... |
Topic: iRedMail in jail?
Do iRedMail is working in jails?
----
Urgent issue? Pay iRedMail developer to solve it remotely at $39.
Works on Red Hat Enterprise Linux, CentOS, Debian, Ubuntu, FreeBSD, OpenBSD
You are not logged in. Please login or register.
Do iRedMail is working in jails?
----
Sorry, you didn't explain cl... |
I'm trying to integrate my Python/GTK3 app with Ubuntu's messaging menu and every time I try to import "indicate" (python-indicate) my app crashes, with the following traceback:
/usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' fail... |
Following this official tutorial I've coded this:
#! /usr/bin/env python
from mongoengine import *
connect('tumbleblog')
class User(Document):
email = StringField(required=True)
first_name = StringField(max_length=50)
last_name = StringField(max_length=50)
class Comment(EmbeddedDocument):
content = StringField(... |
11 Sep 2014
I'm relatively new to the Rails community. I come from the Python/Django world, but I've been enjoying the transition, except for one minor part; Models.
When I dig around looking for info on how to structure my code, I keep running into Best Practices that advocate for a skinny controller/fat model pattern... |
pontiac76
[résolu]Google Ok mais pas internet avec Ubuntu 12.04
Bonjour,
J'ai posté hier un message à propos de mon impossibilité d'aller sur internet sauf sur sur google avec mon installation toute neuve d'Ubuntu 12.04 LTS sur un second disque dur de mon pc fixe.
Devant l'absence de réponse, j'ai relu les règles du fo... |
mastergb
Vpnautoconnect 2.X(Nouvelle version ,bugs, demande d'aide: c'est ici!)
Bonjour à tous,
Suite à l'énorme thread précédent (et à la demande de ljere) , j'aimerais reprendre un sujet vraiment dédié a vpnautoconnect.
Le logiciel n'est plus à présenter. On l'aime (ou pas), il permet entre autre de répondre à une la... |
I don't care what the differences are. I just want to know whether the contents are different.
The low level way:
from __future__ import with_statement
with open(filename1) as f1:
with open(filename2) as f2:
if f1.read() == f2.read():
...
The high level way:
import filecmp
if filecmp.cmp(filename1, f... |
We have two applications that are both running on Google App Engine. App1 makes requests to app2 as an authenticated user. The authentication works by requesting an authentication token from Google ClientLogin that is exchanged for a cookie. The cookie is then used for subsequent requests (as described here). App1 runs... |
I have a production server running, and a local development one (this one uses the simple runserver, etc.).
I was planning on using Django's built in "dumpdata" command in order to create backups of the database every so often. Sadly, I can't seem to get "loaddata" to take in what "dumpdata" provides it.
On the product... |
"Writing a Fault-tolerant Database Application using MySQL Fabric"with
MySQL Fabric 1.4.2 Release Candidate, some changes to the application are required. In the previous post, we used MySQL Fabric 1.4.0 Alpha and many changes have been made since this version. We can find an updated version of the application here:
Up... |
exe_Data = {
'e' : 0.124167,
't' : 0.0969225,
'a' : 0.0820011,
'i' : 0.0768052,
}
The above code creates a dictionary called 'exe_Data'. Another way to do this is to use the built-in constructor, dict() with keyword arguments as follows: exe_Data = dict(e=0.12467, t=0.0969225, a=0.0820011, i=0.0768052)
freq =... |
The goal of sciscipy is to give an access to Scilab features inside python.
from scilab import Scilab
sci = Scilab()
x = sci.rand(20, 20)
y = x*x.transpose()
y_inv = sci.inv(y)
The function func in sci.func(x, y) can be a scilab built-in or any user defined function so that scilab libraries can be reused easily in pyt... |
Simple-to-code O(N + K*log(K)) way
Take a random sample without replacement of the indices, sort the indices, and take them from the original.
indices = random.sample(range(len(myList)), K)
[myList[i] for i in sorted(indices)]
Or more concisely:
[x[1] for x in sorted(random.sample(enumerate(myList),K))]
Optimized O(N... |
Does anyone know why I'm unable to change notification settings using pynotify?
I can create a notification, modify it (for example so it should show up in the middle of my display), and tell it to display, but it still shows up in the upper-right corner.
And if this is configurable, anyone know how to do so?
I'm runni... |
Hi I am a beginner to python programming in GIS and am trying to calculate the area of a raster. When I ran the program, I got error message below. I am also providing my code. Any help would be greatly appreciated!
import arcpy
from arcpy import env
#To overwrite output
arcpy.env.overwriteOutput = True
#Set environmen... |
This is a short introduction to the art of programming, with examples written in the programming language Python. (If you already know how to program, but want a short intro to Python, you may want to check out my article Instant Python.) This article has been translated into Italian, Polish, Japanese, Serbian, Brazili... |
Deployment recipes
There are multiple ways to deploy web2py in a production environment. The details depend on the configuration and the services provided by the host.
In this chapter we consider the following issues:
Production deployment (Apache, Lighttpd, Cherokee)
Security
Scalability
Deployment on the Google App E... |
Extrapolation is never easy. It's almost always poor, except if you have some strong assumptions about the data.
In your case, you could try it, but I don't think there's something available immediately.
I'd try:
determine the first maximum of the autocorrelation
extend your signal by shifting it with a multiple of thi... |
JSON will forever serve as a great alternative for XML, but it has a weakness: big data. This is due to a lack of support for stream processing.
iJSON allows you to interact with the incoming datastream as a standard iterator.
Example Simple Data use:
from ijson import items
f = urlopen('http://.../')
objects = items(f... |
Sarhoo
[RESOLU] Problème d'accès au gestionnaire des paquets
Bonjour,
J'ai installé ubuntu 11.04 et j'ai un problème car je ne peux pas accéder au gestionnaire de paquet.
Voici le message d'erreur :
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/fr.archive.ubuntu.com_ubunt... |
I'm trying to develop a panel plugin based on the sample provided, but am having trouble when I need to use GDK-supplied functions. I've added the following to configure.ac.in:
XDT_CHECK_PACKAGE([GDK], [gdk-2.0], [2.0])
and in my Makefile.am I use the resulting settings:
libcardapio_la_LIBADD = \ $(LIBXFCE4UTIL_LIBS) \... |
I'm using python to run an external program as follows
call("/usr/sbin/snif")
and I get
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/subprocess.py", line 480, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.6/subprocess.py", line 633, in __ini... |
I have the following in my .vimrc:
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Open NERDTree by default
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
autocmd VimEnter * NERDTree
autocmd VimEnter * wincmd p
So,
% vim file.txt
opens NERDTree and focuses the cursor in the file.tx... |
I have two classes (let's call them Working and ReturnStatement) which I can't modify, but I want to extend both of them with logging. The trick is that the Working's method returns a ReturnStatement object, so the new MutantWorking object also returns ReturnStatement unless I can cast it to MutantReturnStatement. Sayi... |
Such an approach is very complicated, and is unlikely to ever result in all your packages being the amd64 version instead of the i386 version. Only packages that actually receive upgrades will likely be changed in architecture, and probably only if no other packages not being upgraded rely on their being of the i386 ar... |
What I understand for reading the documentation is that python has a separate namespace for functions, and if I want to use a global variable in that function I need to use "global".
I'm using python 2.7 and I tried this little test
>>> sub = ['0', '0', '0', '0']
>>> def getJoin():
... return '.'.join(sub)
...
>>> ... |
If you learned object oriented programming from one of the more static languages such as C++ or Java, the dynamic nature of Ruby may seem magical and elusive. After running into the syntax dedicated to meta-programming you may have been left scratching your head or at least wondering what’s happening behind the scenes.... |
Using Lettuce and WebTest to Test Your WSGI App
Maybe I’m weird, but I don’t use Django. At my office, we’re using a home brew framework. One thing that is missing from our framework is good testing. I came from a Rails background and one thing I missed was Cucumber. Thankfully, someone was nice enough to make a clone ... |
It’s easier to ask forgiveness than it is to get permission.
- Grace Hopper
It’s easier to ask forgiveness than it is to get permission.
- Grace Hopper
Good design is as little design as possible.
- Dieter Rams
As a web developer, I have spent plenty of time designing many web pages. Many designers encourage the use of... |
On windows I have always used the "ALT+3" for creating a wonderful heart for expressing my love...
Is there a way to do this on Ubuntu?
Control-capital-u means
I use compose keys for all those special characters outside the English language. You can also type a heart with them.
System -> Preferences -> Keyboard Prefere... |
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... |
Update (May 2014): Please note that these instructions are outdated. while it is still possible (and in fact easier) to blog with the Notebook, the exact process has changed now that IPython has an official conversion framework. However, Blogger isn't the ideal platform for that (though it can be made to work). If you ... |
Mathieu11
[ VOS SCRIPTS UTILES ] (et eventuelles demandes de scripts...)
Edit admin : le sommaire renvoyant vers les différents scripts se trouve désormais sur cette page de la documentation.
Les nouveaux scripts peuvent donc être discutés ici, puis inclus dans le sommaire
J'ouvre ce sujet pour proposer a chacun de pos... |
I hope this captcha is not used anywhere.
Following is a dummy way to decode it. Basically what you need are the patterns from 0 to 9 as present in these captchas. From your examples, I have only the patterns for 0 3 4 5 7 8. Since everything is fixed on them, you know where to split each character. You also know each ... |
Python Standard Logging
by Jeremy Jones
06/02/2005
Python 2.3 introduced the logging module to the Python standard library. logging provides a standard interface for outputting information from a running application. The classic example of a logging mechanism is writing data to a text file, which is a plain old log fil... |
mao-40
Re : TBI + wiimote + ubuntu
En ce qui concerne 'gtkwhiteboard.ico', ce n'est pas l'image de calibration je pense, puisque le logiciel demande de calibrer l'écran avec les 4 coins du bureau et après cela fonctionne bien.
Ah ok, j'essaierai au demain au vidéo-projcteur.
Dernière modification par mao-40 (Le 04/02/2... |
alex2423
Plus d'accès à la TV de SFR via VLC sur le PC
Hello tout le monde,
Je fais partie de ceux qui n'ont pas de TV. J'ai juste un bel écran Dell 24" que j'utilise comme TV. Je regardais la TV avec VLC via le flux SFR.
Depuis 1 mois à peu près, je n'ai plus d'image. J'ai encore le son.
Est ce que vous avez ce meme s... |
And the method in your post doesn't work because... ?
If for some reason you really need to fiddle with the builtin FlatPage class and edit it dynamically, you can hook to the class_prepared signal:
http://docs.djangoproject.com/en/dev/ref/signals/#class-prepared
Edit
Here's how you'd do it with a class_prepared:
from ... |
The bitstring module is designed to address just this problem. It will let you read, modify and construct data using bits as the basic building blocks. The latest versions are for Python 2.6 or later (including Python 3) but version 1.0 supported Python 2.4 and 2.5 as well.
A relevant example for you might be this, whi... |
metalux
Re : [Script] Mise à jour automatique pour tous les paquets (y compris PPA)
Salut linuxm@c,
Pour la notification, Gaara est le mieux placé et a fait un travail remarquable. Le mieux est de poster sur la discussion ouverte à ce sujet:
https://forum.ubuntu-fr.org/viewtopic.php?id=1507071
j`aimerai que vous:
- ajo... |
I am using Ubuntu 13.04 which I installed few days back. I am trying to install nodejs and npm. I tried to install from command line first and then uninstalled it. Then something broke.
sudo apt-get install -f nodejs npm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Som... |
With so many solutions proposed, I'm amazed nobody's proposed what I'd consider an obvious one (for non-hashable but comparable elements) -- [itertools.groupby][1]. itertools offers fast, reusable functionality, and lets you delegate some tricky logic to well-tested standard library components. Consider for example:
im... |
kevin54
Re : [ VOS SCRIPTS UTILES ] (et eventuelles demandes de scripts...)
@yvon22
Merci cela marche bien pour mes fichiers de + 2 jours.
Mais pour garder les 3 derniers dimanches, cela est possible avec cette commande ?
Hors ligne
Fenouille84
Re : [ VOS SCRIPTS UTILES ] (et eventuelles demandes de scripts...)
Voici u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.