text stringlengths 256 65.5k |
|---|
cracolinux
[script CLI]Surveillance de la température
Salut,
Pour surveiller les températures de mon PC, j'ai écris un petit script que j'utilise régulièrement avec un raccourci clavier.
Il me donne les températures processeur et chipset de la carte mère grâce à sensors
Pour ma carte graphique, une carte AMD/ATI, j'uti... |
I don't have much xp with xlrd/xlwt but I have managed to access one of the files I want to collect data from. I want to collect data from all files in the directory and move it to one sheet. I was thinking if there is someway I can store it all in one array/list it would be easy to output to a csv. If this is too much... |
» String interpolation in python +
In python, the standard way to do string interpolation is to use the
%operator. There are some bells and wistles to it, like named substitutions, but overall it behaves much the same as the C
printffunction on which it was modeled. On the other hand, in ruby you can use inline interpo... |
Is there a way in sqlalchemy to turn off declarative's polymorphic join loading, in a single query? Most of the time it's nice, but I have:
class A(Base) :
discriminator = Column('type', mysql.INTEGER(1), index=True, nullable=False)
__mapper_args__ = { 'polymorphic_on' : discriminator }
id = Column(Integer, p... |
I need to resize jpg images with Python without losing the original image's EXIF data (metadata about date taken, camera model etc.). All google searches about python and images point to the PIL library which I'm currently using, but doesn't seem to be able to retain the metadata. The code I have so far (using PIL) is ... |
I think understanding basic data compression and pattern finding / entropy reduction primitives is really important. Mostly the basic algorithms (before the many tweaks and optimizations are made) are really elegant and inspiring. What's even more impressive is how widespread they are, but perhaps also how little they ... |
I was experimenting with Django Compressor in development on a block of css files. I first put {% compress %} tags around one file, generating f6527e81a37c.css. Then I included two more css files between the tags, but instead of one minified file, this resulted in 2 minified files: f6527e81a37c.css and ee906624f953.css... |
I'm working with a legacy database and am having some trouble connecting a foreign key in one table to a primary key in another table. I'd be most grateful for any help. Below are the models and my shell+ error. Thanks in advance.
Models:
class SectionMaster(models.Model):
. . .
crs_cde = models.ForeignKey('Sec... |
Can I eliminate all Python loops in this computation:
result[i,j,k] = (x[i] * y[j] * z[k]).sum()
where x[i], y[j], z[k] are vectors of length N and x,y,z have first dimensions with length A,B,C s.t. output is shape (A,B,C) and each element isthe sum of a triple-product (element-wise).
I can get it down from 3 to 1 loo... |
It's a histogram2d problem, but the data is string. You can convert string to integer first:
x = ["A01","A01","A02","A03","A02","A04"]
y = ["ACRB","TBL","TBL","GRF","TBL","TBL"]
import numpy as np
def convert(data):
tmp = sorted(set(data))
d = dict(zip(tmp,range(len(tmp))))
return tmp, np.array([d[x] for x ... |
blob: 9f2c250d03879d64a02ad56c195312343cb26f9d (
plain
)
# This class is used to help the alternatives system which is useful when
# multiple sources provide same command. You can use update-alternatives
# command directly in your recipe, but in most cases this class simplifies
# that job.
#
# To use this class a numbe... |
I will show you how to make a menu with buttons using pygame module.
The example is simple but you can update with new features.
I will make some buttons : Start game, Options and Exit game.
The pygame come with rect function to draw rectangles.
I start with one python class named my_button.
Like any graphic interface ... |
souen
Re : Arte +7 recorder version 5
Bonjour beudbeud,
je l'ai lancé ds le terminal comme tu me l'as dit et le programme c'est simplement ouvert...sans aucune indication.
Quand je sélectionne une émission pr l'enregistrement dans la fenêtre sous progression il est indiqué en attente...donc j'attends et rien. Alors si ... |
I have the following code. I know that I can use apply_freq_filter function to filter out collocations that are less than a frequency count. However, I don't know how to get the frequencies of all the n-gram tuples (in my case bi-gram) in a document, before I decide what frequency to set for filtering. As you can see I... |
This function, that I got from this question, is as follows:
def f(n, p, k, t):
return sum(sum(1 if n == 3 else
(0 if k == 1 else
(1/36) * f(n-1, p, k-1, t-(max(p,i)))
for i in xrange(1, 7)))
for p in xrange(1, 7))
print sum(f(5,j,3,15) f... |
I'm trying to redo the Misaka module in ctypes, but when I try to use bufputs I get an error (see end of 2nd code sample). When I pass the pointer to the function I use pointer(b). That doesn't work and byref(b) doesn't work either.
This is the function signature:
/* bufputs • appends a NUL-terminated string to a buf... |
Some stable values on my mobile Llano (E2-3000M):
2900 MHz ( FID 13 , DID 0 , 1.2375 V )
2400 MHz ( FID 8 , DID 0 , 1.1000 V )
1600 MHz ( FID 8 , DID 1 , 0.8750 V )
1200 MHz ( FID 8 , DID 2 , 0.7750 V )
800 MHz ( FID 8 , DID 3 , 0.6875 V )
600 MHz ( FID 8 , DID 4 , 0.6625 V )
400 MHz ( FID 8 , DID 5 , 0.6000 V... |
This question already has an answer here:
What exactly do *args and **kwargs mean?
According to the Python documentation, from what it seems, it passes in a tuple of arguments.
def foo(hello, *args):
print hello
for each in args:
print each
if __name__ == '__main__':
foo("LOVE", ["lol", "lololol"])
... |
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 ... |
First off, the specs of the machine:
Intel Pentium D 940 3.2 GHz
MSI 945P Neo2-F motherboard
Corsair DDR2 667 512MB*2
Seagate Barracuda 7200.10 250GB*2 (to be used in RAID-0)
Leadtek 7600GS 256MB graphics card
BenQ 16X DVD writer
Dell 2007WFP 20" widescreen.
or for the inside view:
$ lspci
0000:00:00.0 Host bridge: Int... |
Module locale
Locale support.
The module provides low-level access to the C lib's locale APIs and adds high level number formatting APIs as well as a locale aliasing engine to complement these.
The aliasing engine includes support for many commonly used locale names and maps them to values suitable for passing to the C... |
I'm reading a pandas dataframe, and trying to generate a plot from it. In the plot, the data points seem to be getting connected in an order determined by ascending y value, resulting in a weird zig-zagging plot like this:
The code goes something like this:
from pandas import DataFrame as df
import matplotlib as mpl
mp... |
I'd use Shed Skin: Just download, unzip, run the init bat, and compile your Python code.
If that doesn't work, and you can get Microsoft's C compiler environment working, try Cython. This tutorial compares a normal Python extension with its generated C version. Updated excerpts:
c_prime.pyx:
def calculate(long limit):
... |
I am comparing performance of numpy vs matlab, in several cases I observed that numpy is significantly slower (indexing, simple operations on arrays such as absolute value, multiplication, sum, etc.). Let's look at the following example, which is somehow striking, involving the function digitize (which I plan to use fo... |
A few weeks ago I stumbled on an interesting programming problem at CodeChef. The problem reminded me of dynamic programming thus I decided to try implementing a solution in Python.
Initially, the main part of the algorithm I implemented looked something like this:
for i in range(1, x): for j in range(i - 1, y, -1): # ... |
I've created an expect script that, when executed, ssh's onto a server and executes a series of commands. Pseudocode looks like this:
#!/usr/bin/expect
spawn ssh usr@myip
expect "password:"
send "mypassword\n";
send "./mycommand1\r"
send "./mycommand2\r"
interact
When executed from a bash shell ($ ./myscript.txt) the ... |
I'm trying to make a POST request to retrieve information about a book. Here is the code that returns HTTP code: 302, Moved
import httplib, urllib
params = urllib.urlencode({
'isbn' : '9780131185838',
'catalogId' : '10001',
'schoolStoreId' : '15828',
'search' : 'Search'
})
headers = {"Content-type":... |
Eric_P
Re : TuXtremsplit - Recoller vos fichier .xtm
PPPFFFFF !!!! Que n'y ai-je pensé avant, je ne t'aurais pas dérangé.
En tout cas merci beaucoup, ça roule maintenant.
Super logiciel, merci pour ton travail.
Cordialement.
Éric.
Hors ligne
cheetah
Re : TuXtremsplit - Recoller vos fichier .xtm
@wido
Bonjour, je m'adre... |
TravellingFroggy
ttf-mscorefonts-installer : Erreur au démarrage
Bonjour,
J'ai un message d'erreur à chaque démarrage :
Data files for some packages could not be downloadedName-ar.UTF-8
The following packages requested additional data downloads after package installation, but the data could not be downloaded or could n... |
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... |
Bismut
Re : [HOW TO] adesklets : configuration des desklets
Bon, je ne trouve toujours pas le moyen d'afficher mes desklets au bon endroit, voici le contenu de mes fichiers :
.adesklets
# This is adesklets configuration file.
#
# It gets automatically updated every time a desklet main window
# parameter is changed, so ... |
I just got finished watching a railscast episode #189 and the was using a bit_mask to store a value in the users table. I am trying to implement the same thing but when I test via irb I am getting errors. First can someone explain what this is actually going. I know what the first line is doing and part of the second l... |
am trying to use queryset to perform the following query without using raw SQL. any idea how can do that?
select * from category_main a, category_list b, category_main c where b.main_id=c.id and a.id=c.parent_id
UPDATED
below are my models
class Main(models.Model):
slug = models.SlugField()
is_active = ... |
1. Daily Countdown
I'm trying to use Keith Wood's jQuery countdown plugin (http://keith-wood.name/countdownRef.html) in order to create a page of daily countdowns. E.g.:
A - counts down to 07:00 each day
B - counts down to 09:00 each day
C - counts down to 11:00 each day
I'm doing in a fairly hacky way:
var foo = new D... |
I wrote a very basic python script to port scan my system. I'm running linux-mint lisa:
open_ports = []
for port in xrange(65536):
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
conn.connect(('localhost', port))
open_ports.append(port)
conn.close()
except socket.error:... |
I wrote a program that runs as session service through dbus.
I wanted to make it run as system service (creating a dbus.SystemBus bus name) if executed by root (uid 0).
I am trying to run for dbus.SystemBus what I currently run for dbus.SessionBus but get a policy error.
The code (python but it doesn't really matter), ... |
It is possible to call plt.plot(dates,values) with dates being a list of datetime.datetime objects. The plot will include xticks in a format like '%Y-%m-%d' and as you zoom in, automatically change to one that shows hours, minutes, seconds.
However, it sounds like you desire more control than this. Perhaps it is not sh... |
I'm currently at the beginning of learning python. I've made a game, using classes. But now I need to put these classes in another file, and importing them from within the main file. Right now I have:
a_map = Map("scene_1")
game = Engine(a_map)
game.play()
I can't seem to make an instance like this using modules. I tr... |
Email and SMS
Setting up email
Web2py provides the gluon.tools.Mail class to make it easy to send emails using web2py. One can define a mailer with
from gluon.tools import Mail
mail = Mail()
mail.settings.server = 'smtp.example.com:25'
mail.settings.sender = 'you@example.com'
mail.settings.login = 'username:password'
... |
I'm trying to create a Python notification application. To make it short here is what I wanted to do :
1. Checking my gmail account
2. Display a notification with the number of unread mails
3. Display a button that permits me to open chromium (using a system call)
For now everything looks just fine. The checking mail p... |
I have a Task model:
class Task(models.Model):
text = models.TextField()
datetime = models.DateTimeField(auto_now_add=True)
taken = models.BooleanField(default=False)
done = models.BooleanField(default=False)
client = models.ForeignKey('UserProfile', related_name='tasks_given')
executor = models... |
Développer à l'aide ADOCE.
Introduction
Avec les objets Microsoft ADO, les applications clientes peuvent accéder aux données et les manipuler à partir d'un serveur de bases de données par l'intermédiaire d'un fournisseur de bases de données OLE. ADOCE fournit un sous-ensemble de ADO pour Windows CE. Il offre de ... |
New to Tornado, and Redis, and implementing the beginnings of a listener / worker setup.
I want to be able to LPUSH tasks onto a queue and RPOP them off. BRPOP seems like the best way to pop them off, as it will wait for one to be added if none are currently there. The problem is, whenever I use it, it never returns...... |
I just started reading Oreilly's XMPP The Definitive Guide and for the hello world, they have this script:
def main():
bot = EchoBot("echobot@wonderland.lit/HelloWorld", "mypass")
bot.run()
class EchoBot(object):
def __init__(self, jid, password):
self.xmpp = sleekxmpp.ClientXMPP(jid, password)
... |
galinux
Re : Mypaint : vos dessins & brosses
pas mal tenez regardé ça ! ça prête a sourire, il m'avait interdit plusieurs post qu'il sont rétabli en parti sauf celui là
vieux packard bell imedia, intel core2 duo 1.86 ghz, 2.5 Go ram, nvidia gt 220 LMDE (xfce) 64 b + voyager 12.10 32 b sur clef pour l emmené partout
un ... |
This is for the Blender 2.6 API.
There are two problems:
1. When I import a single animation frame from my animation file to Blender, all bones look fine.But when I import multiple (all of the frames), just the first one looks right, seems like newer frames are affected by older ones, so you get slightly off positions/... |
What's a good way to list a "Contact Us" email address on a web site, while reducing the likelihood it will get spammed?
Is putting the email address in an image the best technique, or are there others?
I pass all contact forms through a throwaway Gmail account, that forwards mail to the real email address. It's free, ... |
Sorting umenu
Hi,
Is there a way to sort the umenu’s?
I have a list of files which I want to sort.
Cheers
Bullen
You might consider putting the list in a coll, sorting it there and then dumping it into the umenu.
Best, Jeremy
I thought of that, but how do I get the file list into coll??
Since the umenu gets it’s list f... |
Previously I posted a proposal for a safe self-improving limited oracle AI but I've fleshed out the idea a bit more now.
Disclaimer: don't try this at home. I don't see any catastrophic flaws in this but that doesn't mean that none exist.
This framework is meant to safely create an AI that solves verifiable optimizatio... |
#0 Re : -1 » Arte +7 recorder version 5 » Le 29/05/2010, à 13:32
#1 Re : -1 » Arte +7 recorder version 5 » Le 29/05/2010, à 15:02
#2 Re : -1 » Arte +7 recorder version 5 » Le 10/06/2010, à 09:30
beudbeud
Réponses : 812
Je viens de tester... et en effet, il y a un problème si le titre est vide.
Dans Catalog.py, remplace... |
The only route to altering the way built-in containers check equality is to make them contain as values, instead of the "originals", wrapped values (wrapped in a class that overrides __eq__ and __ne__). This is if you need to alter the way the containers themselves use equality checking, e.g. for the purpose of the in ... |
Hizoka
Re : [glade2script-GTK2] Interface graphique pour script bash ou autre.
bah le principe en lui même je le pige.
mais c'est son application où j'ai du mal.
Il va falloir que je me penche bien sur tes exemples.
Hors ligne
frafa
Re : [glade2script-GTK2] Interface graphique pour script bash ou autre.
CouCou !
oulah ... |
I am trying to get the HTML page back from sending a POST request:
import httplib
import urllib
import urllib2
from BeautifulSoup import BeautifulSoup
headers = {
'Host': 'digitalvita.pitt.edu',
'Connection': 'keep-alive',
'Content-Length': '325',
'Origin': 'https://digitalvita.pitt.edu',
'User-... |
Here's my code for generating date-based barcharts with Django and CSS.
def date_barchart(model, date_field, operation='count', days=150, till=datetime.now()):
list = []
i = 0
while i < days:
day = (till - timedelta(days=i), till - timedelta(days=i-1))
date = time.strftime("%Y-%m-%d", day... |
Solutions already proposed use
a parser : too long
a regex : I like it but needs to know regexes
the module ast: interesting but needs to know it too
.
I treated the problem thinking to do it in the simplest manner understandable to a beginner.Moreover, my solution shows that Python built-in capabilities are enough to ... |
Here's a small Python script using the PyPdf library that does the job neatly. Save it in a script called un2up (or whatever you like), make it executable (chmod +x un2up), and run it as a filter (un2up <2up.pdf >1up.pdf).
#!/usr/bin/env python
import copy, sys
from pyPdf import PdfFileWriter, PdfFileReader
input = Pdf... |
I am trying to subclass a deque, but can't work out how to set the maxlen.
is there a __maxlen__ ?
EDIT: - is the following 'Bad' python?
from collections import deque
class MinMax(deque):
def __init__(self):
deque.__init__(self, maxlen=2)
mm = MinMax()
|
I'm trying to use multiprocessing's Pool.map() function to divide out work simultaneously. When I use the following code, it works fine:
import multiprocessing
def f(x):
return x*x
def go():
pool = multiprocessing.Pool(processes=4)
#result = pool.apply_async(self.f, [10])
#print result... |
sha256
JavaScript performance comparison
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://www.bichlmeier.info/sha256.js"></script>
<script src="http://www.webtoolkit.info/djs/webtoolkit.sha256.js"></script>
<script src="http://www.movable-type.co.uk/scr... |
I am getting the following error after integrating
DoesNotExist at /facebook/connect/ UserProfile matching query does not exist.
Here is my models.py
from django.db import models
from django_facebook.models import FacebookProfileModel
from django.contrib.auth.models import User
class UserProfile(FacebookProfileModel):
... |
Similarly to this question I would like to pass the attributes from a dictionary to an instance of a class, but creating the class using type, like this:
attrs = { 'name': 'Oscar', 'lastName': 'Reyes', 'age':32 }
e = type('Employee', (object,),attrs)()
But when I do this the attributes are belonging to the class, not ... |
Possible Duplicate:
What is The Rule of Three?
How exactly does std::pair call destructors for its components? I am trying to add instances of a class to an std::map, but I am getting errors regarding the destructor of my class.
I have narrowed down my question/problem to the following extremely simple example.
Below, ... |
Just Mimic C#
In C# there are two different functions that handle parsing of scalar values:
Float.Parse()
Float.TryParse()
float.parse():
def parse(string):
try:
return float(string)
except Exception:
throw TypeError
Note: If you're wondering why I changed the exception to a TypeError, here's t... |
Using python 2.7 I'm doing an os.walk with these files http://www.2shared.com/file/biSx7NI-/comer.html and then comparing the result against an array. In the actual program this array won't be predefined. The code that I am trying to use is as follows
# -*- coding: utf-8 -*-
import os.path
group = ['comer.txt', 'coma.t... |
I've looked at the pickle documentation, but I don't understand where pickle is useful.
What are some common use-cases for pickle?
Some uses that I have come across:
1) saving a program's state data to disk so that it can carry on where it left off when restarted (persistence)
2) sending python data over a TCP connecti... |
loic_e
Kubuntu Dapper sur Sony VAIO VGN-FE28H
Voici la procédure d'installation utilisée pour installer Kubuntu Dapper sur un Vaio VGN-FE28H:
Caractéristiques:
Processeur Intel Core Duo
Fréquence 1.67 GHz
Quantité de RAM 1 Go
Type de RAM DDR2-SDRAM
Disque dur 160 Go
Puce graphique nVIDIA GeForce 7400 Turbo Cache
Taille... |
Another key point is that the mouse messages all report the position in "Screen Coordinates" (i.e., relative to the top-left corner of the screen) rather than in "Client Coordinates" (i.e., relative to the top-left corner of our window). You use a member function PyCWnd.ScreenToClient() to transform these coordinates.
... |
async is now an independent module : grequests.
See here : https://github.com/kennethreitz/grequests
And there: Ideal method for sending multiple HTTP requests over Python?
installation:
$ pip install grequests
usage:
build a stack:
import grequests
urls = [
'http://www.heroku.com',
'http://tablib.org',
'ht... |
I'm using a very simple connection to a localhost database:
engine = sqlalchemy.create_engine('mysql+mysqlconnector://usr:pwd@localhost/db')
engine = engine.connect()
data = engine.execute('select * from table')
'table' has 500 lines. Then I run the cProfiler on 'data', where I find this:
ncalls tottime percall cum... |
Do I need any special kind of software to view the responses I get after requesting something? Like with Klout for example, I can get all the code returned as I need it, I just don't know where to put it. Is it because I'm missing a soiftware program or something?
Most of the Stack Exchange API can be accessed via simp... |
How to output results in list form (with code not manually) on Python 2.75.Instead of solving just for the sum I inserted print i then sum and got the numbers visible (11 of them). Please help with this very basic question. Thank you.
##Even Fibonacci numbers Problem 2
##Each new term in the Fibonacci sequence is gener... |
Python Scripts as a Replacement for Bash Utility Scripts
To demonstrate the power of combining Python scripts in a modular andpiped fashion, let's expand further on the problem space. Let's findthe top five users of the service. head is a commandthat allows you tospecify a certain number of lines to display of the stan... |
I am executing stored procedure using ExcuteReader() command. If I execute Stored Procedure in SQL server it is taking 2 secs. But in code taking around 2 mins. I tried DataAdapter.Fill(). Still the same.
What is wrong in the code?
spString = "usp_graph"
sqlcmd_q.Connection = sqlCnn
sqlcmd_q.CommandText... |
Xun
Réponses : 10
Bonsoir à tous,
Cela fait longtemps que je bidouille sous linux mais avec le temps, ma patience et ma situation personnelle me le permettent moins..
Je viens de faire l'acquisition d'un VPS chez OVH. Il me sert actuellement de :
- VPN avec openVPN
- cloud avec Owncloud (couplé avec Hubic)
- serveur We... |
How to read/write data into excel 2007 in c++?
Excel provides COM interface which you can use from your C++ application.
I have experience with Excel 2003 only but I think for excel 2007 it will also work.
This can be done e.g. with #import or in the way described in this article: http://support.microsoft.com/kb/216686... |
jegougou
Re : [Info] Installation du driver Libre ATI Radeon
j'ai suivis ton conseil voila le resultat
4294 frames in 5.0 seconds = 858.715 FPS
4254 frames in 5.0 seconds = 850.774 FPS
4190 frames in 5.0 seconds = 837.903 FPS
3269 frames in 5.0 seconds = 653.660 FPS
4400 frames in 5.0 seconds = 879.915 FPS
4398 frames ... |
I'm in a location with poor Internet access. In order to ensure that a call to an external service succeeds, I am wrapping the call in a pseudo-do-while in Python. Additionally, I am limiting the call to running a maximum of three times:
def post_safe(url, params):
done = 0
max_tries = 3
messages = []
w... |
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... |
damadm
Re : [HOW TO] adesklets : configuration des desklets
Auteur: damadm
Bonjour je ne trouve pas modubar sur http://adesklets.sourceforge.net
j'ai cherché avec google mais j'ai rien touvé. Quelqu'un peut-il me donner le lien?
Hors ligne
toma222
Re : [HOW TO] adesklets : configuration des desklets
Bonjour,
Le dévelop... |
Etoma
Re : /* Topic des codeurs [7] */
Écrire du code est très exigeant.
C'est plaisant.
Hors ligne
tshirtman
Re : /* Topic des codeurs [7] */
si les experts d'haskell peuvent l'aider… (j'aime bien ce gars… c'est le mec qui code git-annex et upload des paquets debian depuis un netbook tournant à l'énergie solaire dans ... |
Today I wand to show you something new. The goal is using python under Windows OS (Windows 8.1).
This tutorial will cover the instalation of Python 2.7 with distribute (0.7.3), pip (1.5.2), virtualenv (1.11.2) and virtualenvwrapper-powershell.
The default instalation folder I used is under C: drive
I used python 2.7.6.... |
Okay, just gonna answer the question with what I've figured out so far.
In order to plot a straight line on a semilog, there are two main methods. If you have a list of x values and want to get the corresponding y values which will plot a straight line, then you just call numpy.exp() on each x value.
import matplotlib.... |
toto2849
Connexion VPN automatique (NetworkManager)
Bonjour,:D
-Actuellement en stage il met demandé de mettre en place une connexion VPN qui se lance automatiquement au démarrage du pc ne laissant juste à l'utilisateur une boite de dialogue demandant login+pass.:rolleyes:
-J'ai déjà installé le plugin "network-manager... |
AnsuzPeorth
Re : [Script] reconnaissance vocale avec google
Je voulais aider mais, je viens de voir mes intérêts pas mal modifiés (girl power tongue )....
Euh, non, suis pas d'accord, et mon beta testeur ?? Qui va apposer le HUG (HizokaUsineaGaz) ???
T'as raison, ca tiens plus chaud une femme qu'un pc
Hors ligne
n3o51
... |
Your second loop example is flawed. You will never want to write code like that because there are many common parts of your game that must run on each main loop iteration. More likely you'd end up with something like:
MainLoop():
while not_quit:
PumpOSMessages()
PreFrameCommonUpdate()
if is_day:
Upd... |
I am trying to filter a field on a ModelForm. I am subclassing the generic CreateView for my view. I found many references to my problem on the web, but the solutions do not seem to work (for me at least) with Django 1.3's class-based views.
Here are my models:
#models.py
class Subscriber(models.Model):
user = mode... |
#0 Re : -1 » [résolu] Nombreux Linux-headers » Le 07/09/2014, à 17:20
dz50
Réponses : 16
@serged : la commande "sudo apt-get autoremove" ne fonctionne plus comme dans le temps. Depuis le sortie de Ubuntu 13.04, cette commande effectue un nettoyage automatique et pertinent des noyaux (voir discussion sur le sujet ici). ... |
in azure solution:
1 refactor in test project doesn't find all from impl project
in test_tableservice.py, refactor-rename TableService from the following code:
class TableServiceTest(AzureTestCase):
def setUp(self):
self.tc = TableService(account_name=credentials.getStorageServicesName(),
... |
Bioinformatics, the use of computers in biological research, is the newest wrinkle on one of the oldest pursuits--trying to uncover the secret of life. While we may not know all of life's secrets, at the very least computers are helping us understand many of the biological processes that take place inside of living thi... |
Square root: Babylonian method. I.e.
function sqrt(N):
oldguess = -1
guess = 1
while abs(guess-oldguess) > 1:
oldguess = guess
guess = (guess + N/guess) / 2
return guess
Exponentiation: by squaring.
function exp(base, pow):
result = 1
bits = toBinary(powr)
for bit in bits:
... |
I've recently started learning Kivy and using it. Today I've come across a problem that I'm not sure if it's a bug in Kivy or a misunderstanding from my behalf. This is a simplified version.
I was working on a GUI that has a text input on top for searching. My Kv file looks like this:
#:kivy 1.0
#:import kivy kivy
<Sea... |
I'm just a newbie on Python. I have this algorithm to see is a word is a palindrome or not.
def isPalindrome(s):
def toChars(s):
s = s.lower()
ans = ''
for c in s:
if c in 'abcdefghijklmnopqrstuvwxyz':
ans = ans + c
return ans
def isPal(s):
if ... |
SQLFORM keeps the values retrieved from the DB in custom objects that can be referenced by field name and used directly in custom forms without the need to re-access the DB.
The custom objects are:
self.custom.label.fieldname :holds the label of the field.
self.custom.dspval.fieldname :form-type and field-type dependen... |
sheep
Xubuntu moitié en français moitié en anglais
Bien le bonjour à tous
J'ai remonté un vieux pc pour que mes gosses puissent jouer à leurs jeux sans me piquer le mien
Comme il est vieux j'ai donc installé une xubuntu 12.04, elle fonctionne bien, cependant certains menus ne sont pas traduits en français.
Au début tou... |
Coeur Noir
[résolu] Langue du système ...pas d'interface KCmodule...
Hello,
je viens de réinstaller Kubuntu12.04 - seul - sur partition dédiée avec son propre utilisateur dans un /home sur un 2nd DD.
Sur une autre partition il y a Ubuntu12.04 et son autre utilisateur, dans le même /home (/home contient donc 2 utilisate... |
this function will not give me an output when tested in python's IDLE:
import random
def scramble(string):
rlist = []
while len(rlist) < len(string):
n = random.randint(0, len(string) - 1)
if rlist.count(string[n]) < string.count(string[n]):
rlist += string[n]
rstring = str(rlist) ... |
Module sys
This module provides access to some objects used or maintained by the
interpreter and to functions that interact strongly with the interpreter.
Dynamic objects:
argv -- command line arguments; argv[0] is the script pathname if known
path -- module search path; path[0] is the script directory, else ''
modules... |
k3c
Re : TVDownloader: télécharger les médias du net ! [2]
@ pacome
Oui, j'ai un compte github, tu vas être surpris
https://github.com/k3c
:-)
Edit : pour Public Sénat, on trouve les url dans le code source de la page, et on téléchargera via un "bête" curl ou msdl je pense (enfin ça marchait comme ça avant)
exemple sur... |
I come from Java, so I'm getting confused here.
class Sample(object):
x = 100 # class var?
def __init__(self, value):
self.y = value # instance var?
z = 300 # private var? how do we access this outside Sample?
What is the difference between the 3 var... |
The example below shows three raster (i.e. in black) and a single county polygon feature class. How can I clip/extract by mask the rasters by their corresponding county polygons (i.e. Edwards, Clark, Barber) in an automated fashion? For this example, the output should include three separate rasters clipped to the count... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.