text
stringlengths
256
65.5k
What is wrong? Please,somebody says me,what I have to write instead of application/x-abiwordAbiWord. Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> f=open('a.abw','r').read() >>> from lxml import etree >>> doc=etree...
I have a function that returns information in seconds, but I need to store that information in hours:minutes:seconds. Is there an easy way to convert the seconds to this format in python? or you can do >>> import datetime >>> str(datetime.timedelta(seconds=666)) '0:11:06' By using the m, s = divmod(seconds, 60) h, m =...
I'm fairly new to python (and completely new to Python OO), but I'm working with a fairly complicated class that I'm struggling to understand but that I need to edit. To help understand what's going on I'm trying to pull data out of an object but everything I do is just returning "classname object at address". Could so...
After working on some test code for open ID authentication, I had a break and when I came back, found myself faced with this bizarre warning message from GAE: Error: UnauthorizedYour client does not have permission to the requested URL /. Here is the code I am using for both the .pl code and the .yaml version: 1 runtim...
Inspired by this post on how to create mirror images with Paperclip, I decided to write up how to do the same thing with CarrierWave. It's a nice example of how CarrierWave's Uploader class makes manipulating files very easy. This assumes you've already generated an uploader and probably mounted it on a model somewhere...
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...
In the following code in __getattr__() if a refered variable is not found it would give an error.Similarly how to check whether a method exist or not import string import logging class Dynamo: def __init__(self,x): print "In Init def" self.x=x def __repr__(self): print self.x def __str__(self): print self.x ...
siscard Re : Open Office, Reconnaissance de caractères, Xsane, Kooka et Cie... L'erreur de segmentation est revenue comme elle avait disparue. Si quelqu'un a une idée, je suis preneur. Tout ce que j'ai trouvé, c'est que le logiciel essaie d'utiliser un espace de mémoire qui ne lui est pas attribué; alors cela provient ...
use the following search parameters to narrow your results: e.g. subreddit:aww site:imgur.com dog subreddit:aww site:imgur.com dog see the search faq for details. advanced search: by author, subreddit... 490 users here now /r/programming is a reddit for discussion and news about computer programming Guidelines Please t...
I have a window with a push-button. Once the button is clicked , I would like to change the position of line that is initially drawn.This is my code till now. import sys from PyQt4 import QtGui , QtCore class trial(QtGui.QWidget): def __init__(self): super(trial , self).__init__() self.window() ...
tiramiseb Re : configuration des DNS S'il-te-plait, pour des citations utilise la balise "[ quote ]" et non la balise "[ code ]", c'est pénible de devoir défiler horizontalement pour lire les phrases que tu cites... Hors ligne kr2sis Re : configuration des DNS ça y est je sui perdu...:o est ce qu'on peut faire doucemen...
I am using inlineformset_factory to create fields for a many to many relationship between Clients and Sessions, with an intermediary Attendance model. I have the following in my views file: AttendanceFormset = inlineformset_factory( Session, Attendance, formset=BaseAttendanceFormSet, exclude=('user'), ...
I am trying to add memcache to my webapp deployed on GAE, and to do this I am using memcache.Client() to prevent damage from any racing conditions: from google.appengine.api import memcache client = memcache.Client() class BlogFront(BlogHandler): def get(self): global client val = client.get...
I have what I think can be only a synchronizing problem in this Python code. The code is intended to apply a minimax algorithm to a Tic Tac Toe game, implemented with parallel processes instead of a single process exploring all the possible moves one by one. Before labeling it as a really bad idea, I've been required t...
Analyzing Sound Files Pages: 1, 2 The tool Natural sounds are comprised of many frequencies with varying amplitudes. It is the complex interaction of both frequency and amplitude varied across time that makes sound pleasant to hear. But no matter how complex the sound, the FFT can be used to decompose it and to estimat...
I should define a function pad_with_n_chars(s, n, c) that takes astring 's', an integer 'n', and a character 'c' and returnsa string consisting of 's' padded with 'c' to create astring with a centered 's' of length 'n'. For example,pad_with_n_chars(”dog”, 5, ”x”) should return thestring "xdogx". I should defi...
HowToDPorts DPorts and pkgng Dports is DragonFly's own third-party software build system. It is based on FreeBSD's Ports Collection. Differences between ports and DPorts are intentionally kept to a minimum, both to maintain familiarity for mutual users of both operating systems and also to leverage the tremendous amoun...
I'm a fairly new Python programmer (started 3 days ago). I'm working as a apprentice for a civil engineer and he asked me to do some simpler tasks for his program, as of the objective I should work with is to not allow numbers from inputs in certain glade objects. The code I've been struggling with creating is as such:...
Marrrrrrrie Pas de scroll avec le touchpad (ubuntu 12.04) Bonjour, Je viens d'installer ubuntu 12.04 sur un Dell latitude E6330. Il y a un seul problème majeur : le scroll sur le côté droit du touchpad ne fonctionne pas. Le scroll-down marche avec une souris externe. Dans les paramètres systèmes il semble que mon touch...
I'm looking for a way to set a time limit, a countdown. I will use this function to control the amount of time the user can run a while loop. Here's an example of how it's doing to run. def run(strings, timeout=30): while timeout > 0: input = raw_input("prompts that will continue prompting as long as not ti...
Your gpu is an awesome thing, it can do all kind of calculations, very fast. For example, instead of telling it exactly how you want each pixels to be, you can throw textures and vertices at it, and have it correctly deduce how this things will have to look. To do this, though, you must tell it what part of the texture...
I have the following code, which has the following two problems: Traceback (most recent call last): File "C:\Users\v\workspace\first\src\tests.py", line 1, in <module> class Animal: File "C:\Users\v\workspace\first\src\tests.py", line 39, in Animal File "C:\Users\v\workspace\first\src\tests.py", line 31, in ma...
Your configurations are correct. If you are using the https://github.com/pythonforfacebook/facebook-sdk You will need to make some changes to the example code. The example.py file defines "get" and "post" methods under the HomeHandler class. The "get" will not work when the page is running as a Canvas App inside Facebo...
djara Re : Récupération de windows après insttallation de ubuntu 12.10 64bit Merci. Je te tiens informer dans quelques minutes du résultats. Merci Hors ligne djara Re : Récupération de windows après insttallation de ubuntu 12.10 64bit Voila ce que j'ai obtenu en reprenant avec la version officiel le lien : http://paste...
Le Farfadet Spatial Re : Petit guide pour aider au choix d'un langage Salut à tous ! Sur amazon, j'ai trouvé ce livre "Python - Les Fondamentaux du langage - La Programmation pour les scientifiques. de Matthieu Brucher" Très bon livre, dans la mesure où tu sais déjà programmer et que tu es intéressé par la partie scien...
I've been trying (and failing) to figure out how to send email via Python. Trying the example from here: http://docs.python.org/library/smtplib.html#smtplib.SMTP but added the line server = smtplib.SMTP_SSL('smtp.gmail.com', 465) after I got a bounceback about not having an SSL connection. Now I'm getting this: Traceba...
Officially, web2py recommends using doctests to test your controllers. Doctest, however, is not always the ideal way to test your code. Doctests are especially inept at handling database-driven controllers, where it's important to return the database to a known state before running each test. After a long discussion on...
I have to read an XML file in Python and grab various things, and I ran into a frustrating error with Unicode Encode Error that I couldn't figure out even with googling. Here are snippets of my code: #!/usr/bin/python # coding: utf-8 from xml.dom.minidom import parseString with open('data.txt','w') as fout: #do a lo...
Ayu Grub ne se lance pas Bonsoir, J'ai installé windows 7 et Xubuntu 11.10 sur un nouveau pc avec cette configuration:CM: Asus P8H67 B3Processeur: i5 2500kDD: 1TO 7200 RPMRAM: 2x4GOCG: Gigabyte GeForce GTX 560 Mais je boot toujours sur windows et Grub ne se lance pas j'ai essayé de réinstaller grub depuis une session l...
Is it possible to specif template name in view annotation. I would like to do something like that in my views.py: instead of: def home(request, url): page = PageFactory.create_for_url(url) return render_to_response('front/home.html', {'page': page}) I would prefer to do it in this way: @view('front/hom...
Apart from asking Guido directly, I don't think your going to find any explanation of this. The syntax has been around from the very beginning. The earliest version of python sources I could find was python 1.0.1. Looking at the changelog in the Grammar file we find references to even earlier versions. In version 2 of ...
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 wondering about the differences between inheritance and composition examined with concrete code relevant arguments. In particular my example was Inheritance: class Do: def do(self): self.doA() self.doB() def doA(self): pass def doB(self): pass class MyDo(Do): def doA(...
Announcement Unanswered posts Hi, I have an java project which gets data from remote SAP, then I want to implement it with Talend. In Talend I used tSapConnection and tSAPInput, and tLibraryLoad to load sapjco.jar lib. The connection is OK but after I met error, "JCO_ERROR_FIELD_NOT_FOUND : Field CHECKPOINT not a membe...
Akamine Impossible d'accéder au menu "Pilotes additionnels" Bonjour, J'ai récemment installé Steam pour Linux. Sur le wiki associé ils demandent des mises à jour des pilotes additionnels, seulement impossible d'accéder au menu "Pilotes additionnels", Ubuntu rencontre une erreur que ce soit après plusieurs reboot, avec ...
I have the following string which forces my phython script to quit: "625 625 QUAIL DR UNIT B" I need to delete the extra spaces in the middle of the string so I am trying to use the following split join script: import arcgisscripting import logging logger = logging.getLogger() gp = arcgisscripting.create(9.3) gp.OverW...
Componenti e plugin I componenti ed i plugin sono funzionalità relativamente nuove di web2py e c'è ancora disaccordo tra gli sviluppatori su cosa siano e cosa dovrebbero essere. La maggior parte della confusione è generata dall'uso che si fa di questi termini in altri progetti software e dal fatto che gli sviluppatori ...
general dev cybrid at November 5th, 2005 08:08 — #1 Well, I'm totally new to this kind of class, so after searching a bit I found out this tuto about Singleton Pattern What I still don't understand very well is that in this piece of code class Singleton { public: static Singleton* Instance(); protected: ...
I want to make a simple stupid twitter app using Twitter API. If I request this page from my browser it does work: http://search.twitter.com/search.atom?q=hello&rpp=10&page=1 but if I request this page from python using urllib or urllib2 most of the times it doesn't work: response = urllib2.urlopen("http://search.twit...
ogaby Re : [ATTENTION] Faille de sécurité critique dans le noyau Linux ! vi... Avec cette simple ligne, on peut bénéficier des mises-à -jour de sécurité plus rapidement que sur un dépà´t européen. Je dis "européen" car je vis en Allemagne et mon dépà´t "normal" n'a pas encore cette mise-à -jour. Hors ligne zappinggg Re...
MyClass.f refers to the function object f which is a property of MyClass. In your case, f is an instance method (has a self parameter) so its called on a particular instance. Its "unbound" because you're referring to f without specifying a specific class, kind of like referring to a steering wheel without a car. You ca...
I'm reading on Google App Engine groups many users (Fig1, Fig2, Fig3) that can't figure out where the high number of Datastore reads in their billing reports come from. As you might know, Datastore reads are capped to 50K operations/day, above this budget you have to pay. 50K operations sounds like a lot of resources, ...
Create a VBO containing all of the sprite's frames, and make your glDrawArrays call with the appropriate (frameNumber * 4) in the first param. If you want to get even more clever about it, you could make it a static VBO and do your billboarding formula in your vertex shader. The sprite origin would then become a shader...
Introduction web2py[web2py] is a free, open-source web framework for agile development of secure database-driven web applications; it is written in Python[python] and programmable in Python. web2py is a full-stack framework, meaning that it contains all the components you need to build fully functional web applications...
Components and plugins Components and plugins are relatively new features of web2py, and there is some disagreement between developers about what they are and what they should be. Most of the confusion stems from the different uses of these terms in other software projects and from the fact that developers are still wo...
My view code looks basically like this: context = Context() context['some_values'] = ['a', 'b', 'c', 'd', 'e', 'f'] context['other_values'] = [4, 8, 15, 16, 23, 42] I would like my template code to look like this: {% for some in some_values %} {% with index as forloop.counter0 %} {{ some }} : {{ other_values....
I have the following test script, which mimics what I usually do to setup an extended logger: import logging TRACE_LL = 25 TRACE_LSTR = 'TRACE' LOG_FORMATTER = '%(asctime)s - %(levelname)-10s - %(message)s' class MyLogger(logging.Logger): def __init__(self, log_name): logging.Logger.__init__(self, l...
I need to create a form and have the form upload an image and save it to my disk. Here is my code import web urls = ( '/hello', 'Index', '/file_upload_form', 'ThatFile' ) app = web.application(urls, globals()) render = web.template.render('templates/', base = "layout") class ThatFile(object): def GET(self): ...
Some of the capabilities listed in these pages for Dispatch are for future releases and are supplied for the purpose of illustrating the potential of a message router. This section outlines the actual capabilities of version 0.1: $ tar -xzf qpid-dispatch-0.1.tar.gz Source the build configuration: $ cd qpid-dispatch-0....
Consider the two following Python code examples, which achieves the same but with significant and surprising performance difference. import psycopg2, time conn = psycopg2.connect("dbname=mydatabase user=postgres") cur = conn.cursor('cursor_unique_name') cur2 = conn.cursor() startTime = time.clock() cur.execute("SELEC...
JavaScript ckdoublenecks — 2011-04-11T12:23:44-04:00 — #1 I took a working program and modified it to use different values and can't seem to make it work now. I want have the datepaid, pd & paidsum insert when I key in the amtpaid . <html><head> <!--when the paidamt is keyed in, the current date, pd & paidsum are autoi...
is it possible to set a number or an element of an array to NaN in Python? Additionally, is it possible to set a variable to +/- Inf? If so, is there any function to check whether a number is Inf or not? Thanks Cast from string using >>> float('NaN') nan >>> float('Inf') inf >>> -float('Inf') -inf >>> float('Inf') == f...
I need to use a bi-directional relationship in Mongoengine which is something like the below. from mongoengine import * class Notification(Document): desc = StringField() from_user = ReferenceField('User') class User(Document): Name = StringField() notifications = ListField(EmbeddedDocumentField(Notific...
It looks like you're new here. If you want to get involved, click one of these buttons! script method, a QScript will add one or more CommandLineFunctions.@Input and @Output.@Input of CommandLineFunction A depends on the @Output of ComandLineFunction B, A will wait for B to finish before it starts running. Each Command...
Webpage screenshots with webkit For a recent project I needed to render screenshots of webpages. Here is my solution using webkit: import sys import time from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtWebKit import * class Screenshot(QWebView): def __init__(self): self.app = QApplication(sys.argv) QW...
I'm optimizing some code whose main bottleneck is running through and accessing a very large list of struct-like objects. Currently I'm using namedtuples, for readability. But some quick benchmarking using 'timeit' shows that this is really the wrong way to go where performance is a factor: Named tuple with a, b, c: >>...
Der Bus ist Baujahr 1979 und hat seinen zweiten Motor. Innen voll ausgebaut als Wohnmobil. Ich habe ihn vor einem Jahr gekauft. ZUSTAND: Der Wagen f&auml… via Google+ Die Deutsche Bahn plant zum nächsten Fahrplanwechsel massive Zugstreichungen im internationalen Bereich. Insbesondere die Streichung der Verbindung… via ...
Thanks to the_jack providing access to his box, got a fix. See this ticket for info: http://dev.zenoss.loc/trac/ticket/7196. You can fix everything like so: $ zenpatch 22038 $ zendmd >>> for b in dmd.global_catalog(): ...     dmd.global_catalog.catalog_object(b.getObject(), idxs=["allowedRolesAndUsers"]) ... >>> commit...
I'm trying to make a POST request to retrieve information about a book. Here is the code that returns HTTP code: 302, Moved import httplib, urllib params = urllib.urlencode({ 'isbn' : '9780131185838', 'catalogId' : '10001', 'schoolStoreId' : '15828', 'search' : 'Search' }) headers = {"Content-type":...
I am looking at creating some Ubuntu applications, but finding good resoures are hard. I am using the quickly toolkit, but would really like some more insight. How does one normally store application preferences and settings in Linux / Ubuntu. Is it as simple as creating a XML file and saving the information and then r...
I am using Python 2.6.5 and Django 1.3 Let me say i have model like: class Company(models.Model): name = models.CharField(...) type = models.SmallIntegerField(...) .... def check_condition(self, someParam): do someThing... return someThing This one is a heavily used model, so i keep bas...
use the following search parameters to narrow your results: e.g. subreddit:aww site:imgur.com dog subreddit:aww site:imgur.com dog see the search faq for details. advanced search: by author, subreddit... ~42 users here now Welcome to r/DailyProgrammer! First time visitors of Daily Programmer please Read the Wiki to lea...
17 6 / 2014 In this post I am going to show you how basic maths and you school old equations can help you do something you experience in your daily browsing. Ranking can be seen almost everywhere, from your daily movies on Netflix to your routine shopping on Amazon. Though there is existing work on what I am about to p...
I would like to download a file using urllib and decompress the file in memory before saving. This is what I have right now: response = urllib2.urlopen(baseURL + filename) compressedFile = StringIO.StringIO() compressedFile.write(response.read()) decompressedFile = gzip.GzipFile(fileobj=compressedFile, mode='rb') outfi...
Christophe C Paquet debian et bug sur fichier postinst Bonjour, J'ai un bug sur un paquet debian, plus exactement sur son fichier postinst. je m'explique : Le fichier postinst comprend : #!/bin/bash ps -e sudo ln -s -f /usr/bin/plank-config.dockitem /home/chris/.config/plank/dock1/launchers/plank-config.dockitem Si je...
using window.open to open a popup, the "scrollbars=1" thing is not working in IE8 for some reason (the window opens, its just that the scroll bar that isn't showing). works fine in firefox and chrome here is what I tried: window.open(source, null, "height=200, width=400, scrollbars=yes, scrollbars=1, toolbar=no, resiz...
Python code: import json jsonvalue = json.dumps({"key":key_string,"value":unsafe_string}) cursor_mysql.execute("""UPDATE data SET json = %s WHERE id = %s""", (jsonvalue, somerowid)) jsonvalue is a valid json produced by json.dumps even if unsafe_string contains unicodes. Is there a similar function in Java?
I'm learning PowerShell 2.0 on Windows 7. My task is simple: I want to listen for a WMI event and then display some information about it. Here is what I'm currently doing: Register-WmiEvent -class win32_ProcessStartTrace -sourceIdentifier processStart Wait-Event It seems to work. Indeed, I get this when I start a proc...
ehmicky Stego++, projet de bibliothèque de stéganographie Salut à tous, [Message mis à jour 19/11/11] Je suis actuellement sur un projet de stéganographie (art de dissimuler un message secret dans "quelque chose" (fichier, phrase, etc.) d'apparence banal). Il s'agit de faire une bibliothèque C++, Stego++, qui permette ...
spyke Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr jerhum oki mais alors je ny arrive pas a les faire tourner justement est ce normale comme wolfenstein , quake4 etc..... Hors ligne foxylechou Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr il faut autoriser le fichier a être exécuter dan...
AuthorPosts January 11, 2011 at 1:47 pm #2755 Hi I have a big problem where allot of my customers can not view some of the pages. In some browsers it only shows the header then the rest of the page is blank There are several pages with this problem but I am assuming they are the same problem so can you have a look at t...
I need to generate a chart. I use pydot library. My code is: import pydot people = ['person_%d'%i for i in range(10)] graph = pydot.Dot(graph_type='graph', rankdir='LR', splines='ortho') # create nodes for people node_list = [] for person in people: node = pydot.Node(person, shape="record", style="filled", fillcol...
I am having trouble using Requests The API I am testing indicates the parameter device_info to be POSTED in the message body. It also says that the device_info as a form field. In all the documentation for Requests I cannot find how to add a "name" to the parameter other than slap the name with it's value in json. Here...
I need to generate unique 64 bits integers from Python. I've checked out the UUID module. But the UUID it generates are 128 bits integers. So that wouldn't work. Do you know of any way to generate 64 bits unique integers within Python? Thanks. just mask the 128bit int >>> import uuid >>> uuid.uuid4().int & (1<<64)-1 95...
I have a sqlalchemy model, where all most all tables/objects have a notes field. So to try follow the DRY principle, I moved the field to a mixin class. class NotesMixin(object): notes = sa.Column(sa.String(4000) , nullable=False, default='') class Service(Base, NotesMixin): __tablename__ = "service" servi...
answer == raw_input("Do you like python?") if answer == "yes": print "That is great" elif answer == "no" print "that is disappointing" else: print "that is not the answer to my question" The problem with this code is that python 2.7.2 ignores my first two conditions, but responds to the last one. Why...
If you want to avoid any differences between the two, then make them explicitly 32-bit or 64-bit float arrays. NumPy uses several other libraries that may be 32 or 64 bit. Note that rounding can occur in your print statements as well: >>> import numpy as np >>> a = [0.20227873, -0.02738848, 0.59413314, 0.88547146, 1...
How do you make Selenium wait for the page to load in Selenium 2.0? Use class WebDriverWait Also see here You can expect to show some element. something like in C#: WebDriver _driver = new WebDriver(); WebDriverWait _wait = new WebDriverWait(_driver, TimeSpan(0, 1, 0)); _wait.Until(d => d.FindElement(By.Id("Id_Your_UIE...
I have an application(developed in python) that requires a refreshed view from the datastore after every 5 seconds. I have came out with an javascript function and handle the refresh using ajax. Ajax function <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script> ...
Can you change which values are included and how they are formatted, when you download a report as a CSV file from Toggl? I would like to get the duration of the different tasks in a format that numbers can understand as a duration value. No, it is not possible to change it when downloading. However, you can load it in...
wav-unreal Réponses : 4 Bonjour, J'ai un petit problème ces derniers temps... J'ai essayé à peu près de ce qui aurait pu marché mais rien n'y fait! Mon Netbook prend au moins de 2 à 3 minutes de plus à chaque démarrage pour "configurer" network-manager... Et du coup à chaque démarrage, l'applet de network-manager dispa...
PPdM goolgle et Ubuntu 64bits Salut Je vous soumet un probleme recurent que je croyais du a ma config matérielle mais qui se manifeste sur un autre PC totalement différent. Les accès a google (tout les sites) sont très lent quand ce n'est pas impossible sur les config en 64 BIts, j'ai deux PC (un portable et un fixe) q...
Composite Manager Retained Drawing Protocol RFC Robert Carr 02/28/07 Outline and justification: Results from development in the creation of 'first generation' mainstream composite window managers has outlined the need for several reconsiderations in regards to applications interacting and communicating with the composi...
If a GSettings schema exists and has been compiled, there is usually no problem reading from it. However, if it doesn't exist, an error is usually thrown which cannot be handled. Try this in a Python file or console: from gi.repository import Gio try: settings = Gio.Settings("com.example.doesnotexist") except: ...
I am trying to package a program I wrote (using Pyqt4) into a single executable for linux. I tried using Pyinstaller however it has problems with importing Gio (for settings) from gi.repository import Gio Running the application would give: ImportError: cannot import name Gio I then tried to use bbFreeze. The problem...
I've recently been running one of my apps through Valgrind but there's a few MYSQL related leaks I can't fix. I put the offending code in the most basic form and tested that; I got the same leaks. Should I just disregard them or am I doing something wrong? Code: #include <stdio.h> #include <stdlib.h> #include <mysql/my...
Is there something more simple we could try first? Should we compare the secrets? 'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.' 'God exists because Mathematics is consistent, and the devil exists because we cannot prove it' 'Humanity is still kept in...
Here's the simplest multi threading example I found so far: import multiprocessing import subprocess def calculate(value): return value * 10 if __name__ == '__main__': pool = multiprocessing.Pool(None) tasks = range(10000) results = [] r = pool.map_async(calculate, tasks, callback=results.append) ...
A few days back, I started using new OpenCV-Python interface, cv2. My question is regarding the comparison of cv and cv2 interface. Regarding the ease of use, new cv2 interface has improved far greater, and it is really easy and fun to work with cv2. But what about speed? I made two small code snipplets, one in cv and ...
Each Amazon EC2 instance has associated metadata, as well as user data supplied when launching the instance. The meta and user data is instance-specific, and therefore only accessible to the instance. The data is useful on several levels, such as configuring SSH public keys, programmatically configuring the instance ac...
I'm trying to write a handler that acts on files within various subdirectories, but while my script can see these files, it cannot do anything with them because it fails to assemble their paths. The problematic part comes from this loop: for (path, dirs, files) in os.walk("data/"): for image in files: #do ...
I had a problem with install Ubuntu 13.04 next to Windows 8. I have a Dell inspiron 15 notebook with UEFI. In Boot-setup I changed to Legacy Boot on and switched UEFI boot off. Then I installed Ubuntu but the computer always starts Windows. I have followed the instructions here : UEFI but it hasn't helped. Now when I t...
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...
I'm just going to elaborate on Ignacio Vazquez-Abrams's answer. cmp is deprecated. Don't use it. Use the key attribute instead. lambda makes a function. It's an expression and so can go places that a normal def statement can't but it's body is limited to a single expression. my_func = lambda x: x + 1 This defines a fu...
I am a beginner with google app engines. My goal is to port an existing webpage to GAE. The difficulty I am having centers around the location of the .js files. To get it to run on my local machine, I placed .js files in a static directory with references in the html like <link href="/static/tblDz_Qs_clinical.js".... ...
i want to take inputs like this 10 12 13 14 15 16 .. how to take this input , as two diffrent integers so that i can multiply them in python after every 10 and 12 there is newline I'm not sure I understood your problem very well, it seems you want to parse two int separated from a space. In python you do: s = raw_input...
Air density alone has a fairly substantial impact on speed, if all else is equal (and if my calculations are correct!) Based on the equation and from this page on cycling aerodynamics, and the air-density values from Wolfram Alpha, I came up with: At 300 watts, at 0*C, will travel at 39.34 km/h At 300 watts, at 10*C, ...
I am trying to convert some python script to display a table (based on a dbf) of features located within a specific data driven page. So far, I have the script successfully able to refresh the map to the specific table, but it does not update the table. I have it set-up as three text boxes that should be updated with t...
After configuring and installing IPython to run under python3, as explained by this wiki, and having completed all the steps, I still get: gmask@Gbuntu:~$ ipython3 qtconsole No command 'ipython3' found, did you mean: Command 'ipythonx' from package 'ipython' (universe) Command 'ipython' from package 'ipython' (universe...
Soipacon [Tuto] Wallpapoz enfin ça marche !!!! Enfin j'ai trouvé un How To concernant wallpapoz. C'est trés bien fait et même sans être bilingue c'est facile. En tout cas chez moi ça marche impec sur Breezy noyau 686. http://ubuntuforums.org/showthread.php? … =wallpapoz Hors ligne Bob Morane Re : [Tuto] Wallpapoz enfin...