text stringlengths 256 65.5k |
|---|
» Scripting Gedit +
Gedit allows you to write python scripts which interface with its backend (and frontend via pygtk). This is very cool, for reasons obvious to VIM and Emacs users. You can write your own plugins to manipulate the document you are editing in many useful ways.
Well I was using various external tools to... |
The Django Framework's Killer Feature for Java Developers
Code Speaks for Itself
Here is how the model definition for the invoicing application would look like (usually in a file called models.py):
from django.db import models
class Product(models.Model):
name = models.CharField("Name",max_length=30)
price = mo... |
You are here: Home ‣ Dive Into Python 3 ‣
Difficulty level: ♦♦♦♦♦
chardet to Python 3
❝ Words, words. They’re all we have to go on. ❞
— Rosencrantz and Guildenstern are Dead
Question: what’s the #1 cause of gibberish text on the web, in your inbox, and across every computer system ever written? It’s character encoding.... |
#2676 Le 15/02/2013, à 19:14
mulder29
Re : TVDownloader: télécharger les médias du net !
Et je reçois
python: can't open file
alors que j'ai installé Python 2.7.3, hier.
Hors ligne
#2677 Le 15/02/2013, à 19:26
k3c
Re : TVDownloader: télécharger les médias du net !
si tu tapes
which python
ça affiche quoi ?
Dernière mod... |
I am running a Django site on Apache which is front'ed by Nginx instance to serve my static media.
I expose an API via django-tastypie to a model that I need to PATCH a field on. When I do local testing (via the django runserver) everything works as expected. On the live server however I get "400 (Bad Request)" returne... |
Pyglet + PyCairo 'Hello World'
Feb 22 2008, 4:10PM
I couldn't find any examples of the two combined, so, with the help of this PyGame example I munged the following together. Just posting in case it helps someone else... we'll see where all this takes me...
import cairo, cStringIO
from pyglet import font, window, image... |
['a','a','b','c','c','c']
to
[2, 2, 1, 3, 3, 3]
and
{'a': 2, 'c': 3, 'b': 1}
['a','a','b','c','c','c']
to
[2, 2, 1, 3, 3, 3]
and
{'a': 2, 'c': 3, 'b': 1}
>>> x=['a','a','b','c','c','c']
>>> map(x.count,x)
[2, 2, 1, 3, 3, 3]
>>> dict(zip(x,map(x.count,x)))
{'a': 2, 'c': 3, 'b': 1}
>>>
This coding should give the result... |
You're talking about AJAX. AJAX always requires 3 pieces (technically, just two: Javascript does double-duty).
Client (Javascript in this case) makes request
Server (Django view in this case) handles request and returns response
Client (again, Javascript) receives response and does something with it
You haven't specifi... |
There are many such methods, they are referred as connected-component labeling. Here are some of them that are not so old (in no particular order):
Light Speed Labeling For RISC Architectures, 2009
Optimizing Two-pass Connected-Component Labeling Algorithms, 2009
A Linear-time Component-Labeling Algorithm Using Contour... |
Well, since you seem to be up on your python, may I suggest that you copy your text into python, like:
s="""this is gonna
last quite a
few lines"""
then do a:
for i in s.split('\n'):
print 'mySB.AppendLine("%s")' % i
# mySB.AppendLine("this is gonna")
# mySB.AppendLine("last quite a")
# mySB.AppendLine(... |
I am trying to stream cast a computer generated video using gstreamer and icecast, but I cannot get gstreamer appsrc to work. My app works as expected if I use xvimagesink as the sink(see commented code below). But once I pipe it to theoraenc it does not run.
I exchanged shout2send with filesink to check if the problem... |
JavaScript
mattastic — 2010-07-20T05:24:31-04:00 — #1
Hi Folks,
Is there a way to use them in strings?
Can I search for them and replace them with an ascii value or silimar somehow?
Thanks in advace
autisticcuckoo — 2010-07-22T01:18:41-04:00 — #2
I don't understand.
If it's from an input field it's already a string!
Do... |
I am debugging some code and I want to find out when a particular dictionary is accessed. Well, it's actually a class that subclass dict and implements a couple extra features. Anyway, what I would like to do is subclass dict myself and add override __getitem__ and __setitem__ to produce some debugging output. Right no... |
Lets Build a Backbone Based Framework!!
I’ve been building large scale applications in Backbone for about 8 months now. In that time I’ve used throax as well as building custom solutions in backbone.
Last night, I live coded the creation of a demo backbone framework similar in features to Thorax. I’m going to walk you ... |
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... |
>>> class Oops(object):
... def __init__(self):
... Oops.__call__ = self
...
>>> x = Oops()
>>> x()
>>> Z = lambda f: (lambda x: f(lambda *args: x(x)(*args)))(lambda x: f(lambda *args: x(x)(*args)))
>>> fact = Z(lambda f: lambda x: 1 if x == 0 else x * f(x-1))
>>> fact(5)
... 120
>>> 0 < 0 == 0
... F... |
laster13
Re : VPN nas4free
bon je seche un peu mais bon on va bien finir par trouver...
As tu active le ftp du nas et fonctionne t il? tu peux faire un essai avec filezella par exemplde
Hors ligne
tynolol
Re : VPN nas4free
je ne l'avais pas activé.. (:P)
j'ai coché la case "Indique s'il est permis de se connecter direc... |
Phoen1x
Re : [HOW TO] adesklets : configuration des desklets
J'ai besoin d'un coup de main, donc j'ai voulu installer les adesklets
Weather forecast et system moniteur
Le problème c'est que j'avais pas vu le tuto pour l'installation de adesklest .
J'ai bigouilller un long moment sur weather car il ne me le lancait pas ... |
In the DJUGL post-meet pub chat Simon Willison was curious about people’s experiences combining Django with SQLAlchemy. I’ve used SQLAlchemy’s ORM with Django in two projects; on both occasions I quickly chose to substitute Django’s ORM with SQLAlchemy’s because I was dealing with an existing SQL schema which I could n... |
nm will only work if the library wasn't stripped of its symbols. However, nm -D could show you some info:
nm -D /lib/libgcc_s.so.1
But there's another tool which can help you: readelf
readelf - Displays information about
ELF files.
And if you check the man pages, option -s: Displays the entries in symbol table secti... |
wlourf
Postez vos scripts Lua pour Conky !
Bonsoir à tous ceux pour qui chaque pixel du bureau compte,
J'ouvre ce topic suite aux discussions sur le topic des conky pour discuter des scripts Lua dans conky.
Lua est un langage de script léger et facile a utiliser qui permet d'ajouter de nouvelles fonctionnalités à nos c... |
When we want a user-friendly command-line interface
What we want are:
useful help and usage messages
easy to parse the arguments
Docopt helps you:
define interface for your command-line app
automatically generate parser for it
Seems other libs in python can handle this also, like: argparse, optparse, getopt, click.
But... |
philoup44
PITIVI (super jeu mais ...)
Je teste PITIVI sous 12.04 LTS
C'est un jeu dont l'objectif est de réussir à Effectuer le rendu d'un montage Vidéo
avec au moins 10 coupes et 10 fondus entrants et sortants
Le second objectif est de comprendre comment l'IA vous a contré
Ce jeu est plein de surprise
Il peut vous ten... |
#1651 Le 31/05/2012, à 19:24
Hizoka
Re : [glade2script-GTK2] Interface graphique pour script bash ou autre.
Pour le blocage de l'interface ? Essai de mettre le sleep également avant la commande EXEC (ton ordi trop puissant ...)
bien vu, ca semble etre ok avec un sleep 0.10 avant le load.
Hors ligne
#1652 Le 01/06/2012,... |
PPdM
goolgle et Ubuntu 64bits
Salut
Je vous soumet un probleme recurent que je croyais du a ma config matérielle mais qui se manifeste sur un autre PC totalement différent.
Les accès a google (tout les sites) sont très lent quand ce n'est pas impossible sur les config en 64 BIts,
j'ai deux PC (un portable et un fixe) q... |
#0 Re : -1 » [Script] reconnaissance vocale avec google » Le 28/02/2012, à 17:07
#1 Re : -1 » [Script] reconnaissance vocale avec google » Le 28/02/2012, à 17:14
n3o51
Réponses : 484
ben si elle es bien la , je pense
Bon quand je veut installé la nouvelle version j'ai
Exception in thread Thread-1:
Traceback (most recen... |
My question is: What is it that makes those languages suitable? From what I know, they are slower than other languages, and operate at a higher abstraction level, which means they are too far from the hardware. The only reason I could think is because of their advanced string manipulation capabilities, but I believe th... |
However, there is a pitfall in both solutions. The reason is that it merges the values with the same hash. So, it depends on whether the used values may have the same hash. It is not that crazy comment as you may think (I was also surprised earlier), because Python hashes some values the special way. Try:
from collecti... |
When you execute a python script, does the process/interpreter exit because it reads an EOF character from the script? [i.e. is that the exit signal?]
The follow up to this is how/when a python child process knows to exit, namely, when you start a child process by overriding the run() method, as here:
class Example(mul... |
I am working through ThinkStats, but decided to learn Pandas along the ways as well. So the code below reads in data from a file, does some checking and then appends the data to a list. I end up with several lists containing the data I need. The code below works (except for scrambling up the columns...)
My question is:... |
HappyColibris
[Résolu] Le téléchargement des infos du dépôt a échoué 404 Not Found
Bonjour à tous,
Depuis quelques jours, j'ai un souci au niveau de la mise à jour.
En passant par le gestionnaire de mise à jour, j'ai : "Le téléchargement des informations du dépôt a échoué" :
W:Failed to fetch http://ppa.launchpad.net/p... |
I do not understand how to change a global variable when using the flask extension flask-script. To demonstrate my problem I developed the following small flask application, which will increase a global counter variable for every request call. In addition it offers a reset function to reset the global counter:
# -*- co... |
#2626 Le 05/01/2013, à 15:18
rvhm
Re : TVDownloader: télécharger les médias du net !
bjr
j'ai commencé à mettre les dépendance de tvdownloader
il me manque "libkrb53 (>= 1.6.dfsg.2)"
ou je pourrais le trouver ?
merci
Hors ligne
#2627 Le 06/01/2013, à 18:23
rvhm
Re : TVDownloader: télécharger les médias du net !
bonjour... |
I've just started programming, and am working my way through "How to think like a Computer Scientist" for Python. I haven't had any problems until I came to an exercise in Chapter 9:
def add_column(matrix):
"""
>>> m = [[0, 0], [0, 0]]
>>> add_column(m)
[[0, 0, 0], [0, 0, 0]]
>>> n = [[3, 2], [5, 1]... |
According to http://www.pygtk.org/docs/pygtk/gtk-constants.html, there are five state types: STATE_NORMAL, STATE_INSENSITIVE, etc. I want to set the background color of a Table, HBox, VBox, whatever, and I've tried setting every possible color of every kind of state:
style = self.get_style()
for a in (style.base, s... |
If you already have some custom save().-magic going on I would recommend using a post_save() signal or a pre_save() which ever would work best for you.
in your models.py
@receiver(pre_save, sender=MainModel)
def save_a_historicmodel(sender, **kwargs):
#do your save historicmodel logic here
or
def save_a_historicmo... |
Building a Doubletalk Browser with wxPython
Okay, now let's build something that's actually useful and learn more about the wxPython framework along the way. As has been shown with the other GUI toolkits, we'll build a small application around the Doubletalk class library that allows browsing and editing of transaction... |
When defining a decorator using a class, how do I automatically transfer over__name__, __module__ and __doc__? Normally, I would use the @wraps decorator from functools. Here's what I did instead for a class (this is not entirely my code):
class memoized:
"""Decorator that caches a function's return value each time... |
Thanks to Andre for his answer. Here are my findings.
Storing ints directly
Redis keys must be strings. If you want to pass an integer, it has to be some kind of string. For small, well-defined sets of values, Redis will parse the string into an integer, if it is one. My guess is that it will use this int to tailor its... |
I instantiate GtkInfobars a lot in my GTK+ application in order to communicate with the user. There are various types of infobars, depending on the message. Basically, any infobar could be a combination of the 4 different infobar message types and 5 different icons (which are painted on the left side of the infobar).
I... |
The WordNet database contains all sorts of interesting relationships between words: it can categorize words into hierarchies, find the parts of an object, and answer many other interesting questions.
Categorizing words
What, exactly, is a dog? It's a domestic animal and a carnivore, not to mention a physical entity (as... |
How would I implement this neural network cost function in matlab:
Here are what the symbols represent:
% m is the number of training examples. [a scalar number]
% K is the number of output nodes. [a scalar number]
% Y is the matrix of training outputs. [an m by k matrix]
% y^{(i)}_{k} is the ith training output ... |
There is a lot of discussions of Python vs Ruby, and I all find them completely unhelpful, because they all turn around why feature X sucks in language Y, or that claim language Y doesn't have X, although in fact it does. I also know exactly why I prefer Python, but that's also subjective, and wouldn't help anybody cho... |
I'm writing a computer program to play the word game "Ghost."
Here's how the current programs works:
--User selects a letter (right now it only works if the user moves first)
--Computer has a list of all possible odd-numbered words in its dictionary (this is so that the user will have to complete each word and therefor... |
I know of the non-standard %uxxxx scheme but that doesn't seem like a wise choice since the scheme has been rejected by the W3C.
Some interesting examples:
The heart character. If I type this into my browser:
http://www.google.com/search?q=♥
Then copy and paste it, I see this URL
http://www.google.com/search?q=%E2%9... |
Google Maps gives me the Lat and Long of a location in decimal notation like this:
38.203655,-76.113281
How do I convert those to Coords (Degrees, Minutes , Seconds)
38.203655 is a decimal value of degrees. There are 60 minutes is a degree and 60 seconds in a minute (1degree == 60min == 3600s).
So take the fractional p... |
To create a unicode object, you can use
from settings import DEFAULT_CHARSET
s = unicode(request.POST['item'], request.encoding or DEFAULT_CHARSET)
Note that items inside request.POST should already be of type unicode, hence no conversion should be required.
In [1]: a = u'Täöüß'
In [2]: a
Out[2]: u'T\xe4\xf6\xfc\x... |
I need to do one thing if args is integer and ather thing if args is string.
How can i chack type? Example:
def handle(self, *args, **options):
if not args:
do_something()
elif args is integer:
do_some_ather_thing:
elif args is string:
do_totally_different_thing... |
This is the code,
import webapp2
from framework import bottle
from framework.bottle import route, template, request, error, debug
@route('/')
def root():
return 'hello world'
class MainHandler(webapp2.RequestHandler):
def get(self):
root()
app = webapp2.WSGIApplication([
('/', MainHandler)
], de... |
ADcomp
Re : ADesk Bar : Barre de lancement rapide [python/gtk/cairo]
Yep ..
@ all : lien pour les sources rectifié ( )
@ frafa :
-add n'importe quoi, puis fermer fenetre sans ajout, ajoute quand meme une entrée vide. tu devrait gerer ca...
+1
-et si pas trop galere a coder avoir acces aux reglages d'un plug-in via clic... |
Chris__
Re : gReemote, télécommande + prog TV pour Freebox HD
Hmmm l'upload du fichier deb a raté... Désolé :-) Cette fois il a réussi
Hors ligne
tocks
Re : gReemote, télécommande + prog TV pour Freebox HD
Pour la barre sa fonctionne très bien.
Moi aussi en regardant, je ne trouve pas vraiment d'endroit pour rajouter c... |
I started the debugging session over by quitting with the (q)uit command, and restarted the debugger by kicking off the script again:
(Pdb) q
{'1': 2, '0': 1, '3': 4, '2': 3, '5': 6, '4': 5, '7': 8, '6': 7}
****************************************
****************************************
line>> 1 2 3 4
{'1': 2, '0': 1,... |
XHTML is the Most Important XML Vocabulary
Taking the long view of recent technology, XHTML may be the most important XML vocabulary ever created. What I mean is not that XHTML will be the most widely deployed XML vocabulary, though if we take the long view, it could be. What I mean is that XHTML puts XML's reputation ... |
I have a list of variable names, like this:
['foo', 'bar', 'baz']
(I originally asked how I convert a list of variables. See Greg Hewgill's answer below.)
How do I convert this to a dictionary where the keys are the variable names (as strings) and the values are the values of the variables?
{'foo': foo, 'bar': bar, 'ba... |
September 20th, 2011 by bettermanlu
http://stackoverflow.com/questions/986006/python-how-do-i-pass-a-variable-by-reference
Question
The Python documentation seems unclear about whether parameters are passed by reference or value, and the following code produces the unchanged value ‘Original’
class PassByReference:
... |
#2201 Le 30/09/2012, à 19:40
k3c
Re : TVDownloader: télécharger les médias du net !
Comme undercover boss et preuve à l'appui donnent le même résultat, je subodore que le site tmc.tv a changé...
Edit : en fait le site n'a pas changé, il y a plusieurs syntaxes possibles pour la commande rtmpdump, et faut juste que j'en ... |
I've got a script which runs with python 3 except string literals. Python 2.x force me to prefix string literals with u'' and python 3 dosen't understand it. How to so solve that?
try this when running it in python 2.x:
>>> from __future__ import unicode_literals
>>> s=['xx','yy','zz','aa']
>>> s
[u'xx', u'yy', u'zz', ... |
This document describes the use of the XmlTextReader streaming API added to libxml2 in version 2.5.0 . This API is closely modeled after the XmlTextReader and XmlReader classes of the C# language.
This tutorial will present the key points of this API, and working examples using both C and the Python bindings:
Table of ... |
In this guest-post, Jon Brown shares a solution to the age-old problem of preventing duplicate content from addon-domains in cPanel. Jon explains the issue and shares his methodology in crafting an elegant solution applied via .htaccess. If you’re using cPanel and want to improve your SEO, this will help. Here is the t... |
Theory
The reference count usually works as such: each time you create a reference to an object, it is increased by one, and whenever you delete a reference, it is decreased by one.
Weak references allow you to create references to an object that will not increase the reference count.
The reference count is used by pyt... |
I've got a small web-app built with Tornado where I'd like to use ZODB for some data storage. According to the ZODB docs, multi-threaded programs are supported, but they should start up a new connection per thread. I think that means that I have to do something like
### On startup
dbFilename = os.path.join(os.path.dirn... |
I have a file that has 50 lines (each line has a name on it) and I would like to take each line and read it, then print it, but in a format that has 5 columns and 10 lines per column.
It would like something like this:
xxxxx -- xxxxx -- xxxxx -- xxxxx -- xxxxx
xxxxx -- xxxxx -- xxxxx -- xxxxx -- xxxxx
xxxxx -- xxxxx --... |
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... |
If you review the sidebar "wxPython Window Layout," you'll see a number of choices available, but we have chosen to use the brute-force mechanism for the Edit Transaction dialog:
# Create some controls
wxStaticText(self, -1, "Date:", wxDLG_PNT(self, 5,5))
self.date = wxTextCtrl(self, ID_DATE, "",
... |
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... |
Okay, so what I want to say here is that the code that searches for a graph minor is extremely slow in situations where it should be able to respond instantaneously. Here's a function written by DSM when responding to my last question here:
def has_minor(G, H):
try:
m = G.minor(H)
return True
ex... |
yfrog API
Please request your developer key before using yfrog API.
Uploading Media Files into yfrog Account
Use this API to upload media files into yfrog account using POST.
API Syntax
http://yfrog.com/api/xauth_upload or https://yfrog.com/api/xauth_upload
Parameters
media-- filename required.
key-- your API key requi... |
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... |
Tornado is a non-blocking server and Web framework from Facebook. One of the nice features of Tornado is its ability to respond to requests asynchronously. The Tornado tutorial includes this example of a request handler that builds its results by calling on the FriendFeed API:
class MainHandler(tornado.web.RequestHandl... |
The wxPython ToolBar look and feel does not match that of the current operating system - it has a gradient similar to the Windows Vista / 7 menubar I.E. a silver gradient.
Is there any way to change this so that it blends in with the operating systems look and feel?
Note: There is a style flag that can be set when crea... |
The PickledObjectField for Object Storage in Djangoby dave on 2011-01-05
I've become a really big fan of the PickledObjectField provided by this django snippet. So much so that I use it in almost every django model I create these days.
Basically it serves as the best way to do an object store in your database and perfe... |
Class StockholmIterator
source code
object --+
|
Interfaces.AlignmentIterator --+
|
StockholmIterator
Loads a Stockholm file from PFAM into MultipleSeqAlignment objects.
The file may contain multiple concat... |
I'm tinkering around with pygame right now, and it seems like all the little programs that I make with it hang when I try to close them.
Take the following code, for example:
from pygame.locals import *
pygame.init()
# YEEAAH!
tile_file = "blue_tile.bmp"
SCREEN_SIZE = (640, 480)
SCREEN_DEPTH = 32
if __name__ == "__main... |
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'm writing a list of inputs and outputs for to be compared in unit tests.
var equals = [
//input //output
["name:(John Smith)", "name:(John~ Smith~)" ],
["name:Jon~0.1", "name:Jon~0.1" ],
["Jon",... |
Personally, I would avoid multiple encryption protocols most of the time. It adds significant extra implementation complexity without making your data any more secure in the real world, unless the encryption protocol you are using is ultimately broken or becomes computationally feasible at a later date to break.
Grante... |
Norin
Re : [Info] Installation du driver Libre ATI Radeon
*se sent incroyablement stupide *
Mais merci! Ça marche ^^
Mais je n'ai un FPS de seulement 40 sur le jeu cube... je ne sais pas pour les autres
cipher16
Re : [Info] Installation du driver Libre ATI Radeon
Bonjour, j'ai une carte ATI 9200 SE, et ... après modifi... |
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... |
Tales of Rescuing Old Hardware
by Mikhail Zakharov
05/05/2005
Everything began one fine day when I visited our storage room to see if there was anything interesting for me to look at. Soon I came across an old shabby dark-gray Toshiba notebook thrown there amidst different computer rubbish long ago, from the time when ... |
A* doesn't really care about the shape of the graph you're using.
Let's see the pseudocode for A*, stolen from Wikipedia:
function A*(start,goal)
closedset := the empty set // The set of nodes already evaluated.
openset := {start} // The set of tentative nodes to be evaluated, initially containing the sta... |
Serving XML
Other languages: français | ...
Problem
How to serve XML files correctly?
This is needed when you have a third-party application posting data to your service and expecting some kind of XML response.
Solution
Create your XML template with the XML file you want to serve (i.e. response.xml). If the XML has any... |
cycle~ tones crack and pop! help!
I am using Max/MSP to create an intonation program for my graduate thesis. I wrote some of it in Max 4 and just updated to 5. The tone production is very simple – the user hits a key on the kslider (midipiano) which generates a cycle~ for the Hz I want to hear for that key. I think tha... |
evann83
Mode superutilisateur
Bonjour
Me voici avec un soucis que je n'arrive pas a résoudre:
j'aimera utiliser la commande "javac" pour pouvoir compiler un fichier java sur mon bureau mais apparement il n'a pas envie puisque il me demande d'installer la JDK, logique je me suis dis après coups. Me voilà parti pour inst... |
Reprap 3D Printer Build Log: 2nd Entry
Here’s update 2. I was hoping to be a little further along for this update, but if building a 3dprinter teaches you anything, it’s that anything can go wrong and you need to be willing to adapt and have patience. Also, a set of small files, a soldering iron and a drill will be you... |
The following example "walks" through a directory, prints the names of all the files, and calls itself recursively on all the directories.
import os
def walk(dir):
for name in os.listdir(dir):
path = os.path.join(dir,name)
if os.path.isfile(path):
print path
else:
wal... |
I am trying to follow the example for batch processing found in: http://developers.facebook.com/docs/reference/ads-api/batch-requests/
specifically, the curl command:
curl -F 'access_token=____'
-F 'batch=[
{
"method": "POST",
"relative_url": "6004251715639",
... |
Module: ActionView::Helpers::TextHelper
Extended by:
Includes:
Included in:
Defined in:
actionpack/lib/action_view/helpers/text_helper.rb
Overview
The TextHelper module provides a set of methods for filtering, formatting and transforming strings, which can reduce the amount of inline Ruby code in your views. These help... |
For example, I have a config file named rule1.conf like this:
[Basis]
user = "sunhf"
time = "2012-12-31"
[Bowtie]
path = "/usr/bin/bowtie"
index = "/mnt/Storage/sync/hg19"
And a models.py like this(using a package named magic.py..):
from magic import Section
class Conf:
__confname__ = None
basis = Section(["us... |
Ok, I see plenty of these errors around. I have tried everything I know to do and have yet to figure this out.
I am working on a development server running python 2.5 and Django 1.3. Django 1.3 was installed using python setup.py install after unpacking the tar.gz download.
All works well, I seldom have the need to run... |
Lets say I have two lists of same length:
a = ['a1', 'a2', 'a3']b = ['b1', 'b2', 'b3']
and I want to produce the following string:
c = 'a1=b1, a2=b2, a3=b3'
What is the best way to achieve this?
I have following implementations:
import timeit
a = [str(f) for f in range(500)]
b = [str(f) for f in range(500)]
def func1(... |
Hello I am trying to build a tool that will compress a list of folders and rename the compressed file, this list of the names of folders I want to compress are located in a .txt file, the .txt is something like this:
james, 5005kyle, 02939Betty, 40234
I have used multiple methods to try and build this code but I keep g... |
Is there a way by which I can get a list of CIK of all registered stocks at the SEC?
As of now, I know of no good method.
The tedious part about all of this is that there is no company name standard apparent to me, as CIK company name, exchange company name, and legal company name can all be different. I have to get my... |
this is the requirement :
All write APIs expect JSON-encoded content. Many also accept file uploads. Because of this, we expect API requests to have the content type multipart/form-data, and JSON bodies of requests are expected to have the name data.
$ curl -F file=@/Users/alunny/index.html -u username@gmail.com -F 'da... |
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... |
[Python 3.1]
I'm following up on this answer:
class prettyfloat(float):
def __repr__(self):
return "%0.2f" % self
I know I need to keep track of my float literals (i.e., replace 3.0 with prettyfloat(3.0), etc.), and that's fine.
But whenever I do any calculations, prettyfloat objects get converted into float.
Wh... |
abelthorne
Re : [BUNDLE] Humble Indie Bundle (HIB 12 + hebdo merge + promos été)
Il y a eu une mise à jour pour la version Steam de Rocketbirds ; maintenant il fonctionne. J'ai jeté un coup d'œil aux fichiers, ce n'est pas du Flash.
Il y a aussi eu une màj pour Mark of the Ninja mais elle ne corrige apparemment pas le ... |
I'm trying to handle loading invalid YAML data in Ruby, but seem to be unable to rescue exceptions raised by psych.
This is some example code to demonstrate the issue I'm having:
require 'yaml'
begin
YAML.load('&*%^*')
rescue
puts "Rescued"
end
And the exception:
# ruby test.rb
/usr/lib64/ruby/1.9.1/psych.rb:2... |
AnsuzPeorth
[HtmlDesktopTools] Tout pour votre bureau en HTML5/JS/CSS3
Bjr,
N'ayant pas trouvé une taskbar qui me convienne, j'ai codé, pour le fun, une taskbar html. Plutot que de me faire juste ma taskbar, j'ai plutot développé un outils qui permet de faire ses widgets en html pour le bureau, dont ma taskbar.
Ce proj... |
bidou10
mise à jour de sécurité importante
bonjour à tous,
depuis un petit moment, j'ai une mise à jour de sécurité importante qui ne veut pas se faire, elle apparait à chaque fois décochée.
j'ai essayé cette commande dans le terminal, mais je ne suis pas très fort dans ce domaine et j'aimerai avoir un petit coup de ma... |
I'm using the Python bindings for Selenium2 with the Chrome webdriver. I need to access a site that is protected with basic HTTP authentication.
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('http://username:password@example.com')
I would expect this to work, but it seems that Chrome ignores t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.