text stringlengths 256 65.5k |
|---|
I'm looking for an algorithm and/or Python code to generate all possible ways of partitioning a set of n elements into zero or more groups of r elements and a remainder. For example, given a set:
[1,2,3,4,5]
with n = 5 and r = 2, I would like to get
((1,2,3,4,5),)((1,2),(3,4,5))((1,3),(2,4,5))...((1,2),(3,4),(5,))((1,2... |
Extensions
firebird_fdw 0.2.4
A PostgreSQL foreign data wrapper (FDW) for Firebird
README
Contents
Firebird Foreign Data Wrapper for PostgreSQL
This is an experimental foreign data wrapper (FDW) to connect PostgreSQL to Firebird. It provides basic functionality, including both read (SELECT) and write (INSERT/UPDATE/DEL... |
I am modifying a python script to make changes en masse to a hand full of switches via telnet:
import getpass
import sys
import telnetlib
HOST = "192.168.1.1"
user = input("Enter your remote account: ")
password = getpass.getpass()
tn = telnetlib.Telnet(HOST)
tn.read_until("User Name: ")
tn.write(user + "\n")
if passwo... |
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... |
Using my rudimentary knowledge of Python, I was interested in exploring the use of rpy2 to eventually be able to bring together spatial data analysis done in Python, with some higher level tools in R – in this case the powerful graphics library ggplot2 to visualize the results.
My setup is Mac OS 10.7.3, Python 2.7, R ... |
I'm attempting to:
load dictionary
update/change the dictionary
save
(repeat)
Problem: I want to work with just 1 dictionary (players_scores) but the defaultdict expression creates a completely seperate dictionary. How do I load, update, and save to one dictionary?
Code:
from collections import defaultdict#for manipula... |
So this is my first project with Django. As a result, I seem to learn new things about how it handles models every day. Because of this, my database is changing every day. Each time I want to update my database, I need to drop it, create it, run syncdb, and then populate it with user data. I was hoping to automate this... |
I am creating a Quickly application that makes use of Python Twisted. When the user launches a window, I want to start the Twisted server I wrote. However, when I do this, it freezes the GUI, because the reactor.run method is constantly running after it is started. I need a way to start the Twisted reactor in its own t... |
Kedoc
Re : script install wifi BCM94311MCG
Petit point...
Je me suis aperçu ce soir qu'il me suffit d'utiliser l'interrupteur matériel de ma carte pour l'éteindre et la rallumer, un coup au démarrage sous Ubuntu, et je peux ensuite l'utiliser (en wifi ouvert, et en WEP, ça fonctionne).
Je n'ai pas encore bien compris, ... |
#1676 Le 28/06/2012, à 20:51
AnsuzPeorth
Re : [glade2script-GTK2] Interface graphique pour script bash ou autre.
re,
Bon, pour les whitelits, il faut indiquer la section et la variable ... Je vais réfléchir pour faire mieux ... Mais je pense que ce sera dur de faire différent, il faut bien indiquer la section et la var... |
Cartesian Tree-Product May 02, 2013
I have to admit that my day-to-day life involves very little algorithmic problems, but here and there I get a chance to think. In this post, I'd like to discuss an interesting problem that I've met several times already in my programming career, each time in different settings. When ... |
Mibixy
Re : Live Voyager 12.10
bonjour, bonsoir, joyeux noël
voilà je viens poster là parce qu'après de longues recherches, (peut-être pas au bon endroit.. pas avec les bons mots clefs je ne sais pas...) je ne trouve pas de script de connexion vpn pour les intégrer à wicd... NM fonctionne très mal chez moi. pourquoi ? ... |
Remember that in Python we want to use "duck typing". So, anything that acts like a list can be treated as a list. So, don't check for the type of a list, just see if it acts like a list.
But strings act like a list too, and often that is not what we want. There are times when it is even a problem! So, check explicitly... |
As I get from your question, you want to insert something in HTML code behind a letter of which you know the index in plaintext. If that is the case, I think the easyest solution would be to ignore all the html tags and count only the letters outside them. You could do it like this:
def insertInHtml(string, insstr, pos... |
I have Table
# File : MyRelations.py
ACC_ADD_TABLE = Table('acc_add_rel', METADATA,
Column('acc_id', ForeignKey('acc.id'),
nullable=False),
Column('add_id', ForeignKey('address.id'),
nullable=False),
PrimaryKeyConstraint('add_id', 'acc_id'),
)
# File : Address.py
class Address... |
nicky940
Re : Generateur de sources.list en Francais
bonsoir
je suis un nouvelle utilisateur d'ubuntu l'installation c'est dérouler a merveille version 9.10 jai depuis quelque temps un problème avec les mise jour qui m'indique un sens interdit qui m'indique ce message d'erreur :un problème irrémédiable est survenu pend... |
gege1809
installation de libboost Resolu
je veux installer un logiciel de radio numerique (gqrx)sur mon pc sous ubuntu 12.04 et pour cela j ai besoin de libboost-all-dev mais quan je lance l installation (sudo apt-get-install libboost-all-dev) j aiune erreur bizarre sur des dependances
Lecture des listes de paquets... ... |
I'm a newbie programmer and new to Google App Engine and webapp2 etc. So this may be a very basic question.
I am creating an application to store images into BlobStore. My model stores description, blob_key, image url and date.
I am able to save everything, so that bit is okay.
But now I want to create a delete button ... |
Example:
I wanted to [...] himâto let everything out.
What's a common word to use in this cases?
I'm looking for something similar to spit as in to spit something out. Like, when you say something harmful to someone because of anger.
If you want to express the idea of "
or you can also use phrases like
Out with it is... |
I'm trying to create this simple game but I'm having trouble. Here's the code, it keeps on looping the different answers. Please excuse the terrible story, could someone please help?
The code should quick if the option is equal to the correct (answer). But it doesn't, it just keeps looping both options until it hits th... |
The purpose is basically that you can define a central entrypoint, if, and only if, the script is directly run on its own. Because __name__ will only ever be equal to '__main__', if it is run on its own. Putting your scriptâs actual content into a separate function allows other scripts to import said function and run... |
I've installed iPython + SciPy Superpack on a Mac (OSX Lion).
If I plot using matplotlib.pyplot, it will pop up a window with the graph, and I close this for the ipython kernel to continue.
from matplotlib import pyplot as plt
plt.plot([1, 2, 3], [3, 6, 9])
plt.show()
However, If I try the inline (starting with --pyla... |
# -*- coding: utf-8 -*-
import os
import fbconsole
here = os.path.dirname(os.path.abspath(__file__))
def fbfeed():
fbconsole.APP_ID = '588914247790498'
fbconsole.AUTH_SCOPE = ['publish_stream', 'publish_checkins', 'read_stream', 'offline_access']
fbconsole.authenticate()
newsfeed = fbconsole.get('/me/ho... |
class AlarmBox(Widget):
hour = ["12","1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"]
tensMin = ["0", "1", "2", "3", "4", "5"]
onesMin = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
day = ["AM", "PM"]
txt_inpt = ObjectProperty(None)
def print1(self):
self.txt_inpt.text("HI... |
I am attempting to provide a function in python that will search a list based on user input and return all matching rows within that list.
For example if the user types in hello it will return any occurrence of hello in that list.
So far I have this:
if(prefixes in list):
matching = [s for s in list if prefixes... |
Can I get console input without echo in python?
Use getpass:
>>> from getpass import getpass
>>> getpass()
Password:
'secret'
Maybe the 'console' module is your only bet (it's kinda 'fork' of the curses module for Unix), however I haven't seen anything related to terminal echo disabling in its homepage, you might try ... |
So I have this program that searches the SEC Edgar database for annual reports (10-K's), and returns a list of 40 different items in a listbox. Well I want to create a 'Next 40' button which displays the next 40 items in the listbox, which the following code accomplishes:
def Next():
global entryWidget
page = 'http://w... |
the python keyword is is supposed to be used in place of the == operator according to python style guides.
However they don't always do exactly the same thing as shown here. Why? What is the actual difference, and what is the proper usage?
import unittest
class testIS(unittest.TestCase):
def test_is(self):
... |
Consolidation, integration, refactoring, and migration are some of today's popular data center catchwords. All of these words reflect some kind of renewal or replacement process--the old is either substantially modified or thrown in the garbage and replaced with the new. However, in many cases, we are often stuck with ... |
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...
5,056 users here now
What games are on TV in my area?
Game ThreadWild Card Game Thread: Minnesota Vikings at Green B... |
l e . n o x
Re : GFrun - Running - Garmin Forerunner 60 - 405CX - 310XT - 610 - 910XT
Merci Sorbus pour tes retours,
BUG : "UnboundLocalError: local variable 'ID_MA_MONTRE' referenced before assignment" === > FIXED Maintenant INFO : Ce bug va te bloquer quand tu voudras utiliser le plugingarmin avec firefox.
Essaye à n... |
Programming WebLogic Web Services
A SOAP message handler intercepts the SOAP message in both the request and response of the Web Service. You can create handlers in both the Web Service itself and the client applications that invoke the Web Service. Refer to Using SOAP Message Handlers to Intercept the SOAP Message for... |
I'm a bit stuck with the following situation:
I'm using an ajax call to submit a form, i use the form values to do some 'query' in django. When this happened and i got the correct queryset it delivers me an HttP response in the form of a csv. I setted up the headers and all stuff needed to get the 'save file as' window... |
I have this filtering mechanism that works, however, it is not very elegant. There has to be a better way to write this. Any recommendations would be greatly appreciated.
The user is able to select from multiple filters to filter the list:
forms.py
class FilterForm(forms.Form):
def __init__(self, *args, **kwargs):
... |
I've got a model that has the following code:
class PhillyCheese(models.Model):
description = models.CharField(blank=True, max_length=255)
quality = models.CharField(blank=True, max_length=255)
packing_date = models.DateField(blank=True, null=True)
shipping_date = models.DateField(blank=True, null=True)... |
This chapter describes how to configure shared disk subsystems to deploy Real Application Clusters in environments that do not support (or for which you do not want to use) a cluster file system (CFS). If your system supports CFS and you do not want to use raw devices as described in this chapter, then proceed to Chapt... |
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... |
#1626 Le 13/05/2012, à 15:13
Hizoka
Re : [glade2script-GTK2] Interface graphique pour script bash ou autre.
echo "TERM@@SEND@@$cmd\n"
sleep 3 # permet de laisser le temps au process d'etre créer
pid=$(pidof cdrdao)
while kill -0 $pid >/dev/null; do
sleep 0.2
## barre de progression ####### ... |
I could be wrong (or misinterpreting your question :) ), but I believe the a connection-related exception gets thrown on MySQLdb.connect(). With MySQLdb, the exception to catch is MySQLdb.Error. Therefore, I would suggest moving the db setup inside of the try block and catching the proper exception (MySQLdb.Error). Als... |
I am running code on python to send and receive from RabbitMQ queue from another application where I can't allow threading. This is very newbie question but, is there a possibility to just check if there is message and if there are no any then just quit listening ? How should I change basic "Hello world" example for su... |
Multi dimensional (axial) slicing in Python
(Ilan Schnell, April 2008)
Recently, I came across numpy which supports working with multidimensional arrays in Python. What exactly is a multidimensional array?
Consider a vector in three dimensional space represented as a list, e.g. v=[8, 5, 11]. This is a one dimensional a... |
In Python 2.6 and earlier, the dict constructor can receive an iterable of key/value pairs:
d = dict((key, value) for (key, value) in iterable)
From Python 2.7 and 3 onwards, you can just use the dict comprehension syntax directly:
d = {key: value for (key, value) in iterable}
Of course, you can use the iterable in a... |
evann83
Mode superutilisateur
Bonjour
Me voici avec un soucis que je n'arrive pas a résoudre:
j'aimera utiliser la commande "javac" pour pouvoir compiler un fichier java sur mon bureau mais apparement il n'a pas envie puisque il me demande d'installer la JDK, logique je me suis dis après coups. Me voilà parti pour inst... |
Babdu89
Re : HY-D-V1 un nouveau Desktop
Bonjour...
Alors, comme j'ai toujours du temps, de la place sur mes hdd, et de la suite dans les idées ...
Toujours au sujet de la tentative d'Hybrydiser la Cubuntu 13.04 32 bits ... Voir post ci-dessus .
J'ai réinstallé, j'ai fais les maj système en commande, j'ai été obligé d'i... |
I am building a Pong clone in Pygame. I can't figure out how to add collision detection to the ball and paddles so the ball will bounce off the paddles. How can I do this? How can I have the ball go the opposite direction when it hits the paddles?
bif="bg.jpg"
import pygame, sys
from pygame.locals import *
pygame.init(... |
bipede
Re : Besoin de testeurs pour Pap'rass
Merci bipede
Il n'y a pas de quoi
Ca fonctionne pour ton scanner ?
Hors ligne
jeremix
Re : Besoin de testeurs pour Pap'rass
Oui, ça fonctionne, mais je retape la valeur voulu à chaque fois (au cas où ça provoquerais un problème), car cela m'affiche 2 résolutions différentes.... |
If I am evaluating a Python string using eval(), and have a class like:
class Foo(object):
a = 3
def bar(self, x): return x + a
What are the security risks if I do not trust the string? In particular:
Is eval(string, {"f": Foo()}, {})unsafe? That is, can you reach os or sys or something unsafe from a Foo insta... |
A Bright, Shiny Service: Sparklines
I really was working on the bookmark web service—really, I was!—but I got distracted. What grabbed my attention was Sparklines.
What are Sparklines?
Sparklines, as defined by Edward Tufte, are intense, simple word-sized graphics. They are small graphics embedded within a context of w... |
Mornagest
[Résolu] Pilotes Nouveau sur 12.04 refusent de s'installer
Salut les gens,
J'ai constaté avec effarement que j'ai des pilotes proprio nVidia installés sur ma machine, ce qui ne m'intéresse absolument pas. J'ai donc voulu les remplacer par les pilotes Nouveau, mais... impossible de les installer
:~$ sudo apt-g... |
Beginners Guide to Writing Flask Apps on OpenShift
In my previous blog How-to Install and Configure a Python Flask Dev Environment & Deploy to OpenShift I demonstrated how to prepare your local development environment for developing python apps. I also showed you how to create a simple “hello world” app and deploy it o... |
bidou10
mise à jour de sécurité importante
bonjour à tous,
depuis un petit moment, j'ai une mise à jour de sécurité importante qui ne veut pas se faire, elle apparait à chaque fois décochée.
j'ai essayé cette commande dans le terminal, mais je ne suis pas très fort dans ce domaine et j'aimerai avoir un petit coup de ma... |
Im trying to do a HEAD request of a page.
I am trying
import misc_urllib2
.....
opender = urllib2.build_opener([misc_urllib2.MyHTTPRedirectHandler(), misc_urllib2.HeadRequest()])
with misc_urllib2.py containing
class HeadRequest(urllib2.Request):
def get_method(self):
return "HEAD"
class MyHTTPRedirectHand... |
I'm a bit confused about what can/can't be used as a key for a python dict.
dicked = {}
dicked[None] = 'foo' # None ok
dicked[(1,3)] = 'baz' # tuple ok
import sys
dicked[sys] = 'bar' # wow, even a module is ok !
dicked[(1,[3])] = 'qux' # oops, not allowed
So a tuple is an immutable type but if I hide a li... |
I'm not sure if this is what you're asking for but this is how I would turn a dictionary into a list using its key as a tupled value.
new_list = []
dict = {test:1, test:2, test:3}
for key, value in dict.iteritems():
new_list.append((key, value))
Here is where I am doing something very similar to what you want.
if ... |
cledesol
Re : [Conky] Alternative à weather.com ( icones conkyforecast )
Merci de cette précision.
C'est vrai aussi qu'en général c'est le soir que je me loggue sur mon PC ....
Donc, la météo du jour ... je l'ai vue en réel
CM : Asus M4A88TD-M µ : AMD Phenom II X6 1055T / RAM 4 Go
Video : EVGA GeForce GTS450 1Go - Ubun... |
peterp@n
Re : Logiciel de CAO 2D/3D (Conception Mecanique)
Cool, ca se paufine bien tout ça.
C'est avec quelle versions exactement la vidéo ?
Ubuntu 12.04 64bits, Raspbian “wheezy”, Tango Studio sauce debian
Un bureau d'études techniques pour le bâtiment avec des logiciels libre.
Entreprise de construction bois. - Form... |
I have a perl program that retrieves data from the database of my university library and it works well. Now I want to rewrite it in python but encounter the problem <urlopen error [errno 104] connection reset by peer>
The perl code is:
my $ua = LWP::UserAgent->new;
$ua->cookie_jar( HTTP::Cookies->new() );
$ua->... |
Topic: Error 500, Upgrading from OpenSource to Pro
Hi Guys !
Finaly i buyed this Masterpiece of Mailserver and now i upgraded to iRedAdmin Pro.
Used the guide from Zhang.
in my apache log i get this error:
[Thu Oct 07 13:31:22 2010] [error] [client 80.123.169.178] mod_wsgi (pid=3289): Target WSGI script '/usr/share/apa... |
Very interesting question, and clever trick.
Let's look at a simple example of getting a single byte manipulated. Using unsigned 8 bit for simplicity. Imagine your number is xxaxxbxx and you want ab000000.
The solution consisted of two steps: a bit masking, followed by multiplication. The bit mask is a simple AND opera... |
I am seeking for advice, how I can improve this in terms of speed:
My Data-model:
class Events(ndb.Model):
eventid = ndb.StringProperty(required=True)
participants = ndb.StringProperty(repeated=True)
The way I try to get the data:
def GetEventDataNotCached(eventslist):
futures = []
for eventid in event... |
Context: I'm working on this problem:
There are two stacks here:
A: 1,2,3,4 <- Stack Top B: 5,6,7,8
A and B will pop out to other two stacks: C and D. For example:
pop(A),push(C),pop(B),push(D).
If an item have been popped out , it must be pushed to C or D immediately.
The goal is to enumerate all possible stack conte... |
I have djcelery installed and it seems it's installed properly:
In [1]: from djcelery import models
In [2]: models.PeriodicTask
Out[2]: djcelery.models.PeriodicTask
However, when I access the admin site, I get this error which seems to imply that there's an issue with djcelery. I suspect it has to do with my setup. Th... |
I have an unusual case. In my models.py, I have an Event element, and two different types of user elements that refer to it as seen below.
class User(models.Model):
attending = models.ManyToManyField('Event', related_name='User_attending')
hosting = models.ForeignKey('Event', related_name='User_hosting')
... |
I'm using a Python autocomplete plugin from bassistance.de but I'm receiving a 500 error when typing, instead of suggestions.
Firebug states a 500 while Python is reporting a name error at line 200 inside my views.py.
"global name 'HttpResponse' is not defined"
Error copied from Firebug:
GET http://127.0.0.1:8000/ajax/... |
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... |
If you use django 1.5 and newer use:
{% verbatim %}
{{if dying}}Still alive.{{/if}}
{% endverbatim %}
If you are stuck with django 1.2 on appengine extend the django syntax with the verbatim template command like this ...
from django import template
register = template.Library()
class VerbatimNode(template.Node)... |
Let's say you have a static page called hello.html and you wish to turn it into a Blog. Here is one way to do it.
For the sake of the argument we will assume that the hello.html contains
<html><head><title>Hello World</title></head> <body> <img src="image.jpg"/> Please say something here! </body> </html>
Here is what y... |
node.js and djangode
Edward O’Connor
Django San Diego
node.js is an event-driven networking engine for JavaScript.
Like Twisted, but for V8, not Python.
Watch the video.
Grab it from github
# http://github.com/ry/node
./configure
make
sudo make install
Give it a spin
var http = require('http');
http.createServer(funct... |
sputnick
[JEU] #! /challenge/bash #8
<< challenge bash #8
Le challenge est ouvert à tous les langages de scripting ! scripteurs bash, python, perl, ruby… à vos claviers !
Robot web pour récupérer les nouveaux fils des sous-forums Ubuntu de son choix.
L'objectif est de réaliser un script qui va parser le forum afin d'y ... |
I currently have my Django custom template filter like this:
from django import template
register = template.Library()
@register.filter
def duration(value):
hours = value / 60
minutes = value % 60
hours_string = str(hours) + (" hours" if hours > 1 else " hour" ) if hours else ""
minutes_str... |
September 15, 2011
For most Django apps, indeed most webapps, the bottleneck is the database. The biggest gains usually come from reducing the number of queries used, and adding database indexes. django-debug-toolbar helps a lot here. After that, caching and de-normalization also help reduce database queries.
pip insta... |
malbo
[Tuto] identifier si on est dans un système UEFI ou Bios
ATTENTION : CETTE MÉTHODE D’IDENTIFICATION EST OBSOLÈTE : IL FAUT UTILISER LA PROCÉDURE DE LA DOC : http://doc.ubuntu-fr.org/efi#identifier … n_mode_efi
Le problème se pose pour des PC achetés en 2011 (et +) pour ceux qui souhaitent faire cohabiter Windows ... |
That is okay
By the way, It is going to be a couple of hours before I sleep. The time here is 20:18 PM
'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'
'Huma... |
I'm trying to create a program that can be called from the command line and use keyword arguments in python 2.6. So far I've tried:
#!/usr/bin/python
def read(foo = 5):
print foo
return 0
if __name__ == '__main__'
read()
When I try to run this from the command line: ./test.py the program prints 5 as expect... |
jQuery and Ajax
While web2py is mainly for server-side development, the welcome scaffolding app comes with the base jQuery library[jquery], jQuery calendars (date picker, datetime picker and clock), and some additional JavaScript functions based on jQuery.
Nothing in web2py prevents you from using other Ajax libraries ... |
I am new to python. I would like all the python gurus to suggest some ways to make the following code more pythonic and hence more efficient . Its a simple code to find the edit distance between two words.
P.S. I would like improvements in code, not in the logic or algorithm optimization.
class test:
def __init__(s... |
A good rule of thumb in all things on the Internet is to take whatever's said and tone it down in your mind by an order of magnitude to get an accurate picture.
I really enjoy working with Django. It gets a lot of things right; I think it does better than the competition in most respects. Nevertheless, it's true that i... |
I'm slamming my head against the wall with this one. I've been trying every example, reading every last bit I can find online about basic http authorization with urllib2, but I can not figure out what is causing my specific error.
Adding to the frustration is that the code works for one page, and yet not for another. l... |
I am creating a little Django app with Users and I have created my own UserProfile model.. But I have some issues with my urls(atleast I think). I think the regular expressions I have used are wrong. Check it out:
the error I get:
ValueError at /usr/tony/
invalid literal for int() with base 10: 'tony'
My url:
url(r'^u... |
Possible Duplicate:
Reference: Why does the PHP code in my Javascript not work?
I have been researching for days now and cant seem to find anything that allows me what I need to do.
What I am trying to do, is call a Php function in another file from Javascript. I have a captcha on my contact form, and a Javascript file... |
OK so I have this book Violent Python - A Cookbook for Hackers, Forensic Analysts, Penetration Testers and Security Engineers. I have gotten to page 10 and I'm a complete noob at this but it really fascinates me.
But this piece of code has me stumped:
import socket
socket.setdefaulttimeout(2)
s = socket.socket()
s.conn... |
This is a simple program written to solve CodeJam's recycled numbers (I know it can be improved).
It works with CPython, but crashes with PyPy v1.8 with the error:
RPython traceback: File "jit_metainterp_compile.c", line 19477, in send_loop_to_backend File "jit_backend_x86_assembler.c", line 2293, in Assembler386_assem... |
I'm using the generic CreateView like:
#urls.py
from django.conf.urls.defaults import *
from django.views.generic import CreateView
from content.models import myModel
urlpatterns = patterns('myApp.views',
(r'myCreate/$', CreateView.as_view(model=myModel)),
)
With a mymodel_form.html template like:
<form method="po... |
Gaara
barre de progression sur notification en root [finalisé]
Bonjour,
J'essaie de me faire un petit script qui me prévient avec une notification quand mes mises à jours sont effectuées, en utilisant unattended-upgrades.
J'ai réussi à le faire fonctionner avec yad, mais c'est pas très joli. Je voudrais donc utiliser n... |
I'm trying to return the most common elements in a list (statistical mode). Unfortunately I don't know how to use the all with an iterable. This is what it looks like if I don't use all():
def large(a):
for i in set(a):
for j in set(a):
if a.count(i)<a.count(j):
break
return i
However I know th... |
I am trying to create a csv file from NOAA data from their http://www.srh.noaa.gov/data/obhistory/PAFA.html.
At the moment, I am having problems writing the csv file.
import urllib2 as urllib
from bs4 import BeautifulSoup
from time import localtime, strftime
import csv
url = 'http://www.srh.noaa.gov/data/obhistory/PAFA... |
I have a method (a .yml parser) that takes an input stream as input. The problem is that it throws errors when it encounters certain characters in certain places e.g. %.
What I would like to do is take the stream, replace all of the % with a place holder, and then pass it to the parser.
This is what I have (which doesn... |
I am trying to playback a m3u8 file in Android Emulator.http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8
It's not able to playback the video but audio is heard.
I get the following error E/OMXNodeInstance( 39): OMX_GetExtensionIndex failed.
I traced the calls and I see that the video decoder is not insta... |
I want to execute some processes in parallel and wait until they finish. So I wrote this code:
pool = mp.Pool(5)
for a in table:
pool.apply(func, args = (some_args))
pool.close()
pool.join()
Will I get 5 processes executing func in parallel here?Or the only option is apply_async? |
Other recipes
Upgrading
In the "site" page of the administrative interface there is an "upgrade now" button. In case this is not feasible or does not work (for example because of a file locking issue), upgrading web2py manually is very easy.
Simply unzip the latest version of web2py over the old installation.
This will... |
Scripting Vortex 11
In previous scripts we have generated data using a local Java program, C program, PERL script, and SVL program. In this tutorial rather than have a local application generate the data we will use a web service.
The Virtual Computational Chemistry Laboratory provides a number of free online tools tha... |
I have been looking at The Grinder to see what it is like at performance testing. Though I found the getting started section to cover the tool but it didn't really cover the the I want to click here, here and here and have it just request a page from my web server, so hopefully this will get you past that. I have alway... |
My application is using a scoped session and the declarative style of SQLALchemy. It's a web-app and a lot of the DB insertions are executed by Celery, a task scheduler.
Typically, when deciding to insert an object, my code might do something along the following lines:
from schema import Session
from schema.models impo... |
The problem with rawstring representation is, that you cannot represent everything in a portable (i.e. without using control characters) manner. For example, if you had a linebreak in your string, you had to literally break the string to the next line, because it cannot be represented as rawstring.
That said, the actua... |
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... |
I am having a problem getting matplotlib to work well with interactive plotting... what I see is that after displaying a few frames of my simulated data matplotlib hangs-and doesn't display any more.
Basically I've been playing around a bit with science simulations - and would like to be able to plot my results as they... |
Python is rich with powerful features and expressive syntax. One of my favorites is decorators. In the context of design patterns, decorators dynamically alter the functionality of a function, method or class without having to directly use subclasses. This is ideal when you need to extend the functionality of functions... |
August 12, 2013 - by Mr. Max Bruning
Over time, I have received email from various people asking for help either recovering files or pools or datasets, or for the tools I talk about in the blog post and the OpenSolaris Developers Conference in Prague in 2008. These tools were a modified mdb(1) and a modified zdb(1M). I... |
Jun 16, 2013 at 9:45pm UTC
Dear fellow programming enthusiasts,
I have been sharpening my coding skills for the past few days and what better way to do that than solve Google's programming challenges. The following code is my solution to this problem:
https://code.google.com/codejam/contest/351101/dashboard#s=p0
My pro... |
GraphX Programming Guide
Overview
Getting Started
The Property Graph
Graph Operators
Pregel API
Graph Builders
Vertex and Edge RDDs
Optimized Representation
Graph Algorithms
Examples
Overview
GraphX is the new (alpha) Spark API for graphs and graph-parallel computation. At a high-level, GraphX extends the Spark RDD by ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.