text stringlengths 256 65.5k |
|---|
I need to send a file to another server using oauth and webpy. For now I'll ignore the oauth part as sending the file itself is already a challenge.
Here's my partial code:
class create_video:
def POST(self):
x = web.input(video_original={})
At this point I want to send the file over the network using urllib2. N... |
i have a user input 'n' and i am finding the square root. Which i know is math.sqrt(n), but i need to make the program continue find the square root until it is less than 2. also return to the user how many times the program ran to find the root less than 2 using a counter. I am using python.
So far:
import math
root =... |
I'm having some trouble sorting data from a text file by a certain field. Possibly by multiple fields later. The .txt is several thousands of lines of code. I'm brand new to python so my code is probably a bit messy. For example, this is the textfile i would read from:
stuff
123 1200 id-aaaa stuart@test.com
322 1812 id... |
In xfce I would like to switch to a particular workplace by pressing two keys after each other. for example first F2 and than the letter A. Control-A together is hard to type for me.
This program, switches to screen 0-9 and a-z, (11 - 37). It needs to callable
import subprocess
import Tkinter as tk
class App(object):
... |
I read this: "The ubuntu-support-status command will print the exact status of your system. " but when i try i get this:
$ ubuntu-support-status
Traceback (most recent call last):
File "/usr/bin/ubuntu-support-status", line 105, in <module>
(still_supported, support_str) = get_maintenance_status(cache, pkg.name, su... |
How to find devices on your local network
May 30, '06 07:30:00AM • Contributed by: robg
May 30, '06 07:30:00AM • Contributed by: robg
Experienced Unix users, look away now, please -- the following is a
Some versions of the
See, I told you it was a simple hint. And yet, in all my years of OS X usage, I had no idea y... |
I tested this question with Sage, and the experiment suggests a clear pattern of asymptotics. Most polynomials are irreducible. Of the reducible ones, a third are of course divisible by $x$ (Edit: If 0 coefficients are allowed; see below.) An $O(1/\sqrt{d})$ fraction are each divisible by $x+1$ and $x-1$. That's becaus... |
Ce cours est visible gratuitement en ligne.
Ce cours existe en livre papier.
Ce cours existe en eBook.
Vous pouvez obtenir un certificat de réussite à l'issue de ce cours.
J'ai tout compris !
J'entends souvent dire qu'un langage de programmation orienté objet n'incluant pas l'héritage serait incomplet, sinon inutile. A... |
I would like to have a 3d plot with matplotlib.
Data are the following: I have a matrix with each row containing Y coordinates for the 3d plot. Each row first elements are the X coordinates for the 3d plot. Finally, a second matrix contains high for each point, at a X,Y position. This second matrix thus contains my Z c... |
JavaScript
stevemtno — 2012-01-10T12:51:47-05:00 — #1
I'm guessing this is a pretty easy problem to fix, but I can't find any code that will do what I need.
I have a group of images (all different sizes). Each image will have a corresponding text link. I need to be able to click on one of the text links and display the... |
#0 Re : -1 » Attention !! - WD Caviar Green problèmes de parquages sous linux. » Le 04/01/2013, à 08:45
djibi
Réponses : 466
Bonjour,
J'ai acheté un disque dur WD caviar green WD20EARX en aout, ce n'est qu'après que j'ai remarqué ce post-ci.
Je me suis renseigné à propos du patch à appliquer quelques jours après avoir ... |
I've been a fan of using yield to create generators in Python for a long time, and when I was dragged into the world of C#, I was thrilled to see that it supports this pattern as well.
Generators with yield
The yield pattern is a great way to “generate stuff” to be iterated over, and do so in a clear and easily readabl... |
galanga
Re : Qarte arte.tv browser (ex Qarte+7)
@Christophe: content de voir que cela a commencé à fonctionner... Pour le second cas qui fait une erreur, c'est parce qu'il manque un back slash sur le guillemets fermant de ...3789-visual-crop-medium.jpg ; essayez avec cela :
items.append("<item>\n <title>Dominique ... |
ZhangHuangbin wrote:
*) You should remove it from Postfix, that's why you need this plugin for per-user restriction.
Check!
It works now. I just updated the plugin a little:
"""Reject sender login mismatch (sender in mail header and SASL username)."""
import logging
from libs import SMTP_ACTIONS
REQUIRE_LOCAL_SENDER = ... |
mao-40
Re : TBI + wiimote + ubuntu
En ce qui concerne 'gtkwhiteboard.ico', ce n'est pas l'image de calibration je pense, puisque le logiciel demande de calibrer l'écran avec les 4 coins du bureau et après cela fonctionne bien.
Ah ok, j'essaierai au demain au vidéo-projcteur.
Dernière modification par mao-40 (Le 04/02/2... |
I have written the following heap sort code and I get the wrong output (not sorted) at times and I can't seem to find why...any help will be much appreciated! (WARNING: I am still learning Python that might be the problem)
def heap_sort(self, a):
self.build_max_heap(a)
n = len(a)-1
i = len(a)-1
for i in... |
Hi I need really very very simple example. First my models:
#This my student models
from django.db import models
SEX_CHOICES= (
('M', 'Male'),
('F', 'Female'),
)
class Students(models.Model):
student_name = models.CharField(max_length=50)
student_sex = models.CharField(max_length=8, choices=SEX_CHOICES)... |
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 ? ... |
refatboobs
Connexion trop lente
Bonjour à toutes et à tous,
Dans un premier post je vous faisais déjà part de mes soucis de connexion mais personne n'avait su me répondre. J'ai tenté l'aventure solitaire (formatrice mais un brin agaçante quand rien ne marche...) et j'en suis aujourd'hui au même point, ou presque. Je su... |
importlib may be more appropriate, as it uses/implements the PEP302 mechanism.
Follow the DictImporter example, but override find_module to find the real filename and store it in the dict, then override load_module to get the code from the found file.
You shouldn't need to use sys.path once you've created your Storage ... |
Image and ImageItem
An ImageItem object is an image component that contains a reference to an Image object. First, let's briefly introduce the Image class. We will revisit it again later when we talk about low-level APIs.
The Image class is used as a graphical image data holder. Depending on how they are created, image... |
Author goska
Submission date 2012-02-06 14:56:03.505099
Rating 5289
Matches played 441
Win rate 53.74
Use rpsrunner.py to play unranked matches on your computer.
import random
class RPS:
def __init__(self):
self.num = 0
self.statistika = [0 for x in range(6)]
self.strat = [True for x in rang... |
I decided to switch from windows 7 to Ubuntu 12.10. I had windows 7 on partition C: and other files (photos, music etc.) on partition D:. During installation I chose C: partition for Linux and checked box to encrypt drive. Now on Ubuntu I can't mount d: partition. It seems that partition doesn't exist. What to do? Did ... |
mac-gyver31
Re : Client Ubuntu + Active Directory et partage avec Windows serveur 2003
En fait ce post est plutôt tournée vers l'intégration d'un ordi dans un domaine windows 2003 dans le cadre d'un serveur LTSP.
Un serveur LTSP ?? Tu veux dire Linux Terminal Server Project ?
T'es sûr ? Car je ne vois pas bien le rappo... |
My python is a little bit rusty (anyone can feel free to edit this code to make corrections, if I've messed up the syntax somehow), but here goes....
def movingAverageExponential(values, alpha, epsilon = 0):
if not 0 < alpha < 1:
raise ValueError("out of range, alpha='%s'" % alpha)
if not 0 <= epsilon < alp... |
BeanBag — Easy access to REST APIs in Python
I’ve been doing a bit of playing around with REST APIs lately, both at work and for my own amusement. One of the things that was frustrating me a bit was that actually accessing the APIs was pretty baroque — you’d have to construct urls manually with string operations, manua... |
Not much, at least in relation to the player.
Calculating the exact amount of damage output by mecha knights is tricky. We don't get to see the numbers coming out from the Mecha Knight, and we also only have a visual metric of enemy HP in their health bars. That being said, we do have damage numbers coming out from the... |
Knews (Karl's threaded newsreader for X) estas legilo por diskutgrupoj, kiu kapablas rekoni kaj skribi gxustajn MIME-kapliniojn pri la signokodo. Por uzi Latin-3 oni devas aldoni kelkajn liniojn al la agordaj dosieroj.
Dum la instalo de Knews, la dosiero Knews.ad estas kopiata el la fontdosierujo al /usr/X11R6/lib/X11/... |
Update: based on Lee's comment I decided to condense my code to a really simple script and run it from the command line:
import urllib2
import sys
username = sys.argv[1]
password = sys.argv[2]
url = sys.argv[3]
print("calling %s with %s:%s\n" % (url, username, password))
passman = urllib2.HTTPPasswordMgrWithDefaultReal... |
I'm trying to embed a new document in a previously existing document. When the object was created, the root document looked like this:
class MongoPoll
include Mongoid::Document
embeds_one :region_count, :as => :voteable, :class_name => 'VoteCount'
I've added a few new embedded documents of the same class:
embeds_o... |
grim7reaper
Re : /* Topic des codeurs [8] */
On va prendre une autre approche : vous me conseillez quoi pour commencer, dans un cas et/ou dans l'autre ?
Pour Haskell, le fameux Learn You a Haskell for Great Good! (une traduction existe, je ne sais pas ce qu’elle vaut), si tu veux approfondir il y a aussi Real World Has... |
I need to create a model in the ArcGIS ModelBuilder. I am working with a feature class of zip-codes for a state. I have got to the point where the zip-codes that have duplicates are selected from the feature class. There is a field called "Spots" within this feature class that has numeric values from 0-10. Of the zip-c... |
So I'm quite new to SQLAlchemy.
I have a model Showing which has about 10,000 rows in the table. Here is the class:
class Showing(Base):
__tablename__ = "showings"
id = Column(Integer, primary_key=True)
time = Column(DateTime)
link = Column(String)
film_id ... |
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 ... |
But why use interfaces in python? We will use the simpler structure:
class Leaf:
def do_this(self):
pass
class Composite(Leaf):
def do_this(self):
pass
def add_item(self):
pass
It looks too easy. To be able to feel any benefit here is an example of the console menu development:
class... |
Module cpp
source code
SCons C Pre-Processor module
FunctionEvaluator
Handles delayed evaluation of a #define function call.
PreProcessor
The main workhorse class for handling C pre-processing.
DumbPreProcessor
A preprocessor that ignores all #if/#elif/#else/#endif directivesand just reports back *all* of the #include ... |
Requirements Review
use argparse (I will ignore this one)
allow one or two actions to be called (at least one required).
try to by Pythonic (I would rather call it "POSIX"-like)
There are also some implicit requirements when living on command line:
explain the usage to the user in a way which is easy to understand
opti... |
So, I'm trying to submit a form with urllib/urllib2 which should set some a cookie to log me in. However, the website seems convinced that "cookies are not enabled" though I've told urllib to process cookies.
This is what my code looks like:
opener = urllib2.build_opener( urllib2.HTTPCookieProcessor() )
urllib2.install... |
leYB
Re : lexmark x2670
Que dit :
ls -l /usr/local/lexmark/lxk08/bin/printdriver
-rwxr-xr-x 1 root bin 63851 2008-11-06 09:47 /usr/local/lexmark/lxk08/bin/printdriver
Hors ligne
leYB
Re : lexmark x2670
En changeant le groupe c'est toujours pareil?
sudo chgrp root /usr/local/lexmark/lxk08/bin/printdriver
Cela donne:
~... |
The property decorator only works with new-style classes; that is to say, classes that inherit from object. Acquisition (which gives you access to the global REQUEST object via attribute access) on the other hand is very much 'old-skool' python and the two do not work well together, as property ignores acquisition wrap... |
bleuberry
Re : [astuce] Un fichier HOSTS qui combat les pubs et liens malveillants !
si sa fonctionne sur chrome Adblock ?:P
Dernière modification par bleuberry (Le 22/02/2010, à 11:24)
Hors ligne
sergeG75018
Re : [astuce] Un fichier HOSTS qui combat les pubs et liens malveillants !
Ça fonctionne pas avec epiphany
Hors... |
Here is a quick and dirty system monitor that I hacked together out of python:
It uses the "System Monitor Indicator" (here) to call the script that I wrote.To use it:
install indicator-sysmonitor. To do that, run the following command:
sudo apt-add-repository ppa:alexeftimie/ppa && sudo apt-get update && sudo apt-get ... |
So my django book is back at university and I'm struggling to work this one out.
I've subclassed django.forms.widgets.MultiWidget like so:
class DateSelectorWidget(widgets.MultiWidget):
def __init__(self, attrs=None, dt=None, mode=0):
if dt is not None:
self.datepos = dt
else:
... |
I am trying to search Apache log files for specific entries related to specific vulnerability scans. I need to match strings from a separate file against the URI content in the weblogs. Some of the strings I am trying to find contain repeating special characters like '?'.
For example, I need to be able to match an atta... |
As promised, here is a follow up tutorial on the node.js/socket.io/backbone.js/express/connect/jade/redis stack that powers nodechat.js.
The first nodechat.js tutorial introduced some fancy ideas, like using backbone.js on the server and streaming models over socket.io which is all well and great, but it left some of t... |
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... |
This is my 1st. software/game written in Python. It was written during my free time and took several months to complete. I learnt a lot during this project and I think this is the best way to learn a language well. The source code is given below and also the download link for the WINDOWS installation. Enjoy the game an... |
Is it possible to extract data points from moving average data?
In other words, if a set of data only has simple moving averages of the previous 30 points, is it possible to extract the original data points?
If so, how?
+1 to fabee's answer, which is complete. Just a note to translate it into R, based on the packages t... |
HowToFirefoxandFlashplayer
Firefox and Flashplayer on DragonFlyBSD
Unfortunately, a Flash plugin is not natively available for DragonFlyBSD. When you want to watch Flash sites, you must install Linux versions of Firefox and the Flash player to run under emulation.
Installing Linux emulation layer on DragonFlyBSD
First,... |
I tested this question with Sage, and the experiment suggests a clear pattern of asymptotics. Most polynomials are irreducible. Of the reducible ones, a third are of course divisible by $x$ (Edit: If 0 coefficients are allowed; see below.) An $O(1/\sqrt{d})$ fraction are each divisible by $x+1$ and $x-1$. That's becaus... |
I'm using some slow-ish emit() methods in Python (2.7) logging (email, http POST, etc.) and having them done synchronously in the calling thread is delaying web requests. I put together this function to take an existing handler and make it asynchronous, but I'm new to python and want to make sure my assumptions about o... |
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
java.lang.Objectorg.apache.commons.math3.complex.Complex
public classComplex
Representation of a Complex number, i.e. a number which has both a real and imaginary part.
Implementations of arithmetic operatio... |
I compile a project in C + +. The project uses a library PCRE. The project is not written by me. I run the SH-file. On Ubuntu 10.10 and 11.04 is compiled. At 11.10 - no.
This error occurs when:
g + + MorphGen.orst-Wl, - start-group -L/usr/local/lib-lpcrecpp -L/usr/local/lib-lpcre -L../LemmatizerLib /-lLemmatizerrst -L.... |
The origin of the term “Life hacks” was all about engineers who would build tools to help them in their daily life. As I’ve gotten more familiar with languages like Applescript, PHP, and Python, I’ve been creating more of these hacks to help out with things I do on my Mac.
Here’s a grab bag of some of those I’ve create... |
I'm parsing the National Weather Service alerts feed into a web application. I'd like to purge the alerts when they hit their expiration time. I'd also like to display the expiration time in the local time format for the geographic area they pertain to.
The alerts cover the whole US, so I think the best approach is to ... |
Simple Python Queue with Redis
The following article shows how to use redis to build a simple multi-producer, multi-consumer Queue with an interface similar to the python standardlib queue. With this queue you can easily share data between multiple processes or offload time consumig calculations to multiple worker proc... |
michelk
la lecture de flux radio ne fonctionne plus(ubuntu 12.10 - rhythmbox)
Bonjour,
Après une mise à jour, la lecture de flux radio ne fonctionne plus (ubuntu 12.10 - rhythmbox). Lorsque je clique sur les noms des radios, celles-ci s'affichent avec un sens interdit. J'ai essayé de lancer rhythmbox à partir d'un term... |
Иван Веселов
Роман Чепляка
Содержание
Опубликовано в журнале OpenSource, выпуски 27, 28, 29.
Сегодня доступно множество самых разных оконных менеджеров, но большинство из них, вопреки названию (“manage” по-английски — “управлять”) перекладывают работу по управлению окнами на пользователя. Действительно, чтобы создать у... |
I'm having a bad time with date parsing and formatting today.
Points for somebody who can parse this date format into a datetime.date or datetime.datetime (I'm not too fussy but I'd prefer .date):
5th November 2010
Using dateutil:
In [2]: import dateutil.parser as dparser
In [3]: date = dparser.parse('5th November 2010... |
cx_Freeze is the only tool I found (as of today) that is compatible with Python 3. It works great. I did have to fix the path in cxfreeze.bat due to my custom installation directory of Python 3.2. But other than that it was really simple. Just copy & paste the command from the documentation:
cxfreeze hello.py --target-... |
Prevent ArcGIS Server 10.1 Services From Placing Locks On Your Data.
A lot of uses at ArcGIS Server 10 would have been used to going into their service config files and updating the SchemaLockEnabled tag to false, this stops AGS creating locks on your data.
At 10.1 this and a lot of other admin tasks can be done direct... |
Update: based on Lee's comment I decided to condense my code to a really simple script and run it from the command line:
import urllib2
import sys
username = sys.argv[1]
password = sys.argv[2]
url = sys.argv[3]
print("calling %s with %s:%s\n" % (url, username, password))
passman = urllib2.HTTPPasswordMgrWithDefaultReal... |
Module DisplayRepresentation
source code
Represent information for graphical display.
Classes in this module are designed to hold information in a way that
makes it easy to draw graphical figures.
RAINBOW_COLORS = {(1, 1): Color(.933333,.509804,.933333,1), (2...
__package__ = 'Bio.Graphics'
RAINBOW_COLORS
Value:
{(1, 1... |
Componentes y Agregados (plugin)
Los componentes y los agregados o plugin son características relativamente novedosas en web2py, y existen diferencias entre los desarrolladores sobre qué son o qué deberían ser. La confusión deriva mayormente de los distintos usos de esos términos en otros proyectos de software y del he... |
Most of the time, the icon will be chosen from your current icon theme, rather than being referred to as an absolute path.
Open Gedit
Drag the launcher into the Gedit window
Look for the Icon definition:
Icon=gnome-panel-launcher
You can then find the icon somewhere in /usr/share/icons, depending on your theme.
Here's ... |
ffmpeg -i input.3gp -someoptions output.flv
will by default always use a framerate of 30 for output regardless of the framerate of the source file.
I know how to set a given framerate e.g. "-r 15" for 15fps but how do I set the framerate to "same as source"?
Here's the output from ffmpeg:
$ ffmpeg -i video7741.3gp -ar ... |
For the past four or five months I’ve been helping out and contributing to the Pinax project which is gaining popularity and buzz very quickly. If you’re not up to speed on what Pinax is, the best and most amusing way is to watch the video of James Tauber’s talk at Djangocon or simply dive in and get your social networ... |
active questions tagged z3 - Stack Overflow News Feed
Z3 now has a satisfiability engine for nonlinear real arithmetic based on cylindrical algebraic decomposition.
Is there any way to obtain the result of quantifier elimination, as opposed to mere satisfiability testing?
The following does not work:
from z3 import *
b... |
I am trying to do something to all the files under a given path. I don't want to collect all the file names beforehand then do something with them, so I tried this:
import os
import stat
def explore(p):
s = ''
list = os.listdir(p)
for a in list:
path = p + '/' + a
stat_info = os.lstat(path )
if stat.S... |
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... |
galanga
Re : Qarte arte.tv browser (ex Qarte+7)
@Christophe: content de voir que cela a commencé à fonctionner... Pour le second cas qui fait une erreur, c'est parce qu'il manque un back slash sur le guillemets fermant de ...3789-visual-crop-medium.jpg ; essayez avec cela :
items.append("<item>\n <title>Dominique ... |
doudoulolita
Faire une animation sur la création de jeux vidéo libres
Dans le topic Création de jeu vidéo libre - Appel à candidatures, j'ai découvert le créateur de jeu de Ultimate Smash Friends, Tshirtman.
Voici ce que je lui ai écrit:
Je cherche un jeu que notre Espace Public Numérique pourrait proposer aux jeunes s... |
I am developing a Django project with PyDev in Eclipse. For a while, PyDev's Django Shell worked great. Now, it doesn't:
>>> import sys; print('%s %s' % (sys.executable or sys.platform, sys.version))
C:\Python26\python.exe 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]
>>>
>>> from django.core i... |
lukophron
Re : [python]Monsieur Cinéscript
ah, bug du forum, je voyais mon dernier message en triple, je veux effacer les doubles et il m'efface tout.enfin bref
ça veut dire quoi "je voulais voir ce que ça donnait" ?
et heureusement que j'ai dit "ne pas faire la màj"...
le problème, lorsque tu fais des trucs comme ça, ... |
alex2423
Plus d'accès à la TV de SFR via VLC sur le PC
Hello tout le monde,
Je fais partie de ceux qui n'ont pas de TV. J'ai juste un bel écran Dell 24" que j'utilise comme TV. Je regardais la TV avec VLC via le flux SFR.
Depuis 1 mois à peu près, je n'ai plus d'image. J'ai encore le son.
Est ce que vous avez ce meme s... |
I'm new to python and pygame and am trying to build a very simple "game" (it's more of a test for me to figure things out) in which you move a character around the screen and he can collide with walls and things. Everything is broken up into 32x32 tiles and the player is 32x64. This means that when his head hits a wall... |
Download
FREE PDF
Python is an interpreted dynamically typed Language. Python uses indentation to create readable, even beautiful, code. Python comes with so many libraries that you can handle many jobs with no further libraries. Python fits in your head and tries not to surprise you, which means you can write useful c... |
I am making use of django-registration and django-profile to handle registration and profiles. I would like to create a profile for the user at the time of registration. I have created a custom registration form, and added that to the urls.py using the tutorial on:
The basic idea in the tutorial is to override the defa... |
When I try to install any software from ubuntu software center it comes with error:
An unhandled error occured
There seems to be a programming error in aptdaemon. This is the software that allows you to install/remove software and to perform other package management related tasks.
details
Traceback (most recent call la... |
kevin54
Re : [ VOS SCRIPTS UTILES ] (et eventuelles demandes de scripts...)
@yvon22
Merci cela marche bien pour mes fichiers de + 2 jours.
Mais pour garder les 3 derniers dimanches, cela est possible avec cette commande ?
Hors ligne
Fenouille84
Re : [ VOS SCRIPTS UTILES ] (et eventuelles demandes de scripts...)
Voici u... |
A criação de campos numéricos ficou muito mais fácil no Django na versão 1.2. Imagine o seguinte model:
class Debito(models.Model): descricao = models.CharField(max_length=256) valor = models.DecimalField(max_digits=10, decimal_places=2) def unicode(self): return self.descricao
E seu registro no admin
admin.site.regis... |
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, ... |
Hi I have the following code, which attempts to create an instance of a class and assign argument values to it. I am trying to use *args to do this as follows:
def main():
testdata = ['FDR', False, 4, 1933]
apresident = President(testdata)
print apresident
print apresident.alive
class President:
id_... |
Mathieu11
[ VOS SCRIPTS UTILES ] (et eventuelles demandes de scripts...)
Edit admin : le sommaire renvoyant vers les différents scripts se trouve désormais sur cette page de la documentation.
Les nouveaux scripts peuvent donc être discutés ici, puis inclus dans le sommaire
J'ouvre ce sujet pour proposer a chacun de pos... |
I've tried to import a csv file into a database by tweaking the modelform inside the admin doing this:
models.py:
class Data(models.Model):
place = models.ForeignKey(Places)
time = models.DateTimeField()
data_1 = models.DecimalField(max_digits=3, decimal_places=1)
data_2 = models.DecimalField(max_digits... |
sqlalchemy
Problem
How to use sqlalchemy with web.py
Solution
create a load hook and use sqlalchemy's [scoped session] (http://www.sqlalchemy.org/docs/05/session.html#unitofwork_contextual)
import string
import random
import web
from sqlalchemy.orm import scoped_session, sessionmaker
from models import *
urls = (
"... |
pUWL22 is a circular, double stranded, 10.5 kb plasmid. It contains a gene encoding an enzyme that confers ampicillin resistance in the host bacterium. Cloning into the kpn I and Sst I sites abolishes ampicillin resistance, whereas cloning into other sites on the plasmid does not. Digestion with the following restricti... |
I am trying to calculate the relative entropy given two collections and have a question regarding some issues.
Supposed we have two sets, $Real$ and $Calculated$, and their respective probability mass functions, $P$, and $Q$.
Relative Entropy, or Kullback Leibler Divergence is defined as the following:
$$\sum_{i=0}^{n}... |
I normally test filefields in models using doctest
>>> from django.core.files import File
>>> s = SimpleModel()
>>> s.audio_file = File(open("media/testfiles/testaudio.wav"))
>>> s.save()
>>> ...
>>> s.delete()
If I need to I also test file uploads with test clients.
As for fixtures, I simply copy the files i need in ... |
Any real-world, enterprise-scale application requires access to some sort of persistent storage. The Relational Database Management System (RDBMS) is the most widely-used persistence storage mechanism that supports SQL for data query and update. Java DataBase Connectivity (JDBC) is a set of APIs that provide a framewor... |
i am new to python. Now its Python 2.7
I am processing xml in elementTree and using Mongodb. XML i am going to process is "http://www.sec.gov/Archives/edgar/usgaap.rss.xml" below is code for that:
import os
import cgi
import sqlite3 as litefire
import sys
sys.stderr = sys.stdout
from xml.etree import ElementTree
from p... |
texture error (jit.gl.material quetion)
Hi
I am sure I texture the model in 3dmax properly, and it looks all alright in it, but I find a error part when I turn this cup in max/msp (there's a bar code alike result behind the cup), anyone please? many thanks and sorry about my English…
L
[attachment=216472,5102]
nice tex... |
When throwing 5d20 (rolling five twenty sided polyhedral dice), what is the probability of three or more dice having a result of '5' or less, of the three, two must have a result of '4' or less? (The remaining two dice of the five I don't care about)
(Example: Roll 5d20, with a result of (15,4,7,2,1) on the (1st, 2nd, ... |
I'm using django_facebook. Each time a user registers with fb, her profilpicture is loaded on a field called 'image'
In my models.py I have a field, named profilpic, to allow users to have a profil picture:
class UserProfile(FacebookProfileModel):
user = models.OneToOneField(User)
profilpic = mo... |
Install python-ldap
1. Download and install python-ldap (e.g. python-ldap-2.4.3.win32-py2.7)
Edit models/db.py
2. edit auth.define_tables() to allow login with username and not email.
auth.define_tables(username=True)
auth.settings.create_user_groups=False
3. Add the following at the bottom of page.
Replace server and... |
I found a way to make to change music 440hz to 432hz.
Now, my problem it's i dont know the specifications to change to C528hz (A444hz).Can anybody help me??
Thank you so much!!
Namaste <3
I found a way to make to change music 440hz to 432hz.
Thank you so much!!
Namaste <3
I am not clear how you are going about this or ... |
linju
Réponses : 14
Bonjour à tous,
Le titre de mon message parle de lui même:
J'ai récemment changé quelques pièces sur mon pc et il ne me reste plus grand chose à acheter pour avoir un pc neuf qui tourne bien.
J'utilise ubuntu 14.04 depuis quelques jours et suis sous linux depuis quelques années, je ne joues pas vrai... |
I have a base model and derived model from it. base model is not abstract, so it also has table associated with it.
Problem : I create a base instance first and then derived instance. And associate derived instance to base. But I get FileField in my derived class as None, even if its saved and available in parent. Why ... |
I am trying to scrape air ticket info(including plane info and price info, etc.) from http://flight.qunar.com/ using python3 and BeautifulSoup. Below is the python code I am using. In this code I tried to scrape flight info from Beijing(å京) to Lijiang(丽æ±) at 2012-07-25.
import urllib.parse
import urllib.request... |
san-claudio
Re : Voyager 14.04 LTS
@zodd Je l'ai installé sur un Core Duo 1,2GHz et 2go de RAM depuis la 13.04 pas de problème et j'ai rien retiré au contraire...
Sinon essaye LXLE basé sur Lubuntu très complète testée en live fonctionne très bien aussi...
http://distrowatch.com/table.php?distribution=lxle
Par contre j... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.