text stringlengths 256 65.5k |
|---|
I have a png image that contains the red and green channels only. I removed the blue channel from the image for calculation purposes. I need to calculate the estimated joint probability distribution for these pixels. I came across this function: numpy.random.multivariate_normal(mean, cov[, size]) but this one computes ... |
I have a dictionary as:
default = {'a': ['alpha'], 'b': ['beta','gamma'], 'g': []}
i wish to eliminate the empty values as:
default = {'a': ['alpha'], 'b': ['beta','gamma']}
i wrote a function (following an example find in the web)
def remove_empty_keys(d):
for k in d.keys():
try:
if len(d[k])... |
I'm trying to split a string into a int list for further processing. But somehow I can't remove certain whitespaces in between elements of the list. The string x is supposed to have a length of 1000 instead of 1019. I tried reading the documentation for python and saw the function strip() for stripping whitespaces from... |
How to profile python code under Google App Engine runtime python27?
In runtime python it was done by this code - python runtime:
from google.appengine.ext import webapp
class PageHandler(webapp.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write('Hello... |
Sieve Of Eratosthenes Algorithm
Implemented in any programming language
The sieve of Eratosthenes is a simple algorithm created by an ancient Greek mathematician, for finding all prime numbers up to a specified integer. The algorithm is often used to compare the syntax of programming languages and the speed of compiler... |
Thought I'd post my solution as the original question/answer gave me a lot of help.
My problem is a little different to Russell's. I'm using OptionParser and instead of an environmental variable for each argument I have just one which simulates the command line.
i.e.
MY_ENVIRONMENT_ARGS = --arg1 "Maltese" --arg2 "Falco... |
I am trying to create an app and got stuck at a place. To debug, I have added Log.d messages. However, I am not getting the log outputs for a certain part of the code. I am getting the log outputs for other parts. This is weird but is there any solution for it?
PS: There are no filtering enabled, the device is correctl... |
What I want to be able to do is open a window with two images (one image is an exact copy of the other). Then when I click a button it changes the image on the right. I hope this is making sense. The code I have no is:
from __future__ import division
from Tkinter import *
from PIL import Image, ImageTk, ImageFilter
imp... |
Create a Python script called whatever you want (say mystartup.py) and then set an environment variable PYTHONSTARTUP to the path of this script. Python will then load this script on startup of an interactive session (but not when running scripts). In this script, define a function similar to this:
def _(v):
if typ... |
It is the first time that i use pyhton to create a graphical interface and i have difficulties to understand the link between the parent and the children.
I first create the root window in a separated thread :
import tkinter as tk
import threading as th
class GUI(th.Thread):
def __init__(self):
th.Thread.__... |
I need some help with a python service.
I have a service written in Python. What I need to do is to pass it some arguments. Let me give you an example to explain it a bit better.
Lets say I have a service, that does nothing but writes something to a log. I'd like to write the same thing into the log several times, so I... |
The "Component" argument for addCompnent() method is an instance of the component class. In short, Component has 2 arguments; "Component(self,name,methodCount)" As you see in my code, I added each Component to a list. What I need to do in validCount() is return the number of components where the methodCount != 0. From ... |
I get a strange error message when trying to read non-ascii from the datastore:
'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128)
Traceback (most recent call last):
File "/base/data/home/apps/s~myapp-www/events.355951895377615944/webapp2.py", line 1511, in __call__
rv = self.handle_exc... |
gtk.Settings — an object that contains the global settings for thewidgets on a gtk.gdk.Screen
class gtk.Settings(gobject.GObject):
def set_string_property(name, v_string, origin)
def set_long_property(name, v_long, origin)
def set_double_property(name, v_double, origin)
Functions
def gtk.settings_get_d... |
How can I handle KeyboardInterrupt events with python's multiprocessing Pools? Here is a simple example:
from multiprocessing import Pool
from time import sleep
from sys import exit
def slowly_square(i):
sleep(1)
return i*i
def go():
pool = Pool(8)
try:
results = pool.map(slowly_square, range(40... |
I am working on a problem that need to reverse a integer input without using list or string. But my program only return first and last digits.
def reverseDisplay(number):
if number<10:
return number
else:
return reverseDisplay(number//10)
def main():
number=int(input("Enter a number:"))
print... |
If you have a tree structure, which a directory is, then you can turn your for() loop into a generator and have it recursively call itself as needed. You'll need two templates (one for files, one for folders), and a view that creates generators for each folder.
Here's a file template:
<li>{{ file }}</li>
Here's a fold... |
I'm beginning python and I'm trying to use a two-dimensional list, that I initially fill up with the same variable in every place. I came up with this:
def initialize_twodlist(foo):
twod_list = []
new = []
for i in range (0, 10):
for j in range (0, 10):
new.append(foo)
twod_list.... |
I'm currently working on a sound experiment, and I've come across one issue. I save an array of wave data to a .wav file and play it, but is there a way to skip this step and simply play the sound right from memory? I'm looking for a solution that will work cross-platform.
I suppose you are using the wave library, righ... |
xxkirastarothxx
MegaUpload : BotMU v1.0.1
Bonjour à tous
Et bien voila, depuis quelques temps j'ai remarqué que le capcha de Megaupload a disparu.
Comme il s’agissait du point le plus bancale du développement d'une automatisation de téléchargement sur Megaupload, le projet était en attente.
Maintenant que ce point n'ex... |
The question is to find whether a given sum exists over any path in a BST. The question is damn easy if a path means root to leaf, or easy if the path means a portion of a path from root to leaf that may not include the root or the leaf. But it becomes difficult here, because a path may span both left and right child o... |
In the code below, I have a dictionary of attributes and values. I am checking to see if the value if an attribute is True, and if so adding the attribute to a list for later processing (it becomes part of a SQL group by).
This code works fine, but I was wondering how it could be more "Pythonic". Note that the col_map ... |
Servizi
Il W3C (World Wide Web Consortium) definisce un web service come "un sistema software progettato per supportare l'interazione interoperabile macchina-macchina su una rete". Questa è una definizione molto ampia e racchiude un gran numero di protocolli progettati non per la comunicazione tra uomo e macchina ma tr... |
Module esistools
Miscellaneous utility functions useful for dealing with ESIS streams.
_data_match(...)
match(string[, pos[, endpos]]) --> match object or None.
string
_null_join(S, sequence)
Return a string which is the concatenation of the strings in the sequence.
parse(stream_or_string, parser=None)
_charmap = {'\x0... |
I'm trying to install Matplotlib 1.0.1 version on latest Cygwin. In the processing, there is a weird fork error cannot be solved. I googled similar questions and found that it might be solved by manually running gcc/g++ with matplotlib 0.98.5.2 : http://innuendopoly.org/arch/matplotlib-cygwin. But it doesn't work under... |
Goal: Given a number (it may be very long and it is greater than 0), I'd like to get the five least meaningful digits dropping any 0 at the end of that number.
I tried to solve this with regex, Helped by RegexBuddy I came to this one:
[\d]+([\d]{0,4}+[1-9])0*
But python can't compile that.
>>> import re
>>> re.compile... |
When learning how to use a new tool or service, the learning process usually goes something like this:
Read the README, or some documentation.
Write some code and try to run it.
Run into an error.
Determine what went wrong; go back to step 1.
There are a few keys to going through this process efficiently. One is to hav... |
I'm generating Java from WSDL using wsimport (JAX-WS 2.1.3) and need to make it generate a @HandlerChain annotation. So I create a JAX-WS binding file:
<jaxws:bindings
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:jaxws="htt... |
I have a list:
list = [ '1', '1,'1', '-1','1','-1' ]
and need to convert it to a dictionary of dictionaries. The first three values in are x y z and the second set three values are x y z. The result should be:
d = { 0:{x:1,y:1,z:1}, 1:{x:-1,y:1,z:-1}}
My attempt:
mylist=[1,1,1,-1,1,-1]
count = 1
keycount = 0
l = {'x':... |
New to python (very cool), first question. I am reading a 50+ mb ascii file, scanning for property tags and parsing the data into a numpy array. I have placed timing reports throughout the loop and found the culprit, the while loop using np.append(). Wondering if there is a faster method.
This is a sample input file fo... |
I am a beginner with C++. I have a new project at work where I have to learn it, so I'm trying some things just to test my understanding. For this problem, I'm trying to read a file and then print it on screen. Super simple, just trying to get good at it and understand the functions that I'm using. I copied some text f... |
Tony95
Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux
Salut à tous je savais pas trop où poster donc je le fais ici. J'ai un petit soucis en GTK, j'aimerais créer une interface permettant de charger et sauvegarder des fichiers mais j'arrive vraiment pas à m'en sortir pour le code. En gros j'ai une fe... |
I've been using mechanize lately to crawl around the web and do stuff. I decided that I wanted to write some algorithms to graphically show connections between my friends. Each friend will be a node within the graph, and if a node is friends w/ another node, there will be an edge between them. Essentially just mutual f... |
Virtualici
Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes)
j'ai tout tenté ! au mieux j'ai ça : ):
[sudo] password for boubou:
Sorry, try again.
sudo: 3 incorrect password attempts
boubou@boubou-M51SE:~$ *******
******* : commande introuvable
boubou@boubou-M51SE:~$
les : ******* c'est mon pass.
Hors l... |
When import statements (such as those below) invoke pkg_resources from inside a
setuptools.egg
file, handled exceptions may be treated as unhandled and break within the debugger.
Because we cannot extract source code from eggs, we will prompt the user to browse to the source file before explaining why they need to do t... |
Django does the sensible things to reduce exposure to XSS.
Django uses unicode and UTF-8 encoding everywhere by default, and sensibly forces unicode encoding before doing substitution on all template variables (done by default) to prevent users inserting arbitrary HTML elements. Django allows developers to change the e... |
What is the difference between __str__ and __repr__ in Python?
What is the difference between
Alex summarized well but, surprisingly, was too succinct.
First, let me reiterate the main points in Alexâs post:
This is mostly a surprise because Pythonâs defaults tend to be fairly useful. However, in this case, having ... |
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... |
You probably know by now that Python's flexible data structures make working with complex data a breeze. Did you know Python also makes it a snap to visualize your data in vibrant color?
Thanks to the slew of graphics modules people have built, Python is a handy language for creating graphics on the fly. This article l... |
Jx7
Re : [script] Télécharger de nombreuses quotidiennes de canal+ (suite)
J'ai l'impression que tu as un problème de droits d'écritures.
Hors ligne
Jx7
Re : [script] Télécharger de nombreuses quotidiennes de canal+ (suite)
Où as-tu placer le script?
Hors ligne
Jx7
Re : [script] Télécharger de nombreuses quotidiennes d... |
I am trying to see if the django-haystack is good for my faceting needs. Currently I want to display number near my facets. Lets say we have a model shown in their docs, but with an extra field for faceting (e.g. style in which author writes notes... e.g. styles are classic or modern). So index will look like this.
cla... |
Download
FREE PDF
The DZone Refcard #43 is an introduction to system high availability and scalability terminology and techniques (http://refcardz.dzone.com/refcardz/scalability). The next logical step is the scalable handling of massive data volumes resulting from having these powerful processing capabilities.
This Re... |
I'm really confused by the index logic of numpy arrays with several dimensions. Here is an example:
import numpy as np
A = np.arange(18).reshape(3,2,3)
[[[ 0, 1, 2],
[ 3, 4, 5]],
[[ 6, 7, 8],
[ 9, 10, 11]],
[[12, 13, 14],
[15, 16, 17]]])
this gives me an array of shape (3,2,3), call them (x,y,z) for sake... |
bishop
Re : Qarte arte.tv browser (ex Qarte+7)
VinsS !
J'ai réinstallé Qarte.
Avant de lancer Qarte j'ai refait un test avec rtmpdump... pas de problème.
J'ai supprimé le dossier caché .qarte puis testé Qarte:
bishop@JC:~/Bureau$ qarte -d
lang: /usr/share/locale/fr/LC_MESSAGES/qarte.mo
11:44:14: WARNING - utils Config ... |
I have a small script that takes a list of objects from an SQL table and groups them if the date-time on the object has less than 60 second difference with the last object.
It does this by converting the date-time to epoch and then subtracting the epoch of the previous object from the epoch of the current object. The c... |
I have a class that I'll be instantiating a lot from lines of JSON. Something like:
class Something:
def __init__(self, json):
#load all self variables from simplejson.loads(json) here
print self.some_variable_loaded_from_json
I'd like this to be as efficient as possible because this class is loade... |
I am attempting model inheritance on my Django powered site in order to adhere to DRY. My goal is to use an abstract base class called BasicCompany to supply the common info for three child classes: Butcher, Baker, CandlestickMaker (they are located in their own apps under their respective names).
Each of the child cla... |
Chris__
Re : gReemote, télécommande + prog TV pour Freebox HD
Merci tocks.
Je pense aussi que la meilleur des solutions serait de minimiser dans la zone de notif quand on ferme la fenêtre. Je vais regarder ça dès que j'aurai un peu de temps.
Pour réduire la fenêtre j'ai peur que ca commence à compliquer pas mal l'appli... |
I have several movie files in a mkv container.
ffmpeg -i filename gives me the following output:
Stream #0.0(eng): Video: h264 (High), yuv420p, 1280x720, PAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Stream #0.1(eng): Audio: dca (DTS), 48000 Hz, 5.1, s16, 1536 kb/s (default)
Stream #0.2(eng): Subt... |
Привет всем, в кои-то веки сподобился написать о Django.
Причём не общий пост, а решение конкретной мелкой задачки.
Итак, задача: Нужно ограничить количество записей в InlineModelAdmin.
Решение: По историческим причинам, иерархия классов в Django сильно различается для ModelAdmin и InlineModelAdmin:
Model <-(has)<- Mod... |
I'm running an app, foo, on Linux. From a Bash script/terminal prompt, my application runs multi-threaded with this command:
$ foo -config x.ini -threads 4 < inputfile
System Monitor and top report foo averages about 380% CPU load (quad-core machine). I've recreated this functionality in Python 2.6x with:
proc = subpro... |
I am looking to be able to write an alternative code to the built in count in python: This code works
def count(element,seq):
"""Counts how often an element occurs
...in a sequence"""
mycount = seq.count(element)
return mycount
but I would like to write it in a for loop (or another way?), I've got this... |
bowmore
Re : Qarte arte.tv browser (ex Qarte+7)
Si je lance
python /usr/bin/qarte
J'obtiens
python /usr/bin/qarte
(qarte:23575): Gtk-WARNING **: Impossible de trouver le moteur de thème dans module_path : « pixmap »
Affiché une quinzaine de fois, puis Qarte-1 démarre bien. Dans le terminal, il y a ça:
15:33:40: INFO ... |
I'm trying to get simple code working, unfortunately I'm a python beginner.
My script should return a list of files that doesn't match a pattern, more information here : http://stackoverflow.com/questions/2910106/python-grep-reverse-matching/2910288#2910288
My code is running but doesn't process the complete list of fi... |
Well, I have never felt the need to use such a thing in Python - and most Python programmers I know did not looked for something like this either. I have the impression that Python objects are lightweight in general and it would be better to create a lot of them and avoid the inherent problems of mutable objects than t... |
Leo 7
Résolu[polices] Chiffres à la place des lettres
Salut à tous !
Voici mon pb:
Ça me le fait qu'avec gnumeric et pantheon.
Quelqu'un peut il m'aider ? mercu d'avance
La police c'est ClearlyU Alternate Glyphs.
Voici le résultat de la commande locale:
[leo@HP-625 ~]$ locale
LANG=fr_FR.utf8
LC_CTYPE="fr_FR.utf8"
LC_NU... |
luc765
Re : Synthèse vocale SVOX Pico
Merci à frafra et tuxmuraille, pour votre travail.
J'utilisais espeak avec mbrola, la qualité de SVOX est nettement meilleure
J'ai installé gSpeech sur Lucid via la compilation pour SVOX. Tout est parfait.
Dans l'utilisation est-il possible de modifier la vitesse de lecture par un ... |
To clarify, this answer has incorrect information (thomas fixed his answer after comments, cool :) ). Other answers just avoid explaining what static allocation means. So I will explain the three main forms of allocation and how they usually relate to the heap, stack, and data segment below. I also will show some examp... |
Pylades
Re : /* Topic des codeurs couche-tard [1] */
It works! \o/
Bon, alors, vous en pensez quoi ? On met le planeur ? Avant le titre ? Après ?
“Any if-statement is a goto. As are all structured loops.
“And sometimes structure is good. When it’s good, you should use it.
“And sometimes structure is _bad_, and gets int... |
phiphi076
Re : La mise a jour clamAV et clamtk
@awass
la commande te permet de lancer le programe en mode graphique
avec les droits "root" administrateur (avoir accès au système) .
lorsque tu lance clamav "normalement" sans les droits administrateur
, tu peut pas faire les mises a jour des liste de virus et programe
de... |
I tried to run a small sample game code in the emulator but it crashed. My LogCat is given here. Can you help me resolve the issue.
02-23 15:18:50.543: D/AndEngine(636): MainActivity.onCreate @(Thread: 'main')
02-23 15:18:50.633: D/dalvikvm(636): Trying to load lib /data/data/com.example.gamegles2demo/lib/libandengine.... |
I am working through trying to learn to program in Python and am focused on getting a better handle on how to use Standard and other modules. The dir function seems really powerful in the interpreter but I wonder if I am missing something because of my lack of OOP background. Using S.Lotts book I decided to use his Die... |
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... |
I'm very very new to python. I'm trying to do something like this with a boolean:
/* ... other stuff */
loggedDocument = false
for line in inFile:
if (line.find( /*something*/ ) != -1):
println("FOUND DOCUMENT: %s" % line)
loggedDocument = true
if (loggedDocument == false):
/* do something else */
But ... |
I want to use scipy.integrate.ode solver. I can define the callable function f only as an array of discrete points (because it depends on results of integration from previous iterations). But from the documentation it seems that the integrator expects the callable to be a continuous function. I suppose some sort of int... |
I have a 67 different tables (with hundreds of thousands of rows) with multiple columns. One column is named PARCEL_ID. The PARCEL_ID field has characters like "-" or space or "/", etc. I would like to remove all these "-", or empty space, or "/", etc characters from the PARCEL_ID field from all the tables in a folder.... |
I just started with python and django and looking for a possibility to iterate through an objects attribute, to realize a search function over all fields.
The diff object classes an inheriting from an abstract base class and I created a static function searchable which should give the attributes back which could be sea... |
I'm trying to follow the guidelines in this answer, but I'm getting stuck with how to edit the template.
The relevant part of my admin.py:
SegmentFormset = forms.models.inlineformset_factory(Division,Segment)
class DivisionForm(forms.ModelForm):
def __init__(self, **kwargs):
super(DivisionForm, self).__init... |
Geotagging is the process of addinggeographical identification metadata to various media such as photographs,video, websites, or RSS feeds and isa form of geospatial metadata. These datausually consist of latitude and longitude coordinates, thoughthey can also include altitude, bearing, accuracy data, and placenames.
G... |
If you need to use captcha we strongly suggest outsourcing to recaptcha.net
It could not be easier. here is how to:
Example:
public_key='xxx' ### provided by recaptcha.net
private_key='xxx' ### provided by recaptcha.net
def index():
form=FORM(RECAPTCHA(request,public_key,private_key),INPUT(_type='submit'))
if ... |
I have a form that triggers an ajax request to a view after the user tabs out of the 'address' field. It retrieves the zip code and then populates pickups with the same zip. The problem is that if there are any form errors is that the drop down with the results I generate from my get_pickups view is lost. How can I kee... |
Topic: iredadmin ImportError No module named ldap
==== Required information ====
- iRedMail version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Linux/BSD distribution name and version:
- Related log if you're reporting an issue:
==== ==== Required information ====
- iRedMail version: 0.8.3
- Store mai... |
Services
The W3C defines a web service as "a software system designed to support interoperable machine-to-machine interaction over a network". This is a broad definition, and it encompasses a large number of protocols designed not for machine-to-human communication, but for machine-to-machine communication such as XML,... |
There are many different image registration algorithms, all with different advantages and disadvantages. But I usually try the simplest choice first: I simply pass the two images to ImageCorrelate.
img1 = Import["http://i.stack.imgur.com/laZeT.png"];
img2 = Import["http://i.stack.imgur.com/LAHyF.png"];
corr = ImageAdju... |
Does anyone know of a library with a working implementation of backpropagation through time? Any of Java/Python/C#/VB.NET/F# (preferably the last one) will do!
Assuming you're already using some library for BP, it should be (TM) rather straightforward to implement BPTT using BP as a step in the process.
The Wikipedia e... |
In python if I do the following:
>>> list = [ 3, 2, 1]
>>> sorted_list = k.sort()
Then sorted_list is None and list is sorted:
>>> sorted_list = k.sort()
>>> print list, sorted_list
[1, 2, 3] None
However, if I do the following:
>>> list = [ 3, 2, 1]
>>> sorted_list = sorted(list)
Then list remains unsorted and sort... |
I'm not sure, where to ask, so I try it here.
Hello, I would be very interested in pyxfce.
Is it still used. It seems, the content of the website is not so new
anymore.
What could be done with pyxfce?
For example: In windows I had a taskbar icon, which pops up
a list of alle available desktop icons and have quick acces... |
I'm trying to test tornado using AsyncHTTPTestCase. I want to test handlers marked with the @tornado.web.authenticated annotation. Because this handler requires authentication we must login first or somehow fool it in thinking we are authenticated in our test code
class HandlerToTest(BaseHandler):
@tornado.web.authen... |
What’s the fastest way to compare two large CSVs against each other?
So here’s the nut. Imagine you’ve got two huge CSV files, snapshots from the same database taken on different days.
They share a common identifier, and always have the same set of fields. But there are amendments, omissions and additions made between ... |
I'm trying to use Twitter api, but some tweets return empty, like hashtags. How can I print it? Or at least, a message that it is empty.
This is what I have so far:
def get_tweets(q, count=100, result_type="recent"):
result = search_tweets(q, count, result_type)
following = set(t.friends.ids(screen_name=TWITTER... |
MEH-TECH
Re : [Support] Team Fortress 2
Je me disais aussi que c’était du pipo... Je me connecterai dans la soirée alors pour le récupérer
Merci
Hors ligne
MEH-TECH
Re : [Support] Team Fortress 2
C'est bon je l'ai reçu
Hors ligne
kurapika29
Re : [Support] Team Fortress 2
Bien le bonjour, chez moi depuis le début TF2 es... |
You are here: Home ‣ Dive Into Python 3 ‣
Difficulty level: ♦♦♦♦♦
chardet to Python 3
❝ Words, words. They’re all we have to go on. ❞
— Rosencrantz and Guildenstern are Dead
Unknown or incorrect character encoding is the #1 cause of gibberish text on the web, in your inbox, and indeed across every computer system ever ... |
ragamatrix
Hors ligne
golgot200
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
@ragamatrix
570x150
570x230
1.5 ko avec Gimp
Dernière modification par golgot200 (Le 18/04/2013, à 21:31)
"L’ultime question … L’intelligence a besoin de la Bêtise pour s’affirmer, La Beauté a besoin de la Laideur pou... |
My Python / SQLAlchemy application manages a set of nodes, all derived from a base class Node. I'm using SQLAlchemy's polymorphism features to managethe nodes in a SQLite3 table. Here's the definition of the base Node class:
class Node(db.Base):
__tablename__ = 'nodes'
id = Column(Integer, primary_key=True)
... |
I am trying to return all the permutations of a string using a recursive method anagram(). For any word "ABCD...N", the function returns a list with the letter "A" in as many positions as possible within anagram("BCD...N"). The limiting case of the recursion would be that if the argument is of size two (eg: "XY"), it r... |
I have a script that processes files passed to the script as arguments. If a file passed to the script does not exist, then I want to write an error message to stderr. Having read all the related posts that I can find here, I fail to understand why the following minimal working example does not work. It behaves as expe... |
I am making a library that I aim to use in both android and windows. For windows, using Visual Studio 2010, it compiles, links and runs fine.
For Android, I am using the ndk-build script with android-ndk-r7 (which uses gcc 4.4.3). I am getting several of these linker errors:
./obj/local/armeabi-v7a/libjonsengine.a(Rend... |
One part I wanted to share this week was my main screen that shows the temperature and the time on a home screen. Both of these elements are updated every few seconds and the delay doesn't affect button pushes at any time. Consider it like a live desktop monitor as such. Magic!
All hail the mighty NERDBOX!
Here's a qui... |
I have a 3x3 matrix, of which I compute inverse. The inverse can be written legibly only when some subexpressions are replaced by new symbols, because they appear multiple times. Can I have sympy try hard to find those subexpressions and replace them? I tried the following, without success:
from sympy import *
Ex, Ez, ... |
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... |
Transcoding an audio or a video file
You want to play a movie extracted from a DVD on your phone, copy your CD collection on your PC, watch a program downloaded on the internet on your TV or broadcast a home video on the web? Learn to master the art of converting audio and video formats.
Introduction
The standard open-... |
I use Multiprocessing in Python in order to do several requests to a database (and other stuff):
po = multiprocessing.Pool()
for element in setOfElements:
results.append(po.apply_async(myDBRequestModule, (element, other stuff...)))
po.close()
po.join()
for r in results:
newSet.add(r.get())
... |
Understanding Network I/O: From Spectator to Participant
by George Belotsky
11/06/2003
This series of two articles will show you how to participate in the global Internet. The architects of this greatest advance in communications since the printing press have strived to make such participation possible. The Internet is... |
I'm struggling a little bit with the syntax for iterating through all comments on a youtube video. I'm using the python and have found little documentation on the GetYouTubeVideoCommentFeed() function.
What I'm really trying to do is search all comments of a video for an instance of a word and increase a counter (event... |
#0 Re : -1 » Bonjour les nouveaux, présentez-vous ici. Et bienvenue :-) [2] » Le 24/06/2011, à 05:18
Baleine
Réponses : 2446
Salut à tous,
Vive les gnous et les pingouins !
Pas eu besoin jusqu'ici des services du forum, la documentation est foisonnante -bravo et merci aux contributeurs !
Mais y'a deux jours, mon joli L... |
In the project manage app I'm working on it should be possible to edit/delete a ticket if you are the owner of (i.e. the creator of) the ticket and/or the admin of the project the ticket belongs to.
In the template for showing a project I want to use a custom filter to determine this, used as seen here:
{% if ticket|ow... |
OK, this one is an easy and quick stuff, that I’m almost ashame to share. But the thing is, I search for it, and I wasn’t even sure where to look at it. The reason I put it here is because I trying to put together some trick about urwid, stuff I spend some time to looking for, even if it isn’t so much time. If someone ... |
Possible Duplicate:
img = Image.open(fp) AttributeError: class Image has no attribute âopenâ
So I am trying to view pictures in python with tkinter. I installed PIL and I am trying to open a picture but I keep getting an attribute error saying "class Image has no attribute 'open'
from __future__ import division
fro... |
nam1962
[résolu, du coup tuto] Comment nettoyer mauvaise install de langues
Comment peut on récupérer un desktop en francais sous 12.04 ou 12.10 ?
Je viens d'installer un Airis pour un ami en Xubuntu 12.04
Tout est total ok, mais le desktop est en anglais (tous les fichiers locale indique pourtant fr_Fr ou fr UTF8).
Y ... |
So you're writing a MarkLogic application, and this question comes up: How do we deduplicate search results?
In one sense MarkLogic will never return duplicates from a database lookup.A single XPath, cts:search, or search:search expression will alwaysreturn unique nodes, as defined by theXPath is operator.
But your app... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.