text
stringlengths
256
65.5k
I'm working on an attendance entry form for a band. My idea is to have a section of the form to enter event information for a performance or rehearsal. Here's the model for the event table: class Event(models.Model): event_id = models.AutoField(primary_key=True) date = models.DateField() event_type = models...
pilote [résolu] impossible d'acceder au site adobe.com bonjours, voici le problème -> Firefox ne peut établir de connexion avec le serveur à l'adresse www.adobe.com -> Opéra: Vous tentez d'accéder à l'adresse http://www.adobe.com/, actuellement injoignable... etc. a priori c'est le seul site à me faire ça ! Je ne sais ...
from datetime import datetime from time import clock t = datetime.utcnow() print 't == %s %s\n\n' % (t,type(t)) n = 100000 te = clock() for i in xrange(1): t_stripped = t.strftime('%Y%m%d%H%M%S%f') print clock()-te print t_stripped," t.strftime('%Y%m%d%H%M%S%f')" print te = clock() for i in xrange(1): t_stri...
import os from os.path import abspath, dirname import sys # Set up django project_dir = abspath(dirname(dirname(__file__))) sys.path.insert(0, project_dir) os.environ["DJANGO_SETTINGS_MODULE"] = "mysite.settings" I did that, and I still get Traceback (most recent call last): File "main.py", line 4, in <module> f...
I need to limit function execution time, so i followed Josh Lee answer try: with time_limit(10): long_function_call() except TimeoutException, msg: print "Timed out!" where long_function_call() is a selenium webdriver function that interact with a page and do some operations. def long_function_call(sel...
inconnu Re : Petit guide pour aider au choix d'un langage Encore une fois merci pour toutes ces références (j'ai déjà trois bouquins de 300 pages à m'infuser ). Bon c'est quand même passionnant, dès fois un peu complexe, mais je suis globalement assez surpris de la qualité. Pour tout dire, je ne pensais pas qu'il exist...
As per the example provided by sqlalchemy documentation to cache a sqlalchemy query we are suppose to do this from caching_query import FromCache # load Person objects. cache the result under the namespace "all_people". print "loading people...." people = Session.query(Person).options(FromCache("default", "all_people"...
A list of 1000 zeroes is created called M. A random number is picked from 1 to 1000. Each time one of these is picked, the zero in the list ( at that index ) is changed to a 1. For instance if the random number is 276 then M[276]=1. What is the average number of random numbers that must be picked to have 200 ones in th...
In my case I need to ensure the uniqueness of files via SHA1 (stored as the filename) db = pymongo.MongoClient('localhost', 27017).test gfs = gridfs.GridFS(db) # How may I create a unique index in GridFS? gfs.files.create_index([('filename', 1)], unique=True) And find the file by SHA1 if the file has already been stor...
The following is a function that should do what you want: >>> def replace(source, replacee, replacement, conditional): ... if source.find(replacee) < source.rfind(conditional): ... return source.replace(replacee, replacement) ... else: ... return source Or, if you want it less verbose: >>> def ...
I can count the number of days I know Python on my two hands so forgive me if I answer something silly :) Instead of using a dict, I thought why not use a list? I'm not sure how lists and dictionaries are implemented in Python so this would have to be measured to know what's faster. If this was C++ I would just use a n...
Finally have all of the connections wired and (more or less) tested. I’ve added LEDs to the running lights and servos (not shown) to control the couplers. Just need to add about 11oz or so to the fuel tank and put it all back together for final testing. I’ve attached a programming cable to the microcontroller board so ...
Python has a magic __getattr__ method that allows custom values to be returned: class A(object): def __getattr__(self, name): return name B = A() print B.foo # 'foo' However, calling A.foo has no similar effect, because A is not an instance. Using metaclasses, Google App Engine raises this error on instan...
#1001 Le 10/02/2014, à 13:13 daniel38100 Re : [Conky] Alternative à weather.com (3) tu m'as macher le boulot mais au moins c'un fonctionnement que j'ai compris en faite j're repris toute la fonction Recherche et RemplissageListBox j'ai juste changer def OnChercherButton(self, event): self.listVilles, self.ville...
I'm writing a log collection / analysis application in Python and I need to write a "rules engine" to match and act on log messages. It needs to feature: Regular expression matching for the message itself Arithmetic comparisons for message severity/priority Boolean operators I envision An example rule would probably be...
I'm trying to get a transaction to work in AppEngine and I'm running into problems with entity groups. My code is a bit like this: parent_obj = ClassA.all().get() def txn(): key_name = 'hash of something here' if not db.get(db.Key.from_path('ClassB', key_name, parent=parent_obj)): obj = ClassB( parent = p...
#0 Re : -1 » Les dépôts TVFreePlayer » Le 17/10/2007, à 21:13 farf Réponses : 321 Bonsoir, Bien que j'ai suivi à la lettre les instructions, j'ai un léger problème en installation : Les paquets suivants contiennent des dépendances non satisfaites : homeplayer: Dépend: vlc (>= 0.8.6) mais ne sera pas installé E: Paque...
I've read the simplejson docs and don't understand why it sometimes returns a json object with single quotes (which php can't understand) and other times returns an escaped sequence of double quotes (also not recognized in php). I could probably do regex on the output string as a bandaid, but I'd rather understand the ...
I've encountered this code from Most pythonic way of counting matching elements in something iterable r = xrange(1, 10) print sum(1 for v in r if v % 2 == 0) # 4 print sum(1 for v in r if v % 3 == 0) # 3 r is iterated once. and then it's iterated again. I thought if an iterator is once consumed then it's over and it s...
When Pythons Attack by Mark Lutz, coauthor of Learning Python, 2nd Edition In this article, I will chronicle some of the most common mistakes made by both new and veteran Python programmers, to help you avoid them in your own work. First of all, I should explain that these come straight from first-hand experience. I ea...
The error message I got was Traceback (most recent call last): File "./test.py", line 416, in <module> startup() File "./test.py", line 275, in startup writer.save(r,data) File "/home/user/project/test/output.py", line 91, in save self.save_doc(r, data, pid) File "/home/user/project/test/output.py"...
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...
Yoshiball Dépots indisponibles Une petite question au sujet des dépôts, en fait depuis quelques jours certains des dépôts se trouvant sur mon source list sont indisponible (erreur 404), je voulais savoir si ce genre de problème était temporaire ou alors si ils seront à nouveau disponible dans un certain temps, je ne m'...
I can get my ManyToManyField into a chosen widget directly by using the chosen jquery: <script type="text/javascript" src="{{ STATIC_URL }}projectx/projectx_chosen.js"></script> projectx_chosen.js: $(document).ready(function () { $('#id_sales_item').chosen(); }); This clearly indicates that my static_url is setup...
For debugging purposes, I would like to iterate over all greenlets and obtain their trace traces -- how can I do that with gevent? Basically, I would like to do the gevent equivalent of this. You can use the import gc import traceback from greenlet import greenlet for ob in gc.get_objects(): if not isinstance(ob, g...
Already many people explained about import vs from, even i wanna try to explain bit more under the hood, where are all the places it got changes: First of all let me explain: import X : imports the module X, and creates a reference to that module in the current namespace. Then you need to define completed module path ...
How Shellcodes Work by Peter Mikhalenko 05/18/2006 It's not an easy task to find a vulnerable service and find an exploit for it. It's also not easy to defend against users who might want to exploit your system, if you are a system administrator. However, writing an exploit by yourself, to convert a news line from bug ...
CyrilouGarou Création de miniatures pour dossiers d'artistes dans librairie amarok Bonjour à tous, Nous sommes nombreux à utiliser l'excellent amarok pour écouter notre zic. Amarok permet de ranger sa collection de la façon suivante (exemple de chemin pour la chanson hells bells d'ACDC) /home/cyril/Ma\ Musique/A/AC_DC/...
Having already use flat packages, I was not expecting the issue I encountered with nested packages. Here is… Directory layout dir | +-- test.py | +-- package | +-- __init__.py | +-- subpackage | +-- __init__.py | +-- module.py Content of init.py Both package/__init__.py and package/subpackage/__init__.py are empty. C...
I have an extended UserProfile model in django: class UserProfile(models.Model): user = models.ForeignKey(User, unique=True) #other things in that profile And a signals.py: from registration.signals import user_registered from models import UserProfile from django.contrib.auth.models import User def createUserProf...
I am trying to export a pandas dataframe to excel using win32. The export seems to work only when the dataframe does not include numpy datatypes. How can I convert numpy datatypes to their COM variant ? Here a reproducible example : import pandas as pd from win32com.client import Dispatch # Prepare data # data witho...
Overview I am using urlopen from the Python 2.7.1 urllib2 package to do a HTTP POST form a Windows XP machine to a remote Apache webserver (for instance the built-in web sharing of Mac OS X). The sent data contains some identifier, data and a checksum, if all data is sent the server responds with an acknowledgement. Th...
Sorbus Anki : un outil d'apprentissage des langues Je viens de découvrir Anki, application d'apprentissage de langues (licence GPL). J'ouvre ce fil simplement pour un partage d'expérience, de questions, de remarques sur l'utilisation de cette application et pour une entraide entre utilisateurs. Je note qu'un paquet .de...
Your problem is actually Eclipse. Assuming that you use PyDev, I was able to reproduce the problem. When entering something in the Eclipse console, the problem occurs as described in your question. But when directly executing the very same script with the Python 3.1.1 interpreter, inputted does not include a newline ch...
#1001 Le 25/04/2010, à 17:05 oGu Re : [ VOS SCRIPTS UTILES ] (et eventuelles demandes de scripts...) Bonjour à tous ! Tout d'abord félicitations pour l'excellente tenue de ce forum et pour tous les scripts que j'ai piqué sur ce topic!! Etant passé de Firefox à IceCat dernièrement, j'aimerais qu'un Ubuntero sachant scri...
Trudy Résolu ! Ouvrir fenêtre Dépôts Bonjour, Je voudrais savoir comment ouvrir la fenêtre Dépots, si je ne l'ai pas dans Système-Aministration ... Merci pour vos réponses ! Dernière modification par Trudy (Le 04/12/2005, à 15:57) Hors ligne Express Re : Résolu ! Ouvrir fenêtre Dépôts Ca s'appel "Gestionnaire de paquet...
I have a dictionary dict2 which I want to iter through and remove all entries that contain certain ID numbers in idlist. dict2[x] is a list of lists (see example dict2 below). This is the code I have written so far, however it does not remove all instances of the IDs (entry[1]) that are in the idlist. Any help? dict2 =...
O'Reilly Book Excerpts: Gaming Hacks Gaming Hacks for Geeks, Part 2 by chromatic Editor's note: Last week, in part one of this two-part series of hack excerpts from Gaming Hacks, author Simon Carless showed you how to write your own MMORPG macros. This week, Simon is back, giving you the hacking tools you need to creat...
In my application, I use two buttons: One for START recording of RS422 link messages and one for STOP the record. The first time, the application runs correctly : Creation of a .txt file with the messages. The second time, when I click on the START button, a new . txt file is created but, now, messages are recording in...
Not able to launch a bottle.py server using an EC2 Ubuntu Linux 12.04 instance with a public IP address. The program (hw.py) is from the bottle tutorial ie. from bottle import route, run @route('/hello') def hello(): return 'hello world' run(host='xxx.xxx.xxx.xxx', port=80) Run as: > python hw.py or > sudo python ...
I have a bunch of albums that I need to delete from Picasaweb. Is there a way to do this, or do I have to go through them one at a time to delete them? You could use the Google Command Line tool. You would have to create a batch file to delete multiple albums by name. Or try typing in part of an album name as a wildcar...
I am looking for a function in Numpy or Scipy (or any rigorous Python library) that will give me the cumulative normal distribution function in Python. This is for Black Scholes option pricing. I can program it myself but it is a (decent) approximation and I'd like to test if there's something (even) better as as I sti...
I have a function called gett(int) that returns a series upon every call. It works fine when I write like this : print gett(0) print gett(1) and so on.. but when I try to automate same in a for loop like this : for a in range(28): print gett(a) It works fine for only first value and I get following output: [..seri...
Python wrapping method invocations with pre and post methods This my Answer to the stackoverflow question: Python: wrapping method invocations with pre and post methods: You could just modify the A instance and replace the p1 function with a wrapper function: def wrapped(pre, post, f): def wrapper(*args, **kwargs):...
degolarson RESOLU connexion ok mais ouverture pages web lente ou imopssible bonjour j'ai déjà posté ici : http://forum.ubuntu-fr.org/viewtopic.php?id=21092 mais le pb était peut être un peu différent quand je tape une recherche dans Google ou bien dans ma barre personnelle d'onglets l'ouverture de la page est souvent l...
1. Empezando 8.2 Git y Otros Sistemas - Migrating to Git Migrating to Git If you have an existing codebase in another VCS but you’ve decided to start using Git, you must migrate your project one way or another. This section goes over some importers that are included with Git for common systems and then demonstrates how...
gmli Cerise 0.8 - TPE, freelances, artisans Hello, je me suis dit qu'une petit présentation pourrait intéresser du monde ici. Je viens de sortir aujourd'hui la version 0.8 de mon petit soft de gestion d'entreprise (cf. l'article sur le blog http://leblog.cfait.fr/post/2008/09/07/Cerise-08) Vous pouvez trouver une liste...
nknico Un nouveau dépôt officiel pour Ubuntu (logiciels commerciaux) Un nouveau dépot officiel vient d'ouvrir. Il contient des logiciels commerciaux. Pour l'instant Opéra et Realplayer sont disponibles. En gros, pour l'installer, il faut: * Activer les mises a jour de dapper * Mettre a jour sa dapper :-) * Via gnome-ap...
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...
You are almost always better off testing the behavior of the kind of item you want rather than explicitly testing for type. In your case, I'd simply try to get the desired item by index first and catch TypeError to check by name. def __getitem__(self, key): try: return self.this_list[key] except TypeErr...
Alex0000 Déconnexion sur Batterie [Samsung] Bonjour à tous J'ai un problème récurrent avec mon wifi quelque soit l'os ou la version de celui-ci. Après un petit temps sur batterie ( entre 5min et 1h) il se déconnecte de plus le gestionnaire de connexion ne montre plus aucun wifi. Sur Windows, l'outils de résolution de p...
There are two things going on at once in my application. A timer fires off a request to update a data grid every few seconds in a background thread. Here is the code that is run by that thread: // Query var qryPickupRequests = from pr in objDataContext.pickupRequests .Include("toLoca...
Courtesy Card Usage Hello all, It has been requested that all the libraries review the use of courtesy cards when it comes to helping patrons. Magrath Circulation has a courtesy card with $10 in value in our locked key box. This value is reset to $10 at the beginning of every month. When to use this card to help patron...
jit.gl.mesh then gaussian blur over it using jit.gl.imageunit Hi, I’m always a bit lost with openGL: 1 – I create some points* using jit.gl.mesh, like in the jit.gl.mesh.maxhelp, using ‘draw_mode points’ (So i can see theses points using jit.gl.render) 2 – Then i want a gaussian blur on theses points, using the openGL ...
This program has been disqualified. Author Rekrul Submission date 2011-07-14 15:36:15.446097 Rating 7682 Matches played 1390 Win rate 74.82 import random SIZE = 5 WEIGHT_FACTOR = 6. class HistoryNode(object): def __init__(self, parent=None): if parent is not None: self.depth = parent.depth + 1 ...
I've been trying to fix this problems for a few hours already, I cannot manage to get SQLAlchemy working (it was working untill I put the two new functions, User and Registration) from flask.ext.sqlalchemy import SQLAlchemy from . import app from datetime import datetime db = SQLAlchemy(app) class PasteCode(db.Model): ...
lukophron [python]Monsieur Cinéscript Salut, Suite à une demande, j'ai pondu un script python pour mettre à jour la liste des films trouvés sur le topic-jeu Quel film c'est ? Ça tourne, ça remplit son objectif (et son deuxième objectif qui était de me remettre à apprendre Python ^^) Maintenant, il y aurait mieux. Je po...
tekman54000 Synaptic et apt-get... salut a tous, depuis quelques temps je me suis rendu compte que mes depots me renvoyaient beaucoup d'erreur, voici le code: sudo apt-get update Ign http://distrib-coffee.ipsl.jussieu.fr breezy Release.gpg Ign http://distrib-coffee.ipsl.jussieu.fr breezy Release Réception de : 1 http:/...
Here is my server side code for my blobstore uploading command line application: public class UploadServlet extends HttpServlet { private static final Logger log = Logger.getLogger(UploadServlet.class.getName()); private final BlobstoreService bs = BlobstoreServiceFactory.getBlobstoreService(); protected vo...
jegougou Re : [Info] Installation du driver Libre ATI Radeon j'ai suivis ton conseil voila le resultat 4294 frames in 5.0 seconds = 858.715 FPS 4254 frames in 5.0 seconds = 850.774 FPS 4190 frames in 5.0 seconds = 837.903 FPS 3269 frames in 5.0 seconds = 653.660 FPS 4400 frames in 5.0 seconds = 879.915 FPS 4398 frames ...
hlou [Résolu]Xubuntu echec du traitement des paquets Bonjour, J'ai installé xubuntu 12.04.1 et à par les mises à jour systemes, je ne peux plus rien installer via la logithèque ou synaptic. Le téléchargement de paquets se lance et au bout de quelques minutes, un message me dit "échec de traitement des paquets :l'instal...
I'm a little stuck with the following approach: I have file that looks a little like XML but actually isn't: <VERSIE>1.0</VERSIE> <REEKS>WWDP1028-3,DWP HOGELIJK,</REEKS> <PROFIEL>WWDP1028-3_1139,PROFIEL_1139,20111019,0.00,NAP,ABS,2,XY,117351.33,465934.80, <METING>99,999,117351.33,465934.80,-3.13,-3.13,</METING> <METING...
PHP multichild — 2014-04-24T07:15:23-04:00 — #1 Hi all, I am creating a contract database, and in the bit I am at now, the users are being created and they also need to be connected to the corporations that have already been created. The form I have is i am using the same form to add and then if needed edit the users, ...
I'm using chaco and traits.api to do an interactive plot. I can select some points in the plot, and do some calculus. Now I need update my initial plot, but I don't know how to do (I need add points). Thanks This is the code import numpy as np from enable.component_editor import ComponentEditor from traits.api import H...
I have a number of JSON files to combine and output as a single CSV (to load into R), with each JSON file at about 1.5gb. While doing a trial on 4-5 JSON files at 250MB each, I get the following error below. The code works when I only use 2-3 files but chokes when the total file sizes get larger. I'm running Python ver...
I've been trying to fit an exponential to some data for a while using scipy.optimize.curve_fit but i'm having real difficulty. I really can't see any reason why this wouldn't work but it just produces a strait line, no idea why! Any help would be much appreciated from __future__ import division import numpy from scipy....
McPeter Re : Un 'autre' générateur de sources.list en ligne Je viens de rectifier le soucis sur le nom du fichier bash. Par contre je ne vois aucun soucis à l'exécution :\ pourrais tu me dire quel navigateur tu as utilisé et quel message d'erreur ça te renvoit ? (un copié/collé du message) le chmod +x est inutile là pu...
Databases hieronymus — 2012-08-28T07:37:17-04:00 — #1 Hi, I have a python script that executes 3 queries in 2 transactions on a MySQL database. Today I added an index to one of the used tables to resolve speed issues reported by the slow query log. The problem is that the script fails quite fast since this change. It r...
My code is like follows, but when it runs it throws an error. search_request = urllib2.Request(url,data=tmp_file_name,headers={'X-Requested-With':'WoMenShi888XMLHttpRequestWin'}) #print search_request.get_method() search_response = urllib2.urlopen(search_request) html_data = search_response.read() the error is: Traceb...
I am using the experimental blobstore file API to write a CSV file containing some event data. There's a lot of data so I'm batching up the writes. My code is running in a backend so I have lots of time but I'm running out of memory, and I don't understand why. Here's the code: from __future__ import with_statement fro...
I have a python MySQLdb wrapper for executing the query. Whenever I execute a query containing a '%' symbol in a string field using this wrapper, I get a TypeError. class DataBaseConnection: def __init__(self,dbName='default' ): #set dbDtls={} dbDtls=settings...
JavaScript maya90 — 2013-04-21T22:01:22-04:00 — #1 how would I sort this array so the member with the highest points prints first? <font face='Courier New'> var members = [{ name: "stephen gupta", points: 52 },{ name: "laura kowalski", points: 67 },{ name: "John Rodriguez", points: 33 }]; </font> how ...
Audiofeeline Modifier GRUB avec GRUB CUSTOMIZER Bonjour à tous, alors que je surfais paisiblement, je suis tombé sur un article de Tux-Planet qui présente GRUB CUSTOMIZER : http://www.tux-planet.fr/grub-customizer/ Je tenais à vous en faire part car ça faisait un petit moment que je cherchais une telle solution. Bien à...
Perhaps someone more fluent in Python's Multiprocessing Pool code could help me out. I am trying to connect to several hosts on my network simultaneously (N at any one time) over a socket connection and execute some RPC's. As one host finishes, I want to add the next host into the Pool to run until all are complete. I ...
This is probably really simple. But I guess I'm too new to WSGI and Django to get it on my own. I have a brand new shiny Django project on a Ubuntu virtual machine hosted in /var/www/mysite. The project was created with django-admin startproject mysite I'm following a WSGI tutorial to get it set up, so I created an ./...
I'm looking for a clean way to do this in Python: Let's say I have two iterators "iter1" and "iter2": perhaps a prime number generator, and itertools.count(). I know a priori that both are are infinite and monotonically increasing. Now I want to take some simple operation of two args "op" (perhaps operator.add or opera...
HKH Re : Cerise 0.8 - TPE, freelances, artisans effectivement ca ne fonctionne pas avec ces identifiants...! J ai crée une entreprise nom : Ubuntu login ubuntu pass ubuntu Bon test Hors ligne j1100 Re : Cerise 0.8 - TPE, freelances, artisans Hop je m'abonne. Ça va fortement m'intéresser dans 2-3 ans quand je serai patr...
The subprocess proc inherits file descriptors opened in the parent process.So you can use os.open to open passphrase.txt and obtain its associated file descriptor. You can then construct a command which uses that file descriptor: import subprocess import shlex import os fd=os.open('passphrase.txt',os.O_RDONLY) cmd='gpg...
In my book, Practical Maya Programming with Python, I use Python’s type function for dynamically creating custom Maya nodes based on specifications, such as input and output attributes. I really love the type function*, so I thought I’d post another cool use of it. I recently wrote this gem as a way to dynamically crea...
bidou10 mise à jour de sécurité importante bonjour à tous, depuis un petit moment, j'ai une mise à jour de sécurité importante qui ne veut pas se faire, elle apparait à chaque fois décochée. j'ai essayé cette commande dans le terminal, mais je ne suis pas très fort dans ce domaine et j'aimerai avoir un petit coup de ma...
I am running into this wierd issue of randomly failing unittests. I am basically testing Syndication Feeds Here is the relevant portion of my code: class ObjectFeedTests(PuppyTestCase): def test_object_feeds(self): site = Site.objects.get_or_create(id=site_id)[0] #Some preprocessing and initializati...
#1226 Le 01/02/2012, à 15:54 cyrilmartin Re : TVDownloader: télécharger les médias du net ! et si tu ajoutes un -v à ta commande, ça donne quoi ? et si tu demandes une trace, il y a quoi dans le fichier trace (surtout à la fin) ? pluzzdl -v -p http://213.246.52.37:3129 http://www.pluzz.fr/dame-de-carreau.html [DEBUG ] ...
OK, I found better workaround! 1.install fabric in your virtualenv go to terminal and 1. workon your virtualenv name 2. pip install fabric 2. add fabric.py add a python file and named it "fabric.py" under your project root, past the code below, and change the path variables to your own from fabric.api import * import o...
Introducing Plumbum - Shell Combinators May 12, 2012 It's been a while since I last blogged... sorry! Had a midterm exam, a seminar project to deliver(an O(n^3) parser for Tree Insertion Grammar),the routine family festivities of Passover, and this new thing, Plumbum, that has been keepingmy mind overclocked while I sh...
oliver2004 problème wifi avec portable HP nx6125... Salut à tous, je viens d'installer sans trop de mal Kubuntu 7.10 sur mon portable HP Compaq nx6125 (j'ai de la chance il n'est pas tatoué...). Aparemment tout marche sur la machine... sauf le wifi... j'en ai pas besoin là maintenant mais j'en aurai sûrement besoin et ...
I have data in the form of 00 15401 7202 9303 20204 66205 129700 256 I wish to go through each line and make the value in column 1 the key and the value of column 2 the value also if the current key already exists, mathematically add the new value of column 2 to the current value of column 2. Tried this: search_result ...
I've happily implemented Grappelli for the first time. I was trying to implement the dashboard but it doesn't seem to be activating. Trouble is, I'm not sure what it looks like. The Grappelli dashboard.py is applied (generated by createdashboard) settings.py (interesting parts) MEDIA_ROOT = 'I:/xampp/htdocs/project/med...
I suppose I should expand this answer, now that I'm older and wiser and know what's going on. Better late than never. You can add a property to a class dynamically. But that's the catch: you have to add it to the class. >>> class Foo(object): ... pass ... >>> foo = Foo() >>> foo.a = 3 >>> Foo.b = property(lambda s...
I installed a cups wrapper for a printer, but it's broken. Now both the Store and Synaptic won't install or remove any packages because the "mfc240ccupswrapper" cannot be repaired or changed. I've tried to force remove it to no avail. This is the output of attempting to remove the package: Removing mfc240ccupswrapper ....
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...
In my project, I had replaced the django-development server with gevent using monkey patch and its working perfectly, So now my manage.py file look like- from gevent import monkey; monkey.patch_all() from gevent.wsgi import WSGIServer from django.core.management import setup_environ import settings setup_environ(settin...
If I enter this URL in a browser it returns to me the valid XML data that I am interested in scraping. http://www.facebook.com/ajax/stream/profile.php?__a=1&profile_id=36343869811&filter=2&max_time=0&try_scroll_load=false&_log_clicktype=Filter%20Stories%20or%20Pagination&ajax_log=0 However, if I do it from the server-...
I wrote an django app named "task", and added it to *INSTALLED_APPS*. However when I tried to call it in django shell it raised a NotRegistered expception. Detail information is below: from task.tasks import add from celery import registry # 'task.tasks.add' is registered like below registry.tasks # 'task.tasks.add': ...
So you're building a web application, and using the excellent contrib.auth subsystem to manage user accounts. Most probably you need to store additional information about your users, but how? Django profiles to the rescue! Django provides a lightweight way of defining a profile object linked to a given user. The profil...
The internet has been ablaze with posts on NodeJS, to some people's joy and to others chagrin. Some have claimed that Node solves a long standing problem in concurrency, saying: People are starting to build more on Node.js because it’s superior and it solves these problems that have always existed. I/O has been done wr...
Maisondouf Re : Postfix est en train de me rendre fou ... Pourtant à première vue, ce que tu veux pouvoir gérer n'est pas spécialement complexe mais je ne sais peut-être pas tout. ASUS M5A88-v EVO avec AMD FX(tm)-8120 Eight-Core Processor, OS principal Precise 12.04.1 LTS 63bits½ Bricoleur, menteur, inculte, inadapté s...
Is it better to do from pymongo import Connection conn = Connection() db = conn.db_name def contrivedExample(firstName) global db return db.people.find_one({'first-name': firstName}) or from pymongo import Connection def contrivedExample(firstName): with Connection() as conn: return conn.db_name.pe...
nicky940 Re : Generateur de sources.list en Francais bonsoir je suis un nouvelle utilisateur d'ubuntu l'installation c'est dérouler a merveille version 9.10 jai depuis quelque temps un problème avec les mise jour qui m'indique un sens interdit qui m'indique ce message d'erreur :un problème irrémédiable est survenu pend...
I wanted to show the current location of the user as soon as the user opens the activity. Here is what I have coded so far. package com.android.carmanager; import android.content.Context; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android....
It seems that you compare a series of scalar values to a string: In [73]: node = 'a' In [74]: deco = 'b' In [75]: data = [(10, 'a', 1), (11, 'b', 2), (12, 'c', 3)] In [76]: df = pd.DataFrame(data) In [77]: df Out[77]: 0 1 2 0 10 a 1 1 11 b 2 2 12 c 3 In [78]: cond = ((df[1] != node) & (df[2] != deco)) -...