text
stringlengths
256
65.5k
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...
If there are too few values that ​​fit on one line, I would choose to separate them by commas as exemplified by other fellows, otherwise per RFC822 standard you can split values by lines started by tabs: settings.conf: [syndication] name = Test Name title = Test Title categories = Category 1 Category 2 ...
I am trying to write a program using the Mathematica function IsotopeData, but am finding the code troublesome. Due to my (relative) familiarity with Python, I am puzzled as to how Mathematica works, as they are very different.$\require{mhchem}$ What I am trying to do, is to find the elements in a decay chain which end...
My question is: What is it that makes those languages suitable? From what I know, they are slower than other languages, and operate at a higher abstraction level, which means they are too far from the hardware. The only reason I could think is because of their advanced string manipulation capabilities, but I believe th...
pguimier Re : Qarte arte.tv browser (ex Qarte+7) @VinsS en ce moment même elles le sont, je peux les voir. J'ai testé un : rtmpdump -r rtmp://flashstreaming.cdn.arte.tv/a3974/o35 -y "mp4:geo/FR/cathedrale-sbs-logo_FR?h%3D0cbcd9807abb79b532c3a0db53b68be1" -W "http://www.arte.tv/flash/mediaplayer/mediaplayer.swf" -o "Le ...
SQL_BUFFER_RESULT creates a temporary table on the server for every result set. This is not a temporary table like CREATE TEMPORARY TABLE - it is an implicit temporary table as would be created when using a GROUP BY clause or with a subquery. As such, all the same rules apply. First, let's talk the problem that SQL_BUF...
fredajt [Résolu] Installation Tiny-erp Bonsoir, j'essaie d'installer Tiny erp 4.2 depuis trois ou quatre jours sans succès. J'ai suivi différents tutos de la documentation et du forum officiel, mais le client ne veut pas se lancer quand je fais alt+f2. Le seul message d'erreur que j'ai est : File "/usr/lib/python2.5/So...
In our Tour of Extensions today's article is about advanced tag indexing. Wehave a great data collection to play with and our goal today is to be ableto quickly find data matching a complex set of tags. So, let's find outthose lastfm tracks that are tagged as blues and rhythm and blues, forinstance. In this article, we...
Suspending Traffic for Zero-Downtime Migrations Some time ago, we had to perform a fairly intensive database migration. Since we process payments for a number of marketplaces who don’t want any downtime at all, scheduling a maintenance window to perform the migration wasn’t an option. We had to do everything without ta...
I am getting a Unicode decode error while creating unicode item in rdflib namespace $ python Python 2.7.3 (default, Sep 26 2012, 21:51:14) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from rdflib.graph import ConjunctiveGraph >>> from rdflib import Namespace, BNode, ...
Bybeu [résolu] Problème veille carte nvidia 4200 nvidia96 EDIT 27 mars 2013: j'ouvre un nouveau fil ici: http://forum.ubuntu-fr.org/viewtopic.php?id=1210781 Bonjour Mon portable 12.04 plante en sortie de veille; J'ai essayé sudo s2ram -n Machine matched entry 222: sys_vendor = 'Dell Computer Corporation' sys_...
I installed Virtualenv on Ubuntu 12.04 and was using it to work on a sample project under the unity desktop. I'm using VirtualBox and was having some issues with the unity desktop so changed to the KDE desktop. I'm now trying to create a new project but the virtualenv won't allow me to create a new environment in my pr...
Python Dictionaries A Python dictionary has the same benefit as a regular paper dictionary. It allows you to quickly locate the value (definition) associated with a key (word). Dictionaries are denoted by curly braces and contain a comma-separated sequence of key:value pairs. Dictionaries are not ordered. Instead, dict...
bleuberry Re : [astuce] Un fichier HOSTS qui combat les pubs et liens malveillants ! si sa fonctionne sur chrome Adblock ?:P Dernière modification par bleuberry (Le 22/02/2010, à 11:24) Hors ligne sergeG75018 Re : [astuce] Un fichier HOSTS qui combat les pubs et liens malveillants ! Ça fonctionne pas avec epiphany Hors...
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 dynamically assign a function to __del__ of an instance of a class so that it gets called when using dir() on that object. I need __dir__ to be unique for each instance of the class. As a stripped down example, I have tried: import types class Foo(object): def __init__(self, arg): def __dir__...
Hey everyone this code is working fine just one thing to deal with. It overwrites the multiple entries against a key. I need to avoid the overwriting and to save all those entries. Can you help me in this please? #!/usr/bin/python import sys import fileinput #trys to create dictionary from african country list dic = {}...
I'm very new to Yesod and I'm having trouble building Yesod statically so I can deploy to Heroku. I have changed the default .cabal file to reflect static compilation if flag(production) cpp-options: -DPRODUCTION ghc-options: -Wall -threaded -O2 -static -optl-static else ghc-options: -Wall -threaded -O0 And ...
I've been having trouble with my templates not updating in the Google App Engine Dev Python Server. If I leave the server running for a while, my templates will not update in the browser after I change them. My best guess is that jinja2 is caching these templates some how? I'm rendering my templates using the following...
malbo Re : [Tuto] Installation prudente de Ubuntu dans un PC UEFI Ou alors je n'ai pas trouvé comment faire... Il fallait aller dans le Bios au démarrage et sélectionner le démarrage sur le support d'installation de Ubuntu "sans" UEFI. Comme tu n'y connaissais rien en UEFI, tu as laissé démarrer le PC sur le support sa...
httplib.HTTPMessage(filehandle).getdate(headername) httplib.HTTPMessage(filehandle).getdate_tz(headername) mimetools.Message(filehandle).getdate() rfc822.parsedate(datestr) rfc822.parsedate_tz(datestr) if you have a raw data stream, you can build an HTTPMessage or a mimetools.Message from it. it may offer additional h...
I'd like to create a drop-in replacement for python's list, that will allow me to know when an item is added or removed. A subclass of list, or something that implements the list interface will do equally well. I'd prefer a solution where I don't have to reimplement all of list's functionality though. Is there a easy +...
It's probably a dumb question but I don't manage to put a sum expression in a If condition. I work on a CSV file composed of 3 rows A, B and C. Here is my code : #import and export files test = "/home/julien/excel/test.csv" file1 = open (test, 'rb') export_test = "/home/julien/excel/export_test.csv" file2 = open (expor...
Deevad [Tuto] Configurer les bouttons Wacom sous Ubuntu/Debian avec Xsetwacom Update janvier 2011: Besoin d'une documentation claire et bien écrite sur Xsetwacom ? Le contributeur présent sur ce sujet RegisBurin à rédigé la meilleure documentation existante à ce jour sur 'xsetwacom' et c'est tout en français , et elle ...
I have this problem. I'm creating an editor and I need console output(sys.stderr and sys.stdout) outputted to a textview. The problem is that when I start the console, it waits for it to quit, but I want it to catch anything and output it to the textview, so I thought that you might need different threads, but does it ...
Topic: Sender throttling with Policyd on Debian Squeeze The standard IRedMail instructions for throttling contain errors (for Debian Squeeze) and are very unclear in places (to me at least). Here's how I got it working. I'm posting this as a way of giving back and I hope it helps others. Be warned that until you do the...
How can I dump a MySQL database without using mysqldump, just by using Python including table structure? I would advise MySQLdb - it provides a MySQL API for Python. However, most probably the API does an indirect call to You might also want to check out Dump tables and data where the exact procedure to dump the table ...
You could subtract 40 from the x-values for your second functions to make the range of x-values continuous. This would give you a range from 0% to 70%. Then you can make set the tics and labes of the x-axis as follows: x_ticks = range(71, 0, 10) a.set_xticks(x_ticks) a.set_xticklabels([str(x) for x in [0, 10, 20, 30, 7...
In Generating Graphics With Piddle we generated a gantt chart using piddle and the Python Imaging Library. Now we'll extend this concept to generate graphics in real time on the Web. We'll build on the code from the previous article, making references to it as we go along. Our original script contained a hardcoded data...
Python: List checking I am trying to write a Python (2.7.3) program that would check a list to see if a the value of a placing for a list has been given or not? input = raw_input("(Enter three numbers separated by commas) >: ") input_list = input.split(" ") replacing_letters = [str(x.strip(" ")) for x in input_list] 'i...
How do I replicate the following Python code with the Python C API? class Sequence(): def __init__(self, max): self.max = max def data(self): i = 0 while i < self.max: yield i i += 1 So far, I have this: #include <Python/Python.h> #include <Python/structmember.h>...
We have a question we ask at our office during interviews that goes like this. For the sake of consistency, I am restricting the context of this to python. I'm sure there are other answers but I'm really only interested in python answers. Write me a function named say that when called like this: >>> say('Hello')('World...
goyou [Astuce] Calculatrice Numpy dans Python dans un Terminal [Résolu] Bonjour, Pour quelqu'un qui a déjà installé numpy sur son pc, l'idée est de pouvoir invoquer un terminal qui charge python et qui charge numpy automatiquement pour s'en servir comme d'une calculatrice. C'est-à-dire qu'on obtient une fenetre en lign...
Using gensim I was able to extract topics from a set of documents in LSA but how do I access the topics generated from the LDA models? When printing the lda.print_topics(10) the code gave the following error because print_topics() return a NoneType: Traceback (most recent call last): File "/home/alvas/workspace/XLING...
This question already has an answer here: There are many posts about finding the difference between two dates but the values involved start and end with different formatting than those I am using eg: a = 01/01/10 # dd/mm/yy format b = 01/01/05 # dd/mm/yy format So I am after the difference in years, months and days be...
tshirtman Re : /* Topic des codeurs [8] */ @le rouge: non, j'ai ouvert le code pour regarder l'option pour avoir un fichier wiki, hier, j'ai vu du rouge , j'ai commencé a corriger des trucs, puis j'ai été distrait, j'y suis pas retourné encore :] mais j'y pense ^^ Hors ligne Le Rouge Re : /* Topic des codeurs [8] */ Ok...
I have a historical time sequence of seafloor images scanned from film that need registration. from pylab import * import cv2 import urllib urllib.urlretrieve('http://geoport.whoi.edu/images/frame014.png','frame014.png'); urllib.urlretrieve('http://geoport.whoi.edu/images/frame015.png','frame015.png'); gray1=cv2.imread...
You can use enumerate(): for i, obj in enumerate(object_list): do_something if i == 0: do_something_else if i == len(object_list) - 1: do_another_thing But instead of checking in every iteration which object you are dealing with, maybe something like this is better: def do_with_list(object_...
You ever notice how when your script dies because of some uncaught error, you don’t get that error in your log files? This post walks through how to make sure that you log that uncaught exception. This is a trivial script that will raise an uncaught exception (code available here):     $ cat rgl/kaboom1.py     # vim: s...
I'm learning how to use pickle. I've created a namedtuple object, appended it to a list, and tried to pickle that list. However, I get the following error: pickle.PicklingError: Can't pickle <class '__main__.P'>: it's not found as __main__.P I found that if I ran the code without wrapping it inside a function, it work...
benjou Re : Aidez moi s'il vous plait pour mon projet benoit@laptop-benoit:~$ picard Traceback (most recent call last): File "/usr/bin/picard", line 2, in ? from picard.tagger import main; main('/usr/share/locale') File "/usr/lib/python2.4/site-packages/picard/tagger.py", line 73, in ? from picard import ev...
I've managed to get things done this way: query = "<feed xmlns=\"http://www.w3.org/2005/Atom\"" query += " xmlns:media=\"http://search.yahoo.com/mrss/\"" query += " xmlns:batch=\"http://schemas.google.com/gdata/batch\"" query += " xmlns:yt=\"http://gdata.youtube.com/schemas/2007\">" query += "<batch:operation type=\"qu...
I am having trouble displaying the correct message when file is sucessfully uploaded. What happens is that when a file is successfully uploaded, for a split second it displays the success message but then suddenly it changes to the cancel message. My question is that if a file is successfully uploaded, I want the the s...
I'm using PyAudio under the Enthought Python Distribution (Python 2.6.6) in Ubuntu 10.10 x64. >>> import pyaudio >>> pa = pyaudio.PyAudio() >>> pa.get_default_input_device_info() Traceback (most recent call last): File "<pyshell#24>", line 1, in <module> pa.get_default_input_device_info() File "/usr/lib/python_...
Dernière news : Fedora-Fr aux 15èmes Rencontres Mondiales du Logiciel Libre La version bêta de Fedora 17 alias "Beefy Miracle" est à présent disponible. Même si, habituellement, les versions bêta sont déjà relativement stables, n'oubliez pas qu'il s'agit d'une version de développement. Et comme toute version de dévelop...
Ah well, if you're forced to keep that clunky data structure, you can't expect much. The one-liner equivalent of your first solution is going to be something like: def samplesof(requested_cond, conditions): return next(s for c, s in conditions if c==requested_cond) and for the second one, if you insist on one-line...
vallkin Problème wacom MTE-450 sous 12.04 Bonjour à tous, je suis utilisateur occasionnel de Linux depuis la 8.04, et ai décidé de migrer définitivement vers Linux à l'achat de mon prochain PC (berk pas Windows 8). Cependant quelques obstacles viennent encore s'opposer à moi. En effet, étant professionnel, j'ai un beso...
I'm trying to use python's Regular expression package re from within C++, within boost.python code. Here is an example code snippet in my C++ application: #include <boost/python.hpp> Py_Initialize(); object main = import("__main__"); object main_namespace = main.attr("__dict__"); object ignored = exec( "import ...
Is there a more concise, efficient or simply pythonic way to do the following? def product(list): p = 1 for i in list: p *= i return p EDIT: I actually find that this is marginally faster than using operator.mul: from operator import mul # from functools import reduce # python3 compatibility def wi...
I have a fresh centos 6.2 with mysql in 5.1.52. Then I saw two empty user name and I deleted that then I saw 3 root user deleted that and created one like this CREATE USER 'root'@'%' IDENTIFIED BY '**';. But when I go in as root into my phpMyAdmin now I cannot create a new database. What wrong did I do here? I have a f...
Pierre Thibault Comment fonctionnent les pipes et les commandes shell avec Python Bonjour, J'ai de la difficulté à comprendre comment les redirections fonctionnent avec les commandes shell et Python. Par exemple, si dans un shell bash je tape: aa | bb Si je tape la commande précédente, cela veut dire que la sortie de l...
while saving an entity that has reference properties, is it the app's responsibility to check that the entities referred to by the reference properties already exist in the datastore? While unit testing with the datastore_v3_stub, I find that app engine will happily save a entity A that has a reference property B assoc...
I'm trying to add a dynamic number of pictures to an element called "component". Looking around I've created this code: component.rb class Component < ActiveRecord::Base has_many :images accepts_nested_attributes_for :images, :allow_destroy => true end image.rb class Image < ActiveRecord::Base attr_accessi...
This answer comes from Steven Bethard on Google groups. I'm reposting it here to make it easier for people without a Google account to access. You can override the default behavior of the error method: import argparse import sys class MyParser(argparse.ArgumentParser): def error(self, message): sys.stderr.w...
gnomeprint.ui.FontPreview — FontPreview object for GnomePrintui class gnomeprint.ui.FontPreview(gtk.Widget): gnomeprint.ui.FontPreview() def set_color(color) def set_font(font) def set_phrase(phrase) +-- gobject.GObject +-- gtk.Object +-- gtk.Widget +-- gnomeprint.ui.FontPreview gnomeprint.ui.FontPrevi...
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...
Cover Book Actions Average wait: 40d, 2h USA Today Bestselling BookDanger signs rise off Jase Kayrs like steam--the scars, the secrets, the strength. He's got a mission, and he's not interested in much outside of it. Except Brenna Dunne.Brenna was an ass-kicking,... <a class="more" href="/books/detail/B00CLSVNQE/#edito...
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...
For some background, this code is part of a larger script. I'm currently using the .boto config file for my creds. I am able to list all buckets using the boto API call as well as create buckets, however, this section of code is giving me some problems, and it looks spot on (the code itself was actually working in a pr...
I've split the problem into sub problems... The test to check it is all working as expected: # These are the two lists I want to pair a = [ "apples" , "oranges" , "bananas" , "blueberries" ] b = [ "apples" , "blueberries" , "oranges" , "bananas" ] # This is the expected result expected = [ (0, 0...
I've written a small plugin that does this. Put this code under "Packages/User/BatchTabToSpaceFixer.py": import sublime import sublime_plugin class BatchTabToSpaceFixerCommand(sublime_plugin.TextCommand): def run(self, view): self.run_all_views() # self.run_current_view() def is_enabled(self): ...
bisk8 Re : [HOW TO] adesklets : configuration des desklets Bonjour, Alors la je commence a désespérer avec le adesklets: volume.py C'est le seul que je n'arrive pas a faire marcher, tous les autres sont ok. Lorsque je le lance en test python ./chemin/du/script/volume.py --nautilus puis touche t il se lance, n'est pas ...
I don't have an answer regarding CEF, but I had a look at two solutions to package an HTML based desktop app inside a native looking window: Using PySide with Flask is quite easy, just add the following script close to your Flask app.py file and it should work directly: import os, urllib, sys, time, json # import PySid...
raspouillas Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] Je ne faisait aucune allusion au problème de @souen. Dernière modification par raspouillas (Le 15/06/2012, à 20:37) ljere Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] alors voici la première partie du ...
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 am also working in python 2.6 and i want to send SMS to a mobile while my cell phone i.e. Nokia E-72 is connected to PC via Data Cable. The mobile is connected through a serial port and the code prompts the correct port as well and there is no error in the code but still the message is not being sent... Please help m...
I've written a function that should return a list of column numbers that correspond to specific variables I'd like to extract later on from a csv file. The variable names are specified by state_aggregate_vars. import csv import numpy def compute_countyStats(state_aggregate, year, state_aggregate_vars, listCounties, cou...
This is not homework! Simply example to complex problem. Right now I take arrays, create vectors, then use equation with vectors as inputs. Everything works fine. But, wondering if I could skip vector creation and use the array slicing to the samething. import numpy as np a = [[ 7., 5.], [ 9., 3.], [ 7., 2.], [ 7., ...
If d = date(2011, 1, 1) is in UTC: >>> from datetime import datetime, date >>> import calendar >>> timestamp1 = calendar.timegm(d.timetuple()) >>> datetime.utcfromtimestamp(timestamp1) datetime.datetime(2011, 1, 1, 0, 0) If d is in local timezone: >>> import time >>> timestamp2 = time.mktime(d.timetuple()) >>> datetim...
Using SAX for Proper XML Output In an earlier Python and XML column I discussed ways to achieve proper XML output from Python programs. That discussion included basic considerations and techniques in generating XML output in Python code. I also introduced a couple of useful functions for helping with correct output: xm...
Eric_P Re : TuXtremsplit - Recoller vos fichier .xtm PPPFFFFF !!!! Que n'y ai-je pensé avant, je ne t'aurais pas dérangé. En tout cas merci beaucoup, ça roule maintenant. Super logiciel, merci pour ton travail. Cordialement. Éric. Hors ligne cheetah Re : TuXtremsplit - Recoller vos fichier .xtm @wido Bonjour, je m'adre...
Fabric: a System Administrator's Best Friend The Basics Now that you understand the groundwork of Fabric, you can start puttingit to use. For this article, I explain how to make asimple fabfile for the purpose of installing/removing software and yourmachines. First, you need what is called a fabfile. The fabfilecontain...
Here's my data model: BlogPost(ndb.Model): title = ndb.StringProperty() body = ndb.TextProperty() author_key = ndb.KeyProperty() Author(ndb.Model): name = ndb.StringProperty() fav_colour = ndb.StringProperty() I am currently on my home page ('/'), and I would like to: query for a list of all BlogP...
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 have the following problem: A mail server, sends emails with rate $7.5/\text{hour}$. What is the probability that it will send exactly $5$ emails in one hour? To solve it, I did the following using a Poisson distribution: $$\frac{7.5^5 e^{-7.5}}{5!}$$ or with sage math: def dpoi(x): return (7.5^x * (e^-7.5)) / fact...
Your posted code had a few minor typos in it (firstame="bob" in data vs. firstname="bob", lastname vs. last), but after cleaning them up, it looks pretty good. If you print out the result, you get: ['firstname', 'bob', 'lastname', 'stewart', 'dob', '2010-0206', 'hobbies', 'reading, singing', 'drawing', 'is_minor', 'T...
I want to run a mysql command and set the output of that to be a variable in my python script. Here is the shell command I'm trying to run: $ mysql my_database --html -e "select * from limbs" | ./script.py Here is the python script: #!/usr/bin/env python import sys def hello(variable): print variable How would I a...
If you're just asking how to tile four images together into a larger image, this is easy to do with most image-processing libraries. I'll show how to do it using PIL/Pillow: import sys from PIL import Image width, height = int(8.27 * 300), int(11.7 * 300) # A4 at 300dpi images = sys.argv[1:] groups = [images[i:i+4] for...
JavaScript stevenhu — 2012-09-21T16:02:46-04:00 — #1 I am trying to delete a row in a database via external JS, but don't think the syntax is right. What I have right now is my best guess as to what it should be. The database rows show an ID, filename, and title (context: a bookmarked or favorite page), and when a quer...
Very occasionally, I write code where I’m given an object of some class (usually from a library call), but I wish to use additional methods on that class as though they had been defined there. In some languages (Objective-C shines in this regard with categories), you can do this very naturally. In Python, most people p...
Názory k článku Perličky: úvod do referencí mach(neregistrovaný) ve článku nikdo nikoho nenutil se něco učit. Tento jazyk byl vymyslen člověkem z praxe pro lidi, řešící praktické věci. V žádném případě není výlupek ctností a akademické krásy - na druhou stranu, zatím co v jiných jazycích dokončujete ještě deklarace, ta...
My apologies if this has been asked before. My impression is that in numpy, 2 arrays can share the same memory. Take the following example: import numpy as np a=np.arange(27) b=a.reshape((3,3,3)) a[0]=5000 print (b[0,0,0]) #5000 #some tests: a.data is b.data #False a.data == b.data #True c=np.arange(27) c[0]=5000 a.dat...
In a certain way, you can see some of the operator function as these as well. For example, operator.itemgetter() works this way: import operator get1 = operator.itemgetter(1) # creates a function which gets the item #1 of the given object get1([5,4,3,2,1]) # gives 4 This is often used e. g. as a key= function of sorti...
I have the same question as this poor app engine developer: https://groups.google.com/group/google-appengine/browse_thread/thread/f7a44b707119013c/81ba15c883ba95fe My json serialization crashes when it hits the binary data for the png image (0x89) in my model. I don't need to serialize this data so I'd either like to s...
mars Connaissances de base pour Kubuntu Bienvenue à tous les lecteurs. Ce sujet a pour but d'apporter les connaissances de base à toute personne débutant sous Kubuntu. Il est très bon pour tout débutant de lire ce post, mais il est aussi très conseillé aux personnes plus expérimenté, car il contiendra des conseils de b...
Module ParseBlastTable source code A parser for the NCBI blastpgp version 2.2.5 output format. Currently only supports the '-m 9' option, (table w/ annotations). Returns a BlastTableRec instance reader_keywords = {'BLASTP': 'version', 'Database': 'database'... __package__ = 'Bio.Blast' reader_keywords Value: {'BLASTP':...
From PEP 328, http://www.python.org/dev/peps/pep-0328/#rationale-for-relative-imports you should actually avoid naming a python module starting with a "dot" because it means relative imports in Python. If you really insist on doing so, you can but you will have to use the imp module. Example usage:- import imp with ope...
Expect4r – Interact with Cisco IOS, IOS-XR, and Juniper JUNOS CLI. Expect4r is a library that enables a ruby program to 'talk' to routers following a written ruby script. You talk to routers by connecting to them using ssh or telnet and send exec or config command and collect router output than can be parsed using ruby...
A friend and I have been playing around with pygame some and came across this tutorial for building games using pygame. We really liked how it broke out the game into a model-view-controller system with events as a go-between, but the code makes heavy use of isinstance checks for the event system. Example: class CPUSpi...
We seem to have a tradition of using the Homestar Runner character 'Trogdor the Burninator' to request tag deletion. I thought we could use crisper images, so I made my own. >:) Request: Burninated: BONUS: The above were made using a Trogdor reference from an unknown person on the internet, which has some inaccuracies....
First, you will need the Color class from Gdk and the Gtk class: from gi.repository import Gtk from gi.repository.Gdk import Color Then, in your handler, change the foreground color of the text field: COLOR_INVALID = Color(50000, 0, 0) // A dark red color text_field.modify_fg(Gtk.StateFlags.NORMAL, COLOR_INVALID) If ...
Currently I have the following code: class User(db.Model): field_names = db.StringListProperty(indexed=False) field_values = db.StringListProperty(indexed=False) field_scores = db.ListProperty(int, indexed=False) def fields_add(user_key_name, field_name, field_value, field_score): user = User.get(user_k...
raspouillas Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] Je ne faisait aucune allusion au problème de @souen. Dernière modification par raspouillas (Le 15/06/2012, à 20:37) ljere Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] alors voici la première partie du ...
Because I added "Add Key" yesterday, today I wanted to be symmetrical, so I added "delete keys". This turned out to be much more work. First, I ended up creating another quickly.prompt, and then I had to dive into the internals of CouchGrid, and also do some hair raising mucking with desktop couch. quickly.prompts.chec...
I'm trying to follow PEP 328, with the following directory structure: pkg/ __init__.py components/ core.py __init__.py tests/ core_test.py __init__.py In core_test.py I have the following import statement from ..components.core import GameLoopEvents However, when I run, I get the following error: tests$ python core_te...
ljere Re : Live Voyager 12.10 merci pour les précisions c'est vraiment cool je plains rodofr si il veut intégrer tout ça Hors ligne metalux Re : Live Voyager 12.10 Le repos aura été de courte durée, qu'est-ce qu'on peut dire des C.....quand on a un coup de barre! Quelqu'un a testé ce que j'ai exposé au post #314? De mo...
JavaScript todd_temple — 2014-01-09T11:07:17-05:00 — #1 I have a page shown here that uses a modified PrettyPhoto gallery. The modification is for it to show a thumbnail view of the other images within the same gallery along the bottom of the overlay image. Works well for me, but the client is unhappy about the small s...
Past midnight and maybe someone has an idea how to tackle a problem of mine. I want to count the number of adjacent cells (which means the number of array fields with other values eg. zeroes in the vicinity of array values) as sum for each valid value!. Example: import numpy, scipy s = ndimage.generate_binary_structure...
This is what I came up with to calculate all subsets of length 0, 1, ... , n of a set of length n with doubling single elements. Difficult to describe... def subsets(seq, *args): seqstart = [[seq[i] for i in args], ] if len(args) == 0: for i in range(len(seq)): seqstart += subsets(seq, i) ...
I am trying to run rpart through RPY2 using Python 2.6.5 and R 10.0. I create a data frame in python and pass it along but I get an error stating: Error in function (x) : binary operation on non-conformable arrays Traceback (most recent call last): File "partitioningSANDBOX.py", line 86, in <module> model=r.rpar...