text stringlengths 256 65.5k |
|---|
help with flushing stdin.(i think)
Jan 9, 2013 at 10:07pm UTC
Hi guys.
I have done this hangman homework but i have 2 problems.
The first is that when I get to
"Do you want to play again?"
, and if my answer is
yes
, sometimes it restarts and sometimes it ends.
Can it be the stdin? Then how do I flush it correctly, and... |
Iframes, onload, and document.domain
In this new Web 2.0, mashup world that the Internet has become, a lot of focus has been placed on the use of iframes for embedding third-party content onto a page. Iframes provide a level of security since JavaScript access it limited by domain name, so an iframe containing content ... |
I am a newbie to web development, so please be mercy if the following question sounds a bit naive. How can I post to a web form using python? I know the web form is something like this, and I want to upload a local file for it to be processed online and get the returned data
<form action="process.php" method="post" enc... |
So, I'm on simple project for a online course to make an image gallery using python. The thing is to create 3 buttons one Next, Previous and Quit. So far the quit button works and the next loads a new image but in a different window, I'm quite new to python and GUI-programming with Tkinter so this is a big part of the ... |
There has got to be a better way to do this….
I’m using several multi sliders for a sequencer. I want to randomize the patterns. The only thing I can think of I pasted below. My solution is far from elegant, can anyone suggest anything else.
If anyone has ideas on how to randomly alter the number of items in the list, ... |
I am told to
Write a function, square(a), that takes an array, a, of numbers and returns an array containing each of the values of a squared.
At first, I had
def square(a):
for i in a: print i**2
But this does not work since I'm printing, and not returning like I was asked. So I tried
def square(a):
for i ... |
Using Python 2.7.3 with Numpy 1.6.2 on a 64-bit Ubuntu 12.04. Additional versions are present on the system (Python 2.6.4 and Numpy 1.6.1) but to the best of my knowledge these have no influence on the events described below.
I'm working on a Python program which uses Numpy, and getting an error when I try to run a cer... |
malbo
Re : Windows 8.1+Ubuntu...
Ton Boot-Info est là :
Boot Info Script e7fc706 + Boot-Repair extra info [Boot-Info 27Sep2013]
============================= Boot Info Summary: ===============================
=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector
175118912 of the same hard ... |
Author goska
Submission date 2012-02-26 12:48:07.612798
Rating 2658
Matches played 462
Win rate 31.82
Use rpsrunner.py to play unranked matches on your computer.
import random
class RPS:
def __init__(self, n = 10):
self.n = n #kok more bit neka zadeva zanesljiva da jo sprejmemo kot strategijo
self.n... |
Running DNS queries
This is one of the things that's clearly spelled out on the Examples page. Here's how to run a DNS query to get the mail servers (MX records) for dnspython.org:
import dns.resolver
answers = dns.resolver.query('dnspython.org', 'MX')
for rdata in answers:
print 'Host', rdata.exchange, 'has prefer... |
Maisondouf
Re : Postfix est en train de me rendre fou ...
Pourtant à première vue, ce que tu veux pouvoir gérer n'est pas spécialement complexe mais je ne sais peut-être pas tout.
ASUS M5A88-v EVO avec AMD FX(tm)-8120 Eight-Core Processor, OS principal Precise 12.04.1 LTS 63bits½
Bricoleur, menteur, inculte, inadapté s... |
I need to send an e-mail when new instance of Entry model is created via admin panel. So in models.py I have:
class Entry(models.Model):
attachments = models.ManyToManyField(to=Attachment, blank=True)
#some other fields
#...
sent = models.BooleanField(editable=False, default=False)
Then I'm registri... |
Hi,
I've been struggling with this for awhile ( http://en.wikipedia.org/wiki/Banach%27s_matchbox_problem)
and I put together this little bit of Python code
def foo(n=3):
from numpy import rand
x = [1,]*n # one box of matches with elements 1
y = [0,]*n # the other box with elements 0
c=[]
while x and y:
... |
Im using the python framework flask with sqlalchemy.
My many-to-many looks like this:
collections_questions = db.Table('collections_questions',
db.Column('question_id',db.Integer,db.ForeignKey('question.id')),
db.Column('collection_id',db.Integer,db.ForeignKey('collection.id'))
)
class Collection(db.M... |
Le Farfadet Spatial
Re : Petit guide pour aider au choix d'un langage
Salut à tous !
Sur amazon, j'ai trouvé ce livre
"Python - Les Fondamentaux du langage - La Programmation pour les scientifiques. de Matthieu Brucher"
Très bon livre, dans la mesure où tu sais déjà programmer et que tu es intéressé par la partie scien... |
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 ... |
Python
lampprogrammer — 2013-11-04T14:37:44-05:00 — #1
I'm trying to loop through a queryset to built a dictionary, then loop through that dictionary in my template to create a grid. It works, BUT, the fields are in the wrong order. Instead of getting them in the order of Field1 Field2 Field3, I get Field2, Field1, Fie... |
I'm new at this and have only been using nginx to serve static files. I have now installed flask and gunicorn. If I run gunicorn -b 127.0.0.2:8000 hello:app and then wget it from the server it works well. If I try to access it from a browser, however, it returns a 404 error (I am running this on a server that hosts a w... |
How do I check if a file exists, using Python, without using a try: statement?
You can also use
import os.path
os.path.isfile(fname)
if you need to be sure it's a file.
You have the
import os.path
os.path.isfile(file_path)
>>> print os.path.isfile("/etc/passwd")
True
>>> print os.path.isfile("/etc")
False
>>> print o... |
I have an intra-day chart and I am trying to figure out how to calculate support and resistance levels, anyone knows an algorithm for doing that, or a good starting point?
thank you
I have an intra-day chart and I am trying to figure out how to calculate support and resistance levels, anyone knows an algorithm for doin... |
SQLAlchemy
Relationships
If SQLAlchemy could only do this, it still would be a nice library, simplifying your queries. But the real power of SQLAlchemy occurs when you define relationships between tables. For example, let's assume that I have an Appointments table, indicating when I'm meeting with various people:
CREAT... |
Long question
Is it possible to add a DOM element only if it does not already exists?
Example
I have implemented the requirement like so:
var ins = $("a[@id='iframeUrl']");
ins.siblings('#myIframe:first').remove().end().parent().prepend('<iframe id="myIframe" src="'+ins.attr("href")+'"></iframe>');
Is it possible to ... |
.toc {
width: 100%;
margin: 1em 0;
border: 1px solid rgba(0,0,0,0.1); }
.toc td, .toc th {
padding: 4px 10px;
border-bottom: 1px solid #eee;
border-right: 1px solid #eee;
border-collapse: collapse;
text-align: left; }
.toc th { background-color: #ECECEC; }
Static typing is great because it keeps you out of trouble. Dyn... |
What is the easiest way to do the equivalent of rm -rf in python?
While useful, rmtree isn't equivalent: it errors out if you try to remove a single file, which
$ mkdir rmtest
$ cd rmtest/
$ echo "stuff" > myfile
$ ls
myfile
$ rm -rf myfile
$ ls
$ echo "stuff" > myfile
$ ls
myfile
$ python
Python 2.7.1+ (r271:86832, A... |
I need get all photos shared by fans in my facebook page fan. I can do?
I try using api graph but I see only album shared by me.
You can use a filter to get at some specific types of posts on a wall:
https://graph.facebook.com/inpesca/feed?type=checkin
See "Searching" in the Graph API Reference.
// pseudocode
posts = ... |
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... |
I am following Google App Engine "Hello world" tutorial in this link: https://developers.google.com/appengine/docs/python/gettingstartedpython27/helloworld
I want to load my helloworld.py application:
import webapp2
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = '... |
This is what I ended up doing.
The suggestion to use the IMAP service is absolutely correct. The trick is not to pull in all your mail, but use the features of IMAP to retrieve only the information you are interested in. In our case, that is the "Delivered-to:" header.The entire process only takes a few minutes on a fu... |
RFC4231 gives test cases for SHA256 with several different sets of gozintas and gozoutas. I'm looking for something similar for the SHA256 hash as implemented in the Bitcoin mining algorithm.
Based on the answers given, here is a very simple test in Python. Note that the generated digest must be reversed before the che... |
Hibou57
[Info] Compiler LinuxSampler
Hello,
Je viens de compiler LinuxSampler successfully,
Pour épargner les messages d'erreur et les déceptions qui les suivent de prêt, aux gens qui voudraient eux aussi compiler un LinuxSampler tout frais sorti de chez le maraicher, voici les étapes à suivre ci-après. Ça reste assez ... |
I have a raster (USGS DEM actually) and I need to split it up into smaller chunks like the image below shows. That was accomplished in ArcGIS 10.0 using the Split Raster tool. I would like a FOSS method to do this. I've looked at GDAL, thinking surely it would do it (somehow with gdal_translate), but can't find anythin... |
Postgres 9.3 brings a new option for COPY allowing to pipe data with an external program, both in input and output. This feature has been added in the following commit:
commit 3d009e45bde2a2681826ef549637ada76508b597 Author: Heikki Linnakangas Date: Wed Feb 27 18:17:21 2013 +0200 Add support for piping COPY to/from an ... |
toma222
[HOW TO] adesklets : configuration des desklets
Il existe désormais un article sur le wiki concernant Adesklets donc je vous conseille de vous y fier, ce tutoriel n'étant plus mis à jour.
J'ouvre ce deuxième post au sujet de adesklets, afin de permettre une meilleure lisibilité de l'ensemble.Celui-ci a donc pou... |
I'm trying to use the App Engine datastore in my application outside of the bounds of one of the request handler pages (like main.py or the other files you can specify in app.yaml). Is this possible? When I try to run it, it says my database model does not have a method "put" associated with it, but it has no problems ... |
i'm driving nuts trying to download csv files from the following url:
There are 4 forms in the website, and I managed to set the date on the right form, then I post that form, and I get the http response with the right html. But i want to actually download the csv not the html of the response. I thought that i would ha... |
degolarson
RESOLU connexion ok mais ouverture pages web lente ou imopssible
bonjour
j'ai déjà posté ici : http://forum.ubuntu-fr.org/viewtopic.php?id=21092
mais le pb était peut être un peu différent
quand je tape une recherche dans Google ou bien dans ma barre personnelle d'onglets l'ouverture de la page est souvent l... |
1. Başlangıç
6. Git Tools
8.2 Git and Other Systems - Migrating to Git
Migrating to Git
If you have an existing codebase in another VCS but you’ve decided to start using Git, you must migrate your project one way or another. This section goes over some importers that are included with Git for common systems and then de... |
To introduce the problem, USB devices are typically hot-pluggableexternal devices. Linux (the kernel) assigns a number for each device inthe system at boot time, or later when the device is plugged into thesystem. This number (the minor device number) is used internally byseveral system (kernel) functions, but the user... |
oliver2004
problème wifi avec portable HP nx6125...
Salut à tous, je viens d'installer sans trop de mal Kubuntu 7.10 sur mon portable HP Compaq nx6125 (j'ai de la chance il n'est pas tatoué...). Aparemment tout marche sur la machine... sauf le wifi... j'en ai pas besoin là maintenant mais j'en aurai sûrement besoin et ... |
Ras'
Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4]
Hors ligne
ljere
Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4]
voici le code
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# auteur Gabriel Pettier
# license GPL V3 or later
# sert uniquement a compter le... |
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.... |
I wouldn’t call myself a calendar power-user.
Ever since I started organizing the things I have to do with a system I can trust, I’ve faced a workflow conundrum: is this a task or a calendar event?
I know that there’s a difference between so-called “actionable items” and time-based events. Maybe I’m not hooked up right... |
Control System Toolbox Function Reference
Set or modify LTI model properties
Syntax
set(sys,'Property',Value)
set(sys,'Property1',Value1,'Property2',Value2,...)
set(sys,'Property')
set(sys)
Description
set is used to set or modify the properties of an LTI model (see LTI Properties for background on LTI properties). Li... |
I am using an inherited modelling schema for my site, it has every media element under one common PolyModel base with every different element by themselves like so:
class STSeasonMedia(polymodel.PolyModel):
season = db.ReferenceProperty(STSeason,collection_name='related_media')
description = db.StringProperty()... |
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... |
Dragon Naturally Speaking 10 Multilenguaje [DVD Full]
Tal vez algunos ya conozcan las bondades de este programa pero de seguro hay más que no lo conocen, por esa razón voy a tratar de explicar brevemente qué es lo que hace o para qué sirve esta grandiosa aplicación. Dragon Naturally Speaking 10 nos permite dictarl... |
First of all, thanks to corenominal for wanting me to do this.
Second, thanks to omns for pointing me in the right direction about packaging.
corenominal has contacted me about including my artwork package in the Crunchbang repos, needless to say I am honored.
Current package can be installed by opening a terminal and ... |
i had succesfully installed numpy (numpy-1.6.2-win32-superpack-python2.7.exe). But, whenever i try to call any functions i am getting following the error below. Thanks in advance for help.
import numpy as np
if __name__ == "__main__":
k = np.arange(10)
AttributeError: 'module' object has no attribute 'arange'
|
Python 2.6.2
django-pagination 1.0.5
Question: How to force pagination work correctly? The problem is that {% paginate %} does not work, but other {% load pagination_tags %} and {% autopaginate object_list 10 %} works!
Error message appeared, when I add {% paginate %} into html page:
TemplateSyntaxError at /logging
Cau... |
Seco59
Réponses : 7
Salut,
Je suis sous xubuntu 14.04 et j'ai un petit souci depuis aujourd'hui.
Comme d'habitude après l'allumage de mon PC j'ouvre mon terminal pour lancer un :
sudo apt-get update && sudo apt-get dist-upgrade
J'accepte les quelques mises à jour me sont proposées mais j'obtient ces messages d'erreur ... |
Suppose I have $n-1$ distinguishable labels for internal nodes $A=\{a_1, a_2,\dots, a_{n-1}\}$ and $n$ distinguishable labels for leaves $B=\{b_1,b_2,\dots, b_n\}$ with $A$ and $B$ disjoint. What is the best way to iterate over all possible binary trees if I label without replacement?
Disclaimer: I have no computer sci... |
I'm uploading potentially large files to a web server. Currently I'm doing this:
import urllib2
f = open('somelargefile.zip','rb')
request = urllib2.Request(url,f.read())
request.add_header("Content-Type", "application/zip")
response = urllib2.urlopen(request)
However, this reads the entire file's contents into memory... |
smo
Re : logiciel creation/remasterisation/clonage de distributions base ubuntu
mwoe effectivement y s arrete direct y cree pas les fichiers et sort... je regarde
ht5streamer, streaming youtube/dailymotion...: http://forum.ubuntu-fr.org/viewtopic.php?id=1299461 / http://ht5streamer.free.fr
ubukey, createur ubuntu custo... |
JavaScript
scott_carlton — 2014-01-07T16:08:04-05:00 — #1
I have been trying to get a google maps api query over the 10 query limit all morning with no luck. I have used this code here http://pastebin.com/X0icm1B8. I tried wrapping .each in a setTimeOut function at line 44 as well as trying it with the marker var but n... |
I am looking for feedback on this compact Python API for defining bitwise flags and setting/manipulating them.
Under the hood, FlagType extends int and all operations are true bitwise, so there is little to no performance impact. Also, because they are all int, any standard bitwise operation can be performed on them.
U... |
sali10
ecrire un script
bonjour tout le monde
je voulais ecrire un script en C , qui manipule un fichier texte, il doit lire le fichier et faire des modification par exemple a chaque fois qu'il rencotre le mot 'a5b6 il le remplace par ahbv....comment proceder?
Hors ligne
Jean-Julien
Re : ecrire un script
J'ai l'impress... |
gtk.RadioToolButton — a toolbar item that contains a radio button (new in PyGTK 2.4)
class gtk.RadioToolButton(gtk.ToggleToolButton):
gtk.RadioToolButton(group=None, stock_id=None)
def set_group(group)
def get_group()
+--gobject.GObject+-- gtk.Object +-- gtk.Widget +-- gtk.Container +-- gtk.Bin +-- gtk.Too... |
fenix122
Re : erreur avec apache2 : « Unable to open logs » [RESOLU]
non non je sais faire les serveur sans interface j'ai fait sa surtout pour simplifier après non je ne suis pas tout a lettre car le tuto que j'ai suivi avait des erreurs pour certaine chose surtout pour c'est source pas bonne j'ai du aller sur le site... |
Enhanced Interactive Python with IPython
by Jeremy Jones
01/27/2005
Python is a multipurpose programming language: it is object oriented, is dynamic, can accomplish much in few lines of code, is syntactically clean and elegant, "fits the brain well," and is an excellent language for programmers of all ages and skill le... |
A new day brought new problem with Python, unfortunately :/
I have a file generated by my other app written in Java. This app generates files with some data, it's kind a random stuff 'cause I'm not able to say how many rows each file would have. Example file looks like this:
3 Sat Jan 21 00:00:00 20127 Sun Mar 11 00:00... |
Зачем автоматизировать?
В процессе работы с gimp часто требуется выполнять одни и те же действия.
Например что бы создать заготовку для кнопки :
Создать слой
Выделить область
Залить градиентом
Уменьшить выделение
Залить градиентом
Добавить эффектов
Когда таких действий много, они начинают отнимать много времени.
Эта ра... |
Currently I have a lighttpd server with flup and webpy. If you make enough requests fast enough (say clicking a link repeatedly many times or doing an apache bench) Lighttpd throws a 500 internal server error. At this point it is pretty easy to exploit (I can break it with several clicks of a link).
Lighttpd code:
fast... |
I'm working with broken_barh plots. Is there any way to get a fixed height of a single broken_barh? The image should get bigger vertically, but proportions should stay the same.
Here is a simple example.
import matplotlib.pyplot as plt
import matplotlib as mlp
fig = plt.figure()
ax = fig.add_subplot(111)
broken_barh(se... |
underscorevsclonenode
JavaScript performance comparison
Info
underscore templating vs cloneNodes
Preparation code
<div id="test"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.1/underscore-min.js"></script>
<scri... |
Python Scripts as a Replacement for Bash Utility Scripts
For Linux users, the command line is a celebrated part of our entire experience. Unlike other popular operating systems, where the command line is a scary proposition for all but the most experienced veterans, in the Linux community, command-line use is encourage... |
After you've made your .scheme or .schemedef file (see Add Support for Your Language) there's still something missing from that authentic professional feeling when programming with your newly defined language. For that you need to create an auto-indenter.
Please note: You need to have PyPN installed for this to work! S... |
I'm trying to return filtered values from a m2m relationship to use in a template. Should be trivial, but I can't get it to work.
class Activity(models.Model):
activity_nm = models.CharField(max_length=60)
enddt = models.DateField()
groups = models.ManyToManyField(Group)
def __unicode__(self):
... |
Accessing Liferay Services
In many cases, you’ll want to interact with one of Liferay’s many services. This is possible from all of the scripting languages supported, but the syntax is a little different for each language.
To illustrate the correct syntax for interacting with Liferay services, let’s look at a simple ex... |
k3c
Re : TVDownloader: télécharger les médias du net ! [2]
Merci Julien
J'ai testé avec succès pour plusieurs vidéos comme
par contre le --resume devrait être optionnel
python d8_julien.py http://www.d8.tv/d8-art-de-vivre/pid5205-d8-a-vos-regions.html
rtmpdump -r "rtmp://geo2-vod-fms.canalplus.fr/ondemand/geo2/1304/A_V... |
As you probably know, if a class needs to handle two mostly unrelated concerns, the class should probably be split into two. This way, your will achieve higher cohesion in your code, which is generally considered a good thing. Though, there are times where you need to address two mostly unrelated concerns in a single c... |
The difference between having _init_.py and not having one in your module directory is:
When you have __init__.py (blank one), you can import the module using
from dirname import MyModule
But when you dont have _init_.py at all, you cannot import the module without adding the path till that module to PYTHONPATH. In th... |
Form helpers are designed to make working with resources much easier compared to using vanilla HTML.
Typically, a form designed to create or update a resource reflects theidentity of the resource in several ways: (i) the url that the form is sentto (the form element's action attribute) should result ina request being r... |
I am trying to install mysql gem, version: 2.7 though it gives an error:
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm...... |
n3o51
Re : ADesk Bar : Barre de lancement rapide [python/gtk/cairo]
Ah ok je regarde ça merci, bone je n'arrive pas as avoir les options du plugins c'est ou ? je clique dessus est pas possible de modifier
Dernière modification par n3o51 (Le 08/02/2012, à 21:10)
Welcome to the real world
________________________________... |
Im new in pygame, right now im working with sprites. My question is how do i detect if the sprite has been clicked? I want to do something when the sprite was clicked just like a button.
thx :)
[Edited]
thx Stephen. In addition is there a way to know who is the sprite that was clicked? Here is sample code
boxes = pygam... |
Alon Swartz - Mon, 2010/12/13 - 18:26
When settings.DEBUG is set to False, exception tracebacks will be sent to settings.ADMINS. To make it simpler to track down how and why the exception was raised, it's beneficial to know which user caused the exception.
settings.py
MIDDLEWARE_CLASSES = (
...
'hubutils.middle... |
>>> class A(object):
>>> pass
>>>
>>> class B(A):
>>> pass
>>>
>>> import inspect
>>> inspect.getmro(B)
(<class '__main__.B'>, <class '__main__.A'>, <type 'object'>)
See the
>>> def classlookup(cls):
... c = list(cls.__bases__)
... for base in c:
... c.extend(classlookup(base))
... return c... |
Crétin
[Résolu] Kaleidagraph avec wine
Bonjour,
quelqu'un sait-il comment résoudre ce genre de problème sous wine?
avec sur la console:
ixme:win:WINNLSEnableIME hUnknown1 0x10024 bUnknown2 1: stub!fixme:font:load_VDMX Failed to retrieve vTablefixme:font:load_VDMX Failed to retrieve vTablefixme:font:load_VDMX Failed to ... |
The first step to performing any successful security engagement is reconnaissance. How much information one is able to enumerate about given personnel (for social engineering engagements) or systems can often impact the effectiveness of the engagement. In this post, we will discuss what Open Source Intelligence (OSINT)... |
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...
~12 users here now
News and links for Django developers.
Queryset to get posts that have new comments for the curren... |
How do I write a function with output parameters (call by reference)?
Python doesn’t support call by reference; a called function only hasaccess to the argument values (the actual objects), not the variablesin the calling scope.
To return multiple values, you can simply return a tuple, and use sequence unpacking at the... |
I am trying to create a system that enables the admin to upload a zipfile, then the script will automatically, using signals, unzip it, search for all the files in jpg,png. create a list of them and generate a database record according to it.
In models, i have Project and Photo table, Photo has Many-to-One aka Foreign ... |
I'm currently attempting to write a simple python program that loops through a bunch of subdirectories finding java files and printing some information regarding the number of times certain keywords are used. I've managed to get this working for the most part. The problem I'm having is printing overall information rega... |
there I am writting a simple app in Python that will monitor the usage of my cpu and ram and put it into a MySQL database for future processing here is my code :
import MySQLdb
import psutil
connection = MySQLdb.connect(host="localhost", port=8888, user="root", passwd="root", db="monitoring", unix_socket="/Applications... |
I use revision control (Subversion, to be exact) to keep track of the edits to my LaTeX documents. Is there a LaTeX package that interfaces with revision control? Specifically, it would be nice to see the revision number and time and date inside the document. (Obviously, I'd turn this off in the final version.) Also, i... |
Rovhell
Connexion wifi impossible
Bonjour et bonne année,
Voila j'ai un probleme avec ma connexion wifi. Je ne trouve pas comment me connecter avec mon pc portable sur le réseau wifi familiale de ma livebox (ni sur aucun autre réseau wifi d'ailleur) seul le cable ethernet fonctionne. Je ne vois pas d'interface qui me l... |
This is my first code. I would really appreciate a critique for it, if anyone can spare the time.
def wedcost(hours):
print " "
try:
hours = int(hours)
except ValueError:
print "Invalid input"
new_hours = raw_input("Please use only numeric characters. ")
hours = int(new_hours... |
The source data is clearly UTF-16. In your post it is displayed interpreted as ISO-8859-1, and has become slightly mangled in the process - some bytes have been converted to �.
There are also either some missing bytes caused by the copy-paste, or there are some control bytes in the middle of the sequence, which disru... |
WebSockets provide a way to communicate through a bi-directional channel on a single TCP connection. This technology is especially interesting since it allows a web server to push data to a browser (client) without having the client to constantly poll for it. In contrast to normal HTTP requests where a new TCP connecti... |
enebre
Re : Gmediafinder : Youtube/dailymotion/vimeo.. sans flash et bien plus....
bonjour smo,
je viens de réinstaller gmf sur mon petit netbook et
git clone git://github.com/smolleyes/gmediafinder2.git gmf2
cd gmf2/Gmediafinder
python gmediafinder.py
je constate que python-mecahanize n'est plus intégré dans les deps... |
kr2sis
configauration de Apache --- help please !!!
bonjour
autre souci que j'ai négligé par nécessité (il a fallu s'occuper du lourd avant de faire le léger...) : apache
je ne sais pas si c'est moi qui comprends rien, mais meme en cherchant partout, je ne trouve pas de tuto qui veuille que je réussisse une bonne confi... |
Ras'
Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4]
Hors ligne
ljere
Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4]
voici le code
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# auteur Gabriel Pettier
# license GPL V3 or later
# sert uniquement a compter le... |
I am having issues getting the Subject portion of my emails to show up when my program sends email. I thought I was following the RFC spec for SMTP.. but i cant seem to figure out what I am doing wrong. Any help is greatly appreciated.
def email():
sender = 'username@domain.com'
receivers = ['username@domain.co... |
November 16th, 2010 at 9:44 pm by Dr. Drang
The fix didn’t go the way I planned, and Dr. Twoot has, unfortunately, become more complicated. I thought I’d be able to do all the OAuth stuff in JavaScript, but
I couldn’t find a JavaScript OAuth library that made any sense to me;
the encoding on top of encoding needed to a... |
smo
Re : Gmediafinder : Youtube/dailymotion/vimeo.. sans flash et bien plus....
ola
ok cool je vais regarder ca apres, la j en fais un "normalement" c est un peu (beaucoup...) plus complique pour les ppa
j vous tiens au jus !
et whoue si vous avez des idees, hesitez pas hein ... j aimerais bien avoir des visualisations... |
The little pyqgis query engine
24 Jul 2013
@madmanwoo \o/
— Sean Gillies (@sgillies) July 17, 2013
What has this got to do with anything? Well let me explain. A little project I have recently started working on in my free time is a mini query engine for pyqgis to make fetching features easier. The goals are simple.
Use... |
Suppose i have :
models.py:
class Person(models.Model):
user = models.OneToOneField(User)
def get_album(self):
return self.album_set.all()
class Album(models.Model):
user = models.ForeignKey(Person)
photo = models.ImageField(upload_to = 'blahblah')
api.py:
class PersonResource(ModelResource):
... |
I introduced test-driven development in the second course. Not only does this encourage good habits in the students, it also makes it somewhat easier to test some of their exercises (though I still do not have a good approach to testing Tkinter-based GUI applications). In time-honored fashion we start with tests and a ... |
from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey
from sqlalchemy.orm import mapper
metadata = MetaData()
users_table = Table('users', metadata,
Column('id', Integer, primary_key=True),
Column('name', String),
)
class User(object):
def __init__(self, name):
self.name = name... |
tomtom
Re : [HOW TO] adesklets : installation sous Ubuntu Breezy
raaah ! j'ai un probleme d'interpreteur python !
J'ai installé toutes les librairies via synaptic et adesklets aussi.
J'ai DL YAB (Yet Another Bar) et j'ai ca :
[i]tomtom@barad-luin:/mnt/config/programmes/adesklets/yab-0.0.2$ [/i][b]ls -l[/b]
total 56
-rw... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.