text stringlengths 256 65.5k |
|---|
gio.FileEnumerator — Enumerated Files Routines.
class gio.FileEnumerator(gobject.GObject):
def close(cancellable=None)
def close_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def close_finish(result)
def get_container()
def has_pending()
def is_closed()
... |
I want to remove \n from the beginning lines like this \n id int(10) NOT NULL. I tried strip(), rstrip(), lstrip() replace('\n', ''). I don't get it. What am I doing wrong?
print(column)
print(column.__class__)
x = column.rstrip('\n')
print(x)
x = column.lstrip('\n')
print(x)
x = column.strip('\n') ... |
I'm trying out a code snippet from the standard python documentation to learn how to use the multiprocessing module. The code is pasted at the end of this message. I'm using Python 2.7.1 on Ubuntu 11.04 on a quad core machine (which according to the system monitor gives me eight cores due to hyper threading)
Problem: A... |
12.04 LTS, on a dell mini 10. Install stable until about a week ago. Updated about 1x a week, sometimes more often. Several days ago, I booted up and the system was no longer working correctly. All these symptoms occurred simultaneously: Cannot run (exit on opening, every time): Update manager, software center, ubuntuO... |
Txt2tags est une syntaxe wiki, un générateur de documents et un pré-processeur de textes très pratique, écrit par Aurélio Marinho Jargas.
Ce logiciel ressemble à ce qu'on peut avoir avec reStructuredText, la syntaxe MediaWiki (celle utilisé par wikipedia) ou à Markdown, mais en plus puissant grâce à son système de macr... |
FelixP
[Résolu] ! Script pour noms de musique
Salut à tous ! J'ai une petite question à vous poser… (Eh oui !)
Je cherche un script pour me créer un fichier avec la liste des noms des musiques qui sont dans un dossier donné, avec la syntaxe de Wikipédia (histoire de remplir ses serveurs de données !) en sachant que les... |
I have a problem with SQL Alchemy - my app works as a constantly working python application.
I have function like this:
def myFunction(self, param1):
s = select([statsModel.c.STA_ID, statsModel.c.STA_DATE)])\
.select_from(statsModel)
statsResult = self.connection.execute(s).fetchall()
r... |
I have a factory class XFactory that creates objects of class X. Instances of X are very large, so the main purpose of the factory is to cache them, as transparently to the client code as possible. Objects of class X are immutable, so the following code seems reasonable:
# module xfactory.py
import x
class XFactory:
... |
I am trying to open a page using urllib2 but i keep getting connection timed out errors.
The line which i am using is: f = urllib2.urlopen(url)
exact error is:
URLError: <urlopen error [Errno 110] Connection timed out>
Try adding a new
import urllib2
request = urllib2.Request('http://www.example.com/')
request.add_head... |
I am currently writing a nginx proxy server module with a Request queue in front, so the requests are not dropped when the servers behind the nginx can't handle the requests (nginx is configured as a load balancer).
I am using
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
The idea is to put the request... |
Commercial Services ✈ Flight Status API / Flight Tracking API / FlightAware API ✈ Documentation
FlightXML 2.0 Documentation
About
Using the FlightXML API, programs can query the FlightAware live flight information and recent history datasets.
Queries for in-flight aircraft return a set of matching aircraft based on a c... |
Babdu89
Re : HY-D-V1 un nouveau Desktop
Bonjour...
Alors, comme j'ai toujours du temps, de la place sur mes hdd, et de la suite dans les idées ...
Toujours au sujet de la tentative d'Hybrydiser la Cubuntu 13.04 32 bits ... Voir post ci-dessus .
J'ai réinstallé, j'ai fais les maj système en commande, j'ai été obligé d'i... |
Anyone who has ever argued against Postgres on performance grounds should go and read this, then eat their hats. Unsurprisingly, the real lesson is the classic: know your tools and know your data.
I’ve disabled comments for the moment – I’m getting too much stupid spam which my current filters can’t deal with. I’m in t... |
I had a similar problem, and it took me a long time to figure out all the math, as some of the proofs can be rather terse. So, I took it upon myself to write a full explanation of how to factor N, without all the symbols and relying on a bit less prior knowledge.
This is an application of the shared modulus attack expl... |
Dernière news : Fedora-Fr aux 15èmes Rencontres Mondiales du Logiciel Libre
Bien le bonjour, bien le bonsoir.
Après avoir installé skype en téléchargent la version :
J'ai essayé de le lancer, mais un problème surgit..
Impossible de lancer << skype >>
L’exécution du processus fils << skype >> a échoué (Aucun fichier ou... |
Say I have a list x with unkown length from which I want to randomly pop one element so that the list does not contain the element afterwards. What is the most pythonic way to do this?
I can do it using a rather unhandy combincation of pop, random.randint, and len and would like to see shorter or nicer solutions:
impor... |
Is there a list somewhere of recommendations of different Python-based REST frameworks for use on the serverside to write your own RESTful APIs? Preferably with pros and cons.
Please feel free to add recommendations here. :)
Something to be careful about when designing a RESTful API is the conflation of GET and POST, a... |
adelmorsux
Bug Radio tray...
Bonjour à toutes et tous,
Sur QQ 12.10 beta depuis 15 jours et apres qqes bidouilles je voulais retrouvé toutes mes radios que j’écoute sur Radio tray et là.... rien...
En faite si, j'ai tester l'install via la logiteque puis sous console et même résultat RIEN
moi@moi:~$ sudo apt-get instal... |
Class Cleaner
source code
object --+
|
Cleaner
Instances cleans the document of each of the possible offendingelements. The cleaning is controlled by attributes; you canoverride attributes in a subclass, or set them in the constructor.
scripts:
Removes any <script> tags.
javascript:
Removes any Javascr... |
I have some Pinterest code to show a Pin it button on my wordpress posts but it only grabs the post thumbnail. What I want is to grab the first post content image and only grab the thumbnail if there are no images in the post!??
Have tried tons of examples but nothing works.
1 answer
points
You need to get the image th... |
I've been having difficulty getting anything more than a simple index / to return correctly using bottle.py in a CGI environment. When I try to return /hello I get a 404 response. However, if I request /index.py/hello
import bottle
from bottle import route
@route('/')
def index():
return 'Index'
@route('/hello')
de... |
A couple weeks ago, I wrote a popular article, Pry, Ruby, and Fun With the Hash Constructor demonstrating the usefulness of pry with the Hash bracket constructor. I just ran into a super fun test example of pry that I couldn’t resist sharing!
The Task: Convert CSV File without Headers to Array of Hashes
For example, yo... |
C, Twelve Days of Xmas Style
New version:
main(Z,_){Z?(_=Z[" $X,X3Y<X@Z@[<XHZHX,"
"` \\(Z(X0Z0Z8[@X@^8ZHZHX(Z(`#Y(Z(X3[8"
"\\@_8ZHXHXHX(Z(` \\(Z(X0Z0Z8\\@_8ZIXI"
"X(Z(` \\,X0Z0Z8\\@_8ZHZHX,"])?main(0,_
-32),main(Z+1,_):0:(putchar((_>>3)["kt"
"wy~|tE/42"]-37),(_&7)?main(0,_-1):0);}
Output:
FFFFF OOOOO RRRR TTTTT Y Y... |
I wrote this function (used later to select elite species in the genetic algorithm) to select k best values out of n, where not all n values are unique. First of all, I'd massively appreciate any comments to the code, but I'm primarily concerned with the fact that for some reason values in second vector (var2) are also... |
My computer is running in Pacific time (hence datetime.datetime.fromtimestamp(0) gives me 1969-12-31 16:00:00). My problem is that given a timezone aware datetime object in Python, I want to get the UNIX timestamp (ie the UTC timestamp). What is the best way to do so?
import calendar
import datetime
import pytz
d = dat... |
How do I get the strings I can insert instead of 'gtk-execute'?
#!/usr/bin/python
import gobject
import gtk
import appindicator
if __name__ == "__main__":
ind = appindicator.Indicator("example-simple-client", "gtk-execute",
appindicator.CATEGORY_APPLICATION_STATUS)
ind.set_status (appindicator.STATUS_AC... |
In the package scipy there is the function to define a binary structure (such as a taxicab (2,1) or a chessboard (2,2)).
import numpy
from scipy import ndimage
a = numpy.zeros((6,6), dtype=numpy.int)
a[1:5, 1:5] = 1;a[3,3] = 0 ; a[2,2] = 2
s = ndimage.generate_binary_structure(2,2) # Binary structure
#.... Calculate S... |
Class: WWW::Delicious
Inherits:
WWW::Delicious
Defined in:
lib/www/delicious.rb,
lib/www/delicious/tag.rb,
lib/www/delicious/post.rb,
lib/www/delicious/errors.rb,
lib/www/delicious/bundle.rb,
lib/www/delicious/version.rb,
lib/www/delicious/element.rb
Overview
WWW::Delicious
WWW::Delicious is a Ruby client for delicious... |
The following PyGTK code displays a PNG file in a window.
Is there a simpler or better way of displaying the PNG file, like, by using a gtk.DrawingArea? For example, how do you resize the file?
import gtk
import pygtk
pygtk.require('2.0')
class Gui:
def __init__(self):
# Create an Image object for a PNG fil... |
[UPDATE 16 Aug 2011]Armin Ronacher has written a nice module called unicode-nazi that provides the Unicode warnings I discuss at the end of this article.
Though I can't use Python 3 for any of my projects, it does have a few nice things. One particular behaviour where it improves on Python 2 is forbidding implicit conv... |
We really like web.py but web2py has nothing to do with it. Really. The name is similar by accident.
They are very very different beasts although you can translate web.py code into web2py code.
This is an example of web.py code (not us)
import web
urls = (
'/(.*)', 'hello'
)
class hello:
def GET(self, nam... |
GTK+现在在Windows下最麻烦的就是各个库的配合问题,一些小问题都是因为各个库的兼容问题导致,最典型的就是libcairo和gdk的问题,比如:
GtkWarning: gdkdrawable-win32.c:2013 drawable is not a pixmap or window
这就是cairo库版本更新后出现的非严重问题,出现这种问题一般就只能提高日志中信息记录的等级,这种警告信息不再记录,不然,每次都会出现这种警告信息很烦人。
gtk+在windows下的gtk+3可以说基本上还属于玩票性质。官方缺少windows版的维护人员,所以一直到3.4版正式发布后,windows版都没法出来。只有一些志愿者公开了一些自己... |
Tuesday, July 29, 2008
Also there is a firewall/proxy which means no IM sites or IM protocols are allowed. This does kind of suck, but it is better than nothing. And this is only till December ( or so I hope ). Cheers, I'll update this tomorrow.
PS. No CD drives on any computer, how do I install Arch? Probably go home ... |
$sudo apt-get install kubuntu-desktop
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet... |
fffredo
traduction française (résolu)
Bonjour la communauté, je suis sous kde 4.12.1 et ubuntu 13.10.
Tout marche bien sur ma monture depuis un bon moment et là d'un coup j'ai kickoff qui passe en anglais tout comme libreoffice et les menus clic droit ????
j'ai bien depuis longtemps les paquets de langue installé (je l... |
Contents
Before reading:
These are mostly only demonstative values on how to tune your system for different needs. They are not some kind of an ultimate optional values. This article mostly aims to provide a quick overview on the ways to fine tune your system settings and being aware of the limitations.
The name is a b... |
jQuery and Ajax
While web2py is mainly for server-side development, the welcome scaffolding app comes with the base jQuery library[jquery], jQuery calendars (date picker, datetime picker and clock), the "superfish.js" menu, and some additional JavaScript functions based on jQuery.
Nothing in web2py prevents you from us... |
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'm getting the following error when attempting to run ./manage.py build_solr_schema
NotImplementedError: Subclasses must provide a way to build their schema.
Here are what my two search indexes look like:
class BookSearchIndex (SearchIndex):
text = CharField(document=True, use_template=True)
title = CharField(... |
Totor
[Résolu] Python et les pipes
Bonsoir,
Comme indiqué dans un précédant post je m'initie à Python.
Pour ce faire, j'ai un "petit" projet personnel dont voici l'une des fonctionnalités (la plus capitale à vrai dire) :
Depuis python, exécuter unitairement et « contrôler » des instructions bash (le contrôle se limitan... |
Possible Duplicate:
Is there a memory efficient and fast way to load big json files in python?
So I have some rather large json encoded files. The smallest is 300MB, but this is by far the smallest. The rest are multiple GB, anywhere from around 2GB to 10GB+.
So I seem to run out of memory when trying to load the file ... |
What I ended up doing is the following:
1)
I created a view for fetching search results, which boils down to this:
#/myproject/admin/views.py
@never_cache
def news_search(request):
#...query web service
if 'q' in request.POST:
search_term = request.POST['q']
else:
search_term = ''
news =... |
Basic wiki in 0.3
Basic wiki in Webpy 0.3. Demonstrates basic idea behind wiki. Lacks revisions.
Files
/schema.sql
/wiki.py
/templates:
/templates/view.html
/templates/new.html
/templates/base.html
/templates/index.html
/templates/edit.html
/model.py
/schema.sql
CREATE TABLE pages (
id INT AUTO... |
FelixP
[Résolu] Sources de Logiciels ne veut plus démarrer…
Salut ! Je reposte mon problème car il semblerait que mon ancien post soit tombé dans les abîsses…
Lorsque je veux ouvrir la liste des sources de logiciels, j'obtiens une erreur…
Ce problème est apparu, je crois, après ajout du dépot permettant d'installer cam... |
I am using the django-registration package. I do not want people to have a username but to enter instead their first and last names. Like on Facebook. How can I do that ?
Django auth (and by extension admin) requires a username - full stop. So you'll have to go to some effort to work around that.
You have a few issues ... |
I wanted to install LAMP, but didn't install it properly somehow. So trying to remove previous package, I used purge. A large number of package got uninstalled like software centre etc.
When I rebooted my system it was unable to login to my desktop. Something like running in low graphic mode appeared. I installed GNOME... |
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... |
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... |
January 28th, 2012 at 9:02 pm by Dr. Drang
You’ve probably run across a link to this cute math fact in the past few days:
[\frac{1}{998001} = 0.000001002\ldots100101102\ldots900901902\ldots999\ldots]
This relatively simple fraction generates a decimal number that contains, in order, every three-digit sequence from 000 ... |
senacle
[Résolu] [Zope] mysqldb sous Ubuntu 9.04
Bonjour,
J'ai migré vers Ubuntu 9.04 et depuis, je ne peux plus accéder à Mysql avec Zope.
Après quelques recherches, je pense comprendre ceci :
Zope 2.10 utilise python 2.4
Ubuntu 9.04 a installé beaucoup d'éléments pour python 2.6
L'erreur qu'il y a avec Zope est :
200... |
There were feature requests and bug reports. Much to do. Sadly, I'm really slow at doing it.
Thursday, December 30, 2010
Check out this item on eWeek: Java, C, C++: Top Programming Languages for 2011 - Application Development - News & Reviews - eWeek.com.
The presentation starts with Java, C, C++, C# -- not surprising.... |
I am trying to get 2 programs to share encrypted data over a network using public keys, but I am stuck with a difficult problem : the information that is shared (the keys and/or the encrypted data) seems to get modified. I am hoping to keep the encrypted data format as well as the format of the keys as simple as possib... |
cledesol
Re : [Conky] Alternative à weather.com ( icones conkyforecast )
Merci de cette précision.
C'est vrai aussi qu'en général c'est le soir que je me loggue sur mon PC ....
Donc, la météo du jour ... je l'ai vue en réel
CM : Asus M4A88TD-M µ : AMD Phenom II X6 1055T / RAM 4 Go
Video : EVGA GeForce GTS450 1Go - Ubun... |
DOM creation libraries
JavaScript performance comparison
Info
Tests a number of ways of generating DOM.
Another version bump to reset stats after a change to crel.
Preparation code
<script class="nothing" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js">
</script>
<script src="https://rawgithub.co... |
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... |
Simeon Franklin
Welcome to my Python Fundamentals Course!
Following are additional resources, links, and documentation that may come in handy on your Python learning adventure.
Windows users should make sure they have a usable python development environment set up.
Additional Resources
Learn Python the Hard Way!
The of... |
I'm having some trouble with my script. I want to implement a way to close my script with a string. The thing is, I don't want to wait for keyboard input. Instead, I want to check if something has been input through the keyboard while the script is waiting for a button to be pressed. I'm playing around with a Raspberry... |
According to this: http://code.activestate.com/lists/python-list/413540/, tokenize.generate_tokens should be used and not tokenize.tokenize.
This works perfectly fine in Python 2.6. But it does not work anymore in Python 3:
>>> a = list(tokenize.generate_tokens(io.BytesIO("1\n".encode()).readline))
Traceback (most rece... |
There must be an easier way to do this. I need some text from a large number of html documents. In my tests the most reliable way to find it is to look for specific word in the text_content of the div elements. If I want to inspect a specific element above the one that has my text I have been enumerating my list of div... |
spyke
Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr
jerhum oki mais alors je ny arrive pas a les faire tourner justement est ce normale comme wolfenstein , quake4 etc.....
Hors ligne
foxylechou
Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr
il faut autoriser le fichier a être exécuter dan... |
An Introduction to Haskell, Part 1: Why Haskell
Pages: 1, 2
Writing this function in a more modern language like Java, C++ or C# isn't as odious, because automatic memory management takes care of the first half of this function. Writing the expression 'filter even [1..10]' in dynamic languages like Perl, Python and Rub... |
DJ Raging-Bull
Carte PCMCIA WiFi non détecté sur ThinkPad 600X
Bonjour,
J'ai récuperé un IBM ThinkPad 600X équipé d'un Penium III @ 500 MHz et de 446 Mo de RAM, le disque dur fait environ 12 Go et il dispose d'un lecteur CD.
J'aimerais le refiler à ma mère qui s'en servirait pour de la bureautique de base. Je lui ai do... |
Claude LENDREVIE
Re : [Résolu] Libérer de la place sur le disque
Voici le résultat :
root@claude-System-Name:~# sudo add-apt-repository ppa:tualatrix/ppa
You are about to add the following PPA to your system:
The official Ubuntu Tweak stable repository
More info: https://launchpad.net/~tualatrix/+archive/ppa
Press [E... |
I wrote the sample program. It creates 8 threads and spawns process in each one
import threading
from multiprocessing import Process
def fast_function():
pass
def thread_function():
process_number = 1
print 'start %s processes' % process_number
for i in range(process_number):
p = Process(target=... |
I am writing a sample program to test the usage of multiprocessing pool of workers in python 2.7.2+
This is the code i have written in the python ubuntu interpreter
>>> from multiprocessing import Pool
>>> def name_append(first_name,last_name):
... return first_name+" "+last_name
...
>>> from functools import parti... |
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... |
blob: 3834e255cc9e0595f1ff7182d4e27a92dcafd140 (
plain
)
ARB_texture_float:
Silicon Graphics, Inc. owns US Patent #6,650,327, issued November 18,
2003 [1].
SGI believes this patent contains necessary IP for graphics systems
implementing floating point rasterization and floating point
framebuffer cap... |
I've implemented full-text search using pg_search gem for my Rails application
My migration to create index looks like
execute(<<-'eosql'.strip)
CREATE index mytable_fts_idx
ON mytable
USING gin(
(setweight(to_tsvector('english', coalesce("mytable"."name", '')), 'A') ||
' ' ||
setweight(to_tsvector('e... |
I want to cast data like [1,2,'a','He said "what do you mean?"'] to a csv-formatted string.
Normally one would use csv.writer() for this, because it handles all the crazy edge cases (comma escaping, quote mark escaping, CSV dialects, etc.) The catch is that csv.writer() expects to output to a file object, not to a stri... |
Example:
Drop a file in a glade designed window and it triggers Handler.open_from_path(path)
Set your window "main_win" Widget drag_data_received callback to on_main_win_drag_data_received. The URI is printed in the status bar.
from gi.repository import Gtk, Gdk
builder = Gtk.Builder()
builder.add_from_file("assets/ui/... |
anonym_user
Re : Besoin de testeurs pour Pap'rass
Salut,
Excellente idée ce soft !
J'ai juste un petit problème : les doc ne se classe pas dans les chemises que je crée. Après chaque tentative de classement la recherche sur le classeur m'indique qu'il est vide. La recherche par mot clé retrouve le doc mais le document ... |
Please bare with me as I am very new to Ubuntu and am just beginning to learn. So I have seen several solutions to the splash screen issue however I am having problems executing the repair. Once I enter
Sudo gedit /ect/default/grub
I get this.
** (gedit:11201): WARNING **: Could not load Gedit repository: Typelib file ... |
I have I thread in a daemon, that loops and performs the following query:
try:
newsletter = self.session.query(models.Newsletter).\
filter(models.Newsletter.status == 'PROCESSING').\
limit(1).one()
except sa.orm.exc.NoResultFound:
self.logger.debug('No PROCESSING newsle... |
sefiane
[résolu] Logithèque / Synaptic
Salut !
J'ai besoin de votre aide S.V.P !
Je suis débutant dans Linux , j'ai la version 12.O4 ATS.
Il fonctionnait très bien sans problème, une fois additionner Synaptic, Logithèque ne voulait pas répondre ! Il plantait, lorsque je fermais, une fenêtre apparaît, " logithèque ne ré... |
Hizoka
encore du sed et awk
Bonjour !
Je viens vers vous pour demander un peu d'aide...
Voici un exemple de fichier sur lequel je travaille :
poupou (0.0.1~ppa1~precise) precise; urgency=low ()
* blublu de bugs
* blabla
-- Belleguic Terence <hizo@free.fr> Fri, 12 Oct 2012 06:39:46 +0200
poupou (0.0.0~ppa1~precise... |
Mod_python's PSP: Python Server Pages
by Gregory Trubetskoy
02/26/2004
The new 3.1 version of mod_python introduces several major additions and enhancements over the previous 3.0 version. They are PSP, Cookie, and Session support. This article will introduce the first addition on the list, PSP.
Python Server Pages (PSP... |
mars
Connaissances de base pour Kubuntu
Bienvenue à tous les lecteurs.
Ce sujet a pour but d'apporter les connaissances de base à toute personne débutant sous Kubuntu.
Il est très bon pour tout débutant de lire ce post, mais il est aussi très conseillé aux personnes plus expérimenté, car il contiendra des conseils de b... |
gprof & -pgEdit
To profile the application with gprof:
Compile the code with -pg
Link with -pg
Run the application. This creates a file gmon.outin the current folder of the application.
At the prompt, in the folder where gmon.out lives: gprof path-to-application
PAPIEdit
The Performance Application Programming Interfac... |
I am using this method to save a file:
def save(self):
file_data = ConfigParser.ConfigParser()
subjects_number = self.subjects.get_n_pages()
si = range(1, subjects_number)
for sn in si:
subject_content = self.subjects.get_nth_page(sn)
subject_name = self.subjects.get_tab_label(subject_co... |
Mass mailing Internet scams intentionally use poor spelling, grammar etc to filter down to target ignorant audience .
MotherJones - Meet the people behind the Wayback Machine, one of our favorite things about the internet
The original open source Wifi Hotpot for Windows 7, Windows 8 and Windows Server 2012!
Free open s... |
This project is archived and is in readonly mode.
RealDictCursor doesn't work with named cursors
Reported by Psycopg website | August 25th, 2011 @ 05:18 PM
Submitted by: justin.vanwinkle@gmail.com
IndexError Traceback (most recent call last)
/home/jvanwink/repos/milosolr/loader/<ipython-input-83-e90934fd1f1e>in () ----... |
Without seeing your code, it's unclear if the problem is the code or the data file the code is reading.
When you open the file, are you doing:
file = open("essay.txt")
or:
import codecs
file = codecs.open("essay.txt", encoding="utf-8")
What does:
print file.encoding
say if you add it just below the open line?
Both o... |
The new 3.1 version of mod_python introduces several major additions and enhancements over the previous 3.0 version. They are PSP, Cookie, and Session support. This article will introduce the first addition on the list, PSP.
Python Server Pages (PSP), as you probably guessed already, is a way to inline Python in HTML o... |
A key step is to power-cycle the adapter (yes, I had to resort to reading the fine manual). (Also, I reset the adapter.)
After copying interfaces.static to interfaces I then ran service networking restart and navigated firefox to 192.168.1.252 (as previous) and configured the wireless (SSID and password).
The key step ... |
Occasionally web2py has been criticized for using exec/execfile instead of import/reload for executing models and controllers. We argue that the web2py method is better for two reasons:
The test code:
import time
open('a.py','w').write('a=True')
import a
t0=time.time()
for i in range(10000): reload(a)
print time.time()... |
Hi,
Sorry for interrupting, but I'm struggeling with trying to remove this ZenPack.
I think I managed to mess this up quite badly as I upgraded Zenoss to 3.0 when this ZenPack was marked as broken.
Now I'm unable to remove it.
Is there something short of reinstalling that I can do to remove this Zenpack and recover?
Be... |
JavaScript
sama74 — 2013-12-24T08:35:51-05:00 — #1
This is sort of a PHP question too, as that is where I'm adding the code, but it is to set up for javascript.
Basically I just want to know what format of date string JS will read.
I'm trying to make a simple graph with Highcharts JS, the data comes from an SQL DB Tabl... |
rmanf30
Re : Test de Qualité des Codecs Libre VS x264 - Septembre 2010
Ma surprise à propos des paramètres été justifiée, apparemment ils ne sont pas corrects.
-sn -vcodec huffyuv -acodec flac %1.mkv
J'ai le message d'erreur suivant : "Peut-être des paramètres incorrects tels que bit_rate , le taux , la largeur ou la h... |
One way to do it is to export the article history, and then process the revisions using a local tool like git blame. This could be done using a script.
To export the article history, use Special:Export, specifically: https://en.wikipedia.org/w/index.php?title=Special:Export&history=1&action=submit&pages=Blinkenlights.
... |
I work on a project which uses python's logging module for displaying messages. I have my own project, which uses a module from a common repository, so I don't want to change any of the logging statements in that part of the code.
However, memory usage appears to be quite an issue in my program, so I'd like to log memo... |
Retrieving Mails with Twisted
Programming a POP3 client to retrieve mails in the Twisted framework is more complex and takes more code. The logic to retrieve mails is all in a class that subclasses POPClient (from twisted.mail.pop3client). Due to the event-driven nature of Twisted, it's easier to define a method for ea... |
PotatoMasher
Re : Script d'installation pour imprimantes Brother
D'accord, alors j'ai retiré brscan2 de /etc/sane.d/dll.conf. brscan-skey -l donne toujours le même device, "Not Registered".
Après avoir jeté un coup d'oeil aux groupes, je réalise que mon utilisateur n'est pas membre du groupe "scanner" et du groupe "san... |
the au600 device is a usb PSTN gateway that allows using a plain old telephone as VoIP phone.
This driver got reverse engineered, so not everything might work as expected yet.
Current developer: Markus Rechberger \<mrechberger|at|gmail.com>
IRC on freenode: mrec/mrec_
Supported:
Probably supported:
OEM Page:
A note on ... |
Here's a list of non-LISP languages that allow for macros (including those mentioned in other answers) -- the links are to an explanations of the respective macro systems:
Languages that have features that are kind of like macros, or which accomplish more or less the same thing in different ways (namely Smalltalk and I... |
I tried using MatchTemplate() to match numbers in image. For example, the numbers are [0985-977-735] in image. And got the results as following:(number, location) [(0, 1), (3, 103), (5, 33), (5, 116), (7, 62), (7, 73), (7, 85), (8, 21), (9, 11), (9, 53)]
But in most situations, the accuracy is very low.
[0983-945-180]:... |
I am trying to output the index of makeList[start] to makeList[end]. I have all the correct start and end values, which are about 11 pairs total. However, I dont get the correct output because it doesn't print out all the possible output. Why is that happening?
def searchPFAM(fname):
with open(fname,'rb') as f:
... |
percherie
Re : Picasa 3.9.0 dans wine : connexion à picasaweb impossible
Normalement tu devrait avoir AUCUNE manipulation à faire une fois le scripts démarré, j'ai tout automatisé et pour l'occasion j'ai même ajouter l'installation de IE8 comme paquetage chez PlayOnLinux (ils ne l'avait pas encore codé).
Par contre le ... |
I'm trying to scrape information about new album releases of a site, and I'm handling this via Nokogiri. The idea would be to create a nice array that would contain items like so
[ 0 => ['The Wall', 'Pink Floyd', '1979'], 1 => ['Led Zeppelin I', 'Led Zeppelin', '1969'] ]
This is my current code. I'm a total ruby newbie... |
I am adding date_added and date_modified fields to a bunch of common models in my current project. I am subclassing models.Model and adding the appropriate fields, but I want to add automated save behavior (i.e: evey time anyone calls MyModel.save(), the date_modified field gets updated. I see two approaches: overridin... |
I use amulet as testing framework for charms which we developing. I've already tried to reproduce an example, provided on https://juju.ubuntu.com/docs/tools-amulet.html and it's work fine. But now I'm trying to do the same basic setup for charm, which was developed and stored on hard drive ('cf-nats' charm was cloned f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.