text
stringlengths
256
65.5k
In Part 1 of our series I covered setting up your local environment using Vagrant for virtualization and Fabric in combination with several other tools to do the bootstrapping. In Part 2, I’ll cover my Django setup and the development process. Django Settings At the end of part 1 we created a blank project and had a we...
The entries in the array are set as the arguments of an NSTask, using the method setArguments:. At the same time, other aspects of the NSTask, such as the path of the executable to be launched by the NSTask, which is /usr/bin/xgrid, and the current directory, which is the directory containing the executable that xgrid ...
AnsuzPeorth Re : [Gm9diaCenter] Interface graphique pour mediacenter neuf/sfr Re, La suppression des logs se fait au démarrage de l'appli, pas du mediacenter ! (en tout cas chez moi ça marche). Pour le systray, je t'ai ajouté une petit image clicable gnome J'ai ajouté la possibilité de créer/supprimer les lanceurs depu...
ubuntuforce module turtle pour pygame [cherche testeurs] Salut les Ubuntues développement et programmation, Je vous invite mes amis pythons de bien vouloir tester le module que j'ai créer pour pygame: Un module permettant d'utiliser les fonctions d'une tortue dans pygame comme nommé curser (turtle étant déjà pris): -mv...
I have tried to move to Python 2.7 from Python 2.5 but I keep getting the same error everytime. I have made a very simple test in Python 2.5 working with the app.yaml file and just one script main.py and it works fine. The script it just a Hello World type to check everythin works fine. app.yaml application: spareparts...
You could also break up the audio into a chunks and measure the RMS (a measure of loudness). let's say you want an image that is 180 pixels wide. I'll use pydub, a light-weight wrapper I wrote around the std lib wave modeule: from pydub import AudioSegment # first I'll open the audio file sound = AudioSegment.from_mp3(...
I'm using Ubuntu-Server 12.04, but I wasn't sure if this was an Ubuntu specific question, so I'm posting it here. I got myself a graphical user interface by installing xinit and openbox (using apt-get install). I installed guake as well (again using apt-get install). However, when I try to run guake in my terminal emul...
I’ve been taking Coursera’s Stanford Cryptography I class and last week’s homework had an interesting extra credit problem: given eleven ciphertexts all encrypted with the same one-time pad key, find the plaintext of the last ciphertext. It included a hint to XOR the ciphertexts together and to take a note of what happ...
For some reason it seems like web.py isn't capable of remembering my sessions. It works fine with the built-in webserver, but when I use my application with WSGI, sessions aren't remembered. I checked the diskstore session folder and there are files being created. It just seems it doesn't 'remember' the sessions. I hav...
Hi, From 3 days, I am continuously making my efforts to get this thing to do in Python, which I can easily do in PHP. I just want following lines from PHP file (abc.php) to Python (abc.py). <?php $mind = explode(',', $_GET['mind']); $data = ''; if(in_array('good', $mind)) { $data .= file_get_contents('good.txt'); } if...
phiphi076 Re : La mise a jour clamAV et clamtk @awass la commande te permet de lancer le programe en mode graphique avec les droits "root" administrateur (avoir accès au système) . lorsque tu lance clamav "normalement" sans les droits administrateur , tu peut pas faire les mises a jour des liste de virus et programe de...
When running Django behind Nginx as a reverse proxy, the request.META['REMOTE_ADDR'] may store the proxy IP address (eg. 127.0.0.1) rather than the client's IP address. To get the client's IP address in Django, you can set the X-Forwarded-For HTTP header in your nginx proxy configuration: proxy_set_header X-Forwarded-F...
I am trying to define simple getter/setter methods for a mixin class that I intend to use in my database schema: from sqlalchemy import Column, Integer, create_engine from sqlalchemy.orm import synonym, scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base, declared_attr engine = create_e...
I'm trying to write a program that will (among other things) get text or source code from a predetermined website. I'm learning Python to do this, and most sources have told me to use urllib2. Just as a test, I tried this code: import urllib2 response = urllib2.urlopen('http://www.python.org') html = response.read() I...
How do I make a list with only one pointer per cell? (I think that is the problem) Thanks ps if you are feeling nice, how do I take the spaces out of the print function? class Board(object): """board of pieces""" def __init__(self): self.board = [['0']*7]*6 #6x7 grid self.board[3][6] = 8 def...
What's the (best) way to solve a pair of non linear equations using Python. (Numpy, Scipy or Sympy) eg: x+y^2 = 4 e^x+ xy = 3 A code snippet which solves the above pair will be great for numerical solution, you can use fsolve: from scipy.optimize import fsolve import math def equations(p): x, y = p return (x+y*...
simohamed5130 bureau 3d bonjour, j ai iinstallé ubuntu 12.04 et je veux personnliser mon bureau en 3d, puisque je suis debutant , j ai cru que j ai tout fais, j ai suivi les instructions au: http://doc.ubuntu-fr.org/bureaux_3d pour glxinfo | grep "direct rendering" , la reponse etait : direct rending : yes puis , j ai ...
Related Reading An excerpt from Chapter 20 of O'Reilly's book Python Programming on Win32. Another GUI toolkit available for Python is called wxPython. The current incarnation is fairly new to the Python scene and is rapidly gaining popularity amongst Python developers. wxPython is a Python extension module that encaps...
Does urllib2 in Python 2.6.1 support proxy via https? I've found the following at http://www.voidspace.org.uk/python/articles/urllib2.shtml: NOTE Currently urllib2 does not support fetching of https locations through a proxy. This can be a problem. I'm trying automate login in to web site and downloading document, I ha...
Antichoc [Résolu] Installation en ligne Bonjour, je souhaites savoir si sous ubuntu il existe une commande qui permette de télécharger un pakage sur le serveur de ubuntu et qui l'installe automatiquement avec les dépendances ? En bref, je souhaites installer VLC avec ces nombreuses dépendances en puisant directement su...
I have a problem during parsing the following xml from a url. sample XML in my url path: <?xml version="1.0" encoding="utf-8"?> <Documents> <class> <mid name="yyyyyyyyyyyyy"></mid> <person name="yyyyyyyyyy"></person> <url name="yyyyyyyyy"></url> </class> <class> <mid name="x...
I have a function that updates a MySQL table from a CSV file. The MySQL table contains the client account number -- this is what I use to compare with the CSV file. At some point, some of the queries will fail because the account number being compared from the CSV file has not been added yet. How do I get the records f...
import os import sys import time import base64 import hmac import mimetypes import urllib2 from hashlib import sha1 from poster.streaminghttp import register_openers def read_data(file_object): while True: r = file_object.read(1 * 1024) print 'rrr',r if not r: print 'r' ...
Deployment recipes There are multiple ways to deploy web2py in a production environment. The details depend on the configuration and the services provided by the host. In this chapter we consider the following issues: Production deployment (Apache, Lighttpd, Cherokee) Security Scalability Deployment on the Google App E...
#1451 Le 23/06/2013, à 14:42 grim7reaper Re : /* Topic des codeurs [8] */ Quelqu’un sait d’où ça peut venir ? C’est dans le message (3 fois en plus ). Et ça vient pas spécifiquement de mon code. C’est la lib’ qui se connecte (en l’occurrence requests) qui n’aime pas le HTTPS à cause du certificat : SSLError: hostname '...
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...
I am playing in Python a bit again, and I found a neat book with examples. One of the examples is to plot some data. I have a .txt file with two columns and I have the data. I plotted the data just fine, but in the exercise it says: Modify your program further to calculate and plot the running average of the data, defi...
Create a Python script called whatever you want (say mystartup.py) and then set an environment variable PYTHONSTARTUP to the path of this script. Python will then load this script on startup of an interactive session (but not when running scripts). In this script, define a function similar to this: def _(v): if typ...
I'm totally unfamiliar with Python but I there is a piece of code that I need to fix. It's from SublimeXdebug plugin for Sublime Text 2, which is the only plugin out there for PHP debugging with Sublime Text. The plugin is written in Python and, more specifically, in Python 2.6 or older, while the system the plugin run...
How do I Gevent? So, you think you’re going to sneak one past the GIL and turn your single-threaded snorefest (or your multi-threaded headache) into a den of slick greenlets? Not so fast, buster. It may not be worth it. tl;dr Gevent is IO-bound, don’t bother trying it out if you’re doing heavy data processing or anythi...
Unnecessary and/or temporary objects are frequent culprits that can throw all your hard work—and your program’s performance—right out the window. How can you spot them and avoid them? Problem JG Question 1. What is a temporary object? Guru Question 2. You are doing a code review. A programmer has written the following ...
I tried starting up NewRelic with my server, I followed the install instructions however, whenever I run the validate, the website gives me the following response back: Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/newrelic-1.3.0.289/newrelic/api/error_trace.py", line 69, in __call__ ...
Keystoneclient has recently introduced a Session object.The concept was discussed and generally accepted at the Hong Kong Summit that keystoneclient as the root of authentication (and arguably security) should be responsible for transport (HTTP) and authentication across all the clients. The majority of the functionali...
blob: 5fcd24b120ceae255ecfba9adc485b7a3c69724d ( plain ) The wxpy30-update script ======================== The script wxpy30-update is intended to assist updating software which works with wxPython 2.8 to work with wxPython 3.0. If you use the --wx26update option, it will also try to update features from wxPython 2.6, ...
Related Reading This is the second in a series of articles from O'Reilly's Learning Wireless Java, by Qusay Mahmoud. This section from Chapter 5 focuses on the high-level MIDP GUI APIs and components. You can also read the first excerpt in this series. Let's look at how the various classes in the high-level API can be ...
One of the projects that I have been working on recently had a (fairly common) requirement to paginate a list of news items. The original controller and route looked something like this: 1 2 3 4 5 6 7 App.NewsController = Em.ArrayController.extend sortProperties: ['postedAt'] sortAscending: false App.NewsRoute ...
Tony95 Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux Salut à tous je savais pas trop où poster donc je le fais ici. J'ai un petit soucis en GTK, j'aimerais créer une interface permettant de charger et sauvegarder des fichiers mais j'arrive vraiment pas à m'en sortir pour le code. En gros j'ai une fe...
I am trying to use the Kivy library for python in the Eclipse IDE. I have tried some solutions that I have found on google but none of them seem to work. I am using Mac OSX 10.7 with python 2.7. I have installed the kivy setup.py file with the command python setup.py install I now how a kivy folder in /Library/Framewor...
/projects/mymath$ ls __init__.py __init__.pyc mymath.py mymath.pyc tests and under the directory tests I have /projects/mymath/tests/features$ ls steps.py steps.pyc zero.feature I tried to import my factorial function sys.path.insert(0,"../../") #import mymath from mymath.MyMath import factorial But it said No...
Topic: [FAQ] How to enable signing disclaimer on outgoing mails? Note Signing disclaimer on outgoing mails is available in iRedMail/iRedOS-0.5.0 and later, users upgrade from 0.4.0 or even older versions can add this feature manually with steps explained in our Upgrade Tutorial (0.4.0 -> 0.5.0). iRedMail uses Amavisd-n...
How many undirected graphs with $N+M$ labeled nodes exist where there's only one cycle and it's length is $N$ in such a way that every element of the cycle has at most one tree growing out of it? Choosing the cycle elements and arranging them can be done in $\left(N-1\right)! {N+M \choose N}$ unique ways. The rest of t...
blob: 22f56c9c980535739a8fa6e6e1a1b9d2e7263474 ( plain ) # Contributor: David Arroyo <david.a.arroyo@gmail.com # Contributor: William Giokas <1007380@gmail.com> # Maintainer: David Arroyo pkgname=proggyfonts pkgver=0.1 pkgrel=9 arch=('any') pkgdesc="A set of fixed-width fonts designed for code listings." url="http://...
I'm trying to pass some variables from the child page to the template. This is my python code: if self.request.url.find("&try") == 1: isTrying = False else: isTrying = True page_values = { "trying": isTrying } page = jinja_environment.get_template("p/index.html") self.respons...
gtk.Paned — a base class for widgets with two adjustable panes class gtk.Paned(gtk.Container): def add1(child) def add2(child) def pack1(child, resize=False, shrink=True) def pack2(child, resize=True, shrink=True) def get_position() def set_position(position) def compute_position(allocation,...
I am doing a project for school where I have to get all of my friend data, and the friend data of some of my friends, from facebook in order to make a graph of it. To do this I am planning on using facepy, but in order to do that I need an access token. My question is how do I obtain this access token? You will need to...
Gaara barre de progression sur notification en root [finalisé] Bonjour, J'essaie de me faire un petit script qui me prévient avec une notification quand mes mises à jours sont effectuées, en utilisant unattended-upgrades. J'ai réussi à le faire fonctionner avec yad, mais c'est pas très joli. Je voudrais donc utiliser n...
I'm trying to build my own template tags. I have no idea why I getting these errors. I'm following the Django doc's. This is my app's file structure: pollquiz/ __init__.py show_pollquiz.html showpollquiz.py This is showpollquiz.py: from django import template from pollquiz.models import PollQuiz, Choice register = temp...
>>> integrate(f, 0, (3.141592653589793/4),4) 0.12645766198987884 Sweet Jesus, its still good enough 'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.' 'God exists because Mathematics is consistent, and the devil exists because we cannot prove it' 'Humani...
D-Bus Interface: Connecting to a Server NB: This scheme will very likely be changed, details about this are in this mailing list message: [https://tango.0pointer.de/pipermail/pulseaudio-discuss/2009-July/004437.html]. At the time of writing, there are no responses so it's not certain yet what the final server discovery...
Answers I. a learning problem and reference-request. Please, see very good examples here. The code can also become useful here. Good tutorial video here. Main docs here. II. I am using DVO -layout where many keys such as " and ' are broken -- and many hotkeys are broken (things are apparently hard-coded to QWE -lay...
Components and plugins Components and plugins are relatively new features of web2py, and there is some disagreement between developers about what they are and what they should be. Most of the confusion stems from the different uses of these terms in other software projects and from the fact that developers are still wo...
PenguinCoder less info bio website penguincoder.com location United States age visits member for 2 years, 7 months seen Feb 19 at 22:21 stats profile views 3 You want to know a bit about me?? Run the following code; or not. from random import shuffle alphabet="abcdefghijklmnopqrstuvwxyz+!@#$%^&*" key="&frs^!yo+j*xduieq...
gmli Cerise 0.8 - TPE, freelances, artisans Hello, je me suis dit qu'une petit présentation pourrait intéresser du monde ici. Je viens de sortir aujourd'hui la version 0.8 de mon petit soft de gestion d'entreprise (cf. l'article sur le blog http://leblog.cfait.fr/post/2008/09/07/Cerise-08) Vous pouvez trouver une liste...
I'm using Pandas (0.9.1) to write a physics code. I have two dataframes: Levels: class 'pandas.core.frame.DataFrame'> Int64Index: 37331 entries, 0 to 37330 Data columns: atomic_number 37331 non-null values ion_number 37331 non-null values level_number 37331 non-null values energy 37331 non-nu...
Just today I have decided that I wanted to learn python because I personally like the syntax and its feel. I am a pretty young developer and I really wanted to learn a new programming language since I am only fluent in JavaScript (especially javascript) and PHP so I decided on Python. Python seems quite like javascript...
First: your four colour palette (black, green, red, yellow) has no blue component. So, you have to accept that your output image will hardly approximate the input image, unless there is no blue component to start with. Try this code: import Image def estimate_color(c, bit, c_error): c_new= c - c_error if c_new...
// This is my code in main: string word, processed_word, scrambled_word; string first_letter, last_letter, final_word; string line; ifstream in_file("input.txt"); ofstream out_file("output.txt"); getline(in_file, line); istringstream iss(line); if (iss >> word) { first_letter = word[0]; last_letter = word[wo...
A Javascript tool for adding referral information to correspondent links. Supports any affiliate that just needs a parameter added to the link (Eg. http://somesite.com/product-1234/?ref={YOUR-REFERRAL-ID}). It also supports affiliate links through Commission Junction, it detects supported sites and replaces the link 'h...
O'Reilly Book Excerpts: Python Cookbook, Second Edition Cooking with Python, Part 1 Editor's note: The second edition to Python Cookbook has been updated for Python 2.4 to include more than 200 recipes with solutions to problems that Python programmers face every day. We've selected two new recipes from the book to sho...
One of Django’s many great features is its powerful template inheritance. A decade ago we would use simple concepts like include files for platforms such as ASP and PHP, allowing us to create reusable template snippets that could be embedded in multiple pages. Later, ASP.NET and Ruby on Rails would improve on this with...
bariton impossible de faire des mise ajour logiteque inutilisable "[ Résolu ]" les mises a jour automatiques ne ce font plus la logitheque me dis que que des paquets sont cassés et elle ne peux les réparer j'ai essayer de suivre le message d'erreur de la mise a jour auto et voici ce qu'i se passe : sam@sam-MS-7720:~$ s...
JavaScript riddlevn — 2012-05-18T03:53:31-04:00 — #1 How to get image attribute (height, width, alt, title) when knowning image src. paul_wilkins — 2012-05-18T05:34:49-04:00 — #2 Create an img object and give us your image src, then once it has loaded get the image attributes that you need from it. If you need to work ...
Hi, Just installed Xfce-4.6.1 on a new Gentoo system. Sat down and installed my preferred theme, wallpaper and made some customisations to get Xfce4 to how I like it and everything was fine. I then did some tweaking of the /etc/X11/xorg.conf (mainly trying out the nvidia-xconfig to re-tweak it then adding things back i...
In NumPy, foo = np.array([[i+10*j for i in range(10)] for j in range(3)]) array([[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [10, 11, 12, 13, 14, 15, 16, 17, 18, 19], [20, 21, 22, 23, 24, 25, 26, 27, 28, 29]]) filter = np.nonzero(foo > 100)#nothing matches foo[:,filter] array([], sha...
There's no native way to do this in Sublime Text 2. What you want is to be able to switch to the left window group (group 0), open a file, and then (possibly, its not clear from your question) switch back to the right window group (group1). This can be accomplished with a series of Sublime Text Commands. Specifically m...
Is there a way in sqlalchemy to turn off declarative's polymorphic join loading, in a single query? Most of the time it's nice, but I have: class A(Base) : discriminator = Column('type', mysql.INTEGER(1), index=True, nullable=False) __mapper_args__ = { 'polymorphic_on' : discriminator } id = Column(Integer, p...
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...
Does anybody happen to know why when you iterate over a file this way: Input: f = open('test.txt', 'r') for line in f: print "f.tell(): ",f.tell() Output: f.tell(): 8192 f.tell(): 8192 f.tell(): 8192 f.tell(): 8192 I consistently get the wrong file index from tell(), however, if I use readline I get the appropria...
A Less-Random Generator In game development, it’s very common to want a random number. Maybe you want to determine damage done, if there was a critical, or what slot on the board to insert your piece at. And surprisingly (or perhaps, not), programmers are often looking to make this random number a little less… random. ...
I'm currently trying to dig deep into python and I have found a challenge on (hackthissite.org) that I'm trying to crack. I have to unscramble 10 words that are found in the provided wordlist. def permutation(s): if s == "": return [s] else: ans = [] for an in permutation(s[1:]): ...
rezzakilla Re : [Info] Installation du driver Libre ATI Radeon Je dis ça comme ça...mais ça marche terrible sur ma 7500.....:D Hors ligne hugo69 Re : [Info] Installation du driver Libre ATI Radeon ton tuto est dans la doc officielle mais ca naide pas beaucoup ma 9700ATI Hercules à fonctionner correctement. Si je mets l...
I have an App Engine project structure setup as follows: ProjectRoot app.yaml index.yaml main.py static [directory] index.html app [directory] script1.py script2.py My app.yaml looks like this application: appname version: 1 runtime: python27 api_version: 1 threadsafe: no handlers: - url: /(.*\.html) mime_type: text/...
I'm trying to get channel's user list using {{self.say(channel, "WHO",100)}}. How can I get the response? Which method I should override? Here are some additional methods which should help you get further along. You handle a given reply def who(self, channel): "List the users in 'channel', usage: client.who('#t...
This program has been disqualified. Author &&& Submission date 2011-06-20 19:49:00.547727 Rating 5659 Matches played 5 Win rate 60.0 import random #Weighted random beat previous inputs KEY=0.850 def weighted_choice(C, p): x = random.random() for elmt in range(len(C)): if x <= p[elmt]: return...
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...
Advanced Hard Drive Caching Techniques RapidDisk and RapidCache Currently at version 2.9, RapidDisk is an advanced Linux RAM disk whose features include the capabilities to allocate RAM dynamically as a block device, use it as standalone disk drives, or even map it as caching nodes to slower local disk drives via Rapid...
It sure would be nice if there was a code fairy flying over your shoulder that could sound a dulcet chime every time suspect code was introduced. Even better would be a swarm of fae to keep the entire project free of dubious practice. No such creatures seem to exist, but I will make the somewhat farcical claim that com...
So I got numpy, scipy, IPython, and matplotlib working (I can import all four with "import _)". However, I cannot get pylab to work. I've was under the impression that if I had the above I'd be able to import pylab. I wish I could understand these errors; they look like babel to me. Can anyone tell me what's wrong? Any...
Scipy does not provide such a high order integrator for tabulated data by default. The closest you have available without coding it yourself is scipy.integrate.simps, which uses a 3 point Newton-Cotes method. If you simply want to get comparable integration precision, you could split your x and f arrays into 5 point ch...
KoZzY [RESOLU] Python - Pickle introuvable Bonjour à tous, J'ai une question toute bête, connaîtriez vous une alternative au module "Pickle" car j'ai beau importer ce dernier, Python semble ne pas vouloir me laisser l'utiliser: Voici un essai: import pickle with open ("texte","wb") as f: lol = "caca boudin" pi...
vince06fr Re : Nettoyage dans les noyaux (kernel) Umuntu : Si tu veux prendre le temps de traduire ce script, surtout ne te gêne pas comme tout est "hardcodé" dans le script, la seule chose à faire est... De modifier l'ensemble des textes en français présents dans le script pour les mettre en anglais. Une fois le scrip...
I am using Numpy and OpenCV2.4.1, my IP Camera has an SDK that returns the picture buffer through a callback function. The simplified function is as follows: def py_fDecodeCallBack(lPort, pBuffer, lSize, pFrameInfo, lReserved1, lReserved2): frameInfo = pFrameInfo.contents pBufY = np.asarray( pBuffer[:frameInfo....
HKH Re : Cerise 0.8 - TPE, freelances, artisans effectivement ca ne fonctionne pas avec ces identifiants...! J ai crée une entreprise nom : Ubuntu login ubuntu pass ubuntu Bon test Hors ligne j1100 Re : Cerise 0.8 - TPE, freelances, artisans Hop je m'abonne. Ça va fortement m'intéresser dans 2-3 ans quand je serai patr...
coords of 3d cube as a single matrix? I know this is basic.. but jitter has remained a frustration for me since day one – and my shitty math skills don’t help the matter. :/ I need to enumerate the coordinates for a cube of a given dimension and store them as a single matrix which can then be rendered as a set of point...
devphp [résolu] Fail2ban et scanlogd, difficulté au redémarrage Bonjour, Je configure fail2ban, de façon a pouvoir bannir les personnes qui scan les ports (une de trop) J'ai donc installer scanlogd et j'ai pris mon autre serveur et lance un scan cat /var/log/syslog | grep scanlogd Jan 26 22:35:38 stock scanlogd: 88.191...
pyPEG – a PEG Parser-Interpreter in Python Requires Python 3.x or 2.7 Older versions: pyPEG 1.x But sometimes you may want to have your own parser. This is what'spyPEG for. And pyPEG supports Unicode. pyPEG is a plain and simple intrinsic parser interpreter framework forPython version 2.7 and 3.x. It is based on Parsin...
Kanor Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... D'aprés ce que je comprend Salome utilise code_aster Sinon pdf qui me semble intéressant http://calcul.math.cnrs.fr/Documents/Journees/dec2006/aster.pdf ça date un peu 2006 Hors ligne ossatureLibre Re : Idée projet Logiciel RDM Eurocodes Str...
I'm using the Facebook SDK on Android to post an update to the user's feed. I was able to get it to work when I did not have the Facebook client installed. Now, even after removing the Facebook app, when I try to authorize or open the feed dialog the activity is abrupty killed. I don't get any message telling me that t...
Vicks openoffice et accents circonflexes... Bonjour à tous, J'ai un gros problème avec les acents circonflexes que je ne peux pas utiliser lorsque je suis sous openoffice. Cependant, sur le reste de ma config il n'y a aucun problème... Merci beaucoup de votre aide... @+ Vicks Hors ligne Vicks Re : openoffice et accents...
Integración numérica En análisis numérico, la integración numérica constituye una amplia gama de algoritmos para calcular el valor numérico de una integral definida y, por extensión, el término se usa a veces para describir algoritmos numéricos para resolver ecuaciones diferenciales. El término cuadratura numérica (a m...
Implementing the ID3 Heuristic The ID3 heuristic uses the concept of entropy to formulate the gain in information received by choosing a particular attribute to be the next node in the decision tree. Here's the entropy function: def entropy(data, target_attr): """ Calculates the entropy of the given data set fo...
It seems they canceled in Python 3.0 all the easy way to quickly load a script file - both execfile() and reload(). Is there an obvious alternative I'm missing? You could write your own function: def xfile(afile, globalz=None, localz=None): with open(afile, "r") as fh: exec(fh.read(), globalz, localz) If y...
Posts for Planet Python. Custom function decorators with TurboGears 2 I am exposing some library functions using a TurboGears2 controller (see web-api-with-turbogears2). It turns out that some functions return a dict, some a list, some a string, and TurboGears 2 only allows JSON serialisation for dicts. A simple work-a...
I've been playing with using the subprocess module to run python scripts as sub-processes and have come accross a problem with reading output line by line. The documentation I have read indicates that you should be able to use subprocess and call readline() on stdout, and this does indeed work if the script I am callin...
I'm trying to put Poisson continuous error bars on a histogram I'm making with matplotlib, but I can't seem to find a numpy function that will given me a 95% confidence interval assuming poissonian data. Ideally the solution doesn't depend on scipy, but anything will work. Does such a function exist? I've found a lot a...
A string is already 'decoded', thus the str class has no 'decode' function.Thus: AttributeError: type object 'str' has no attribute 'decode' If you want to decode a byte array and turn it into a string call: the_thing.decode(encoding) If you want to encode a string (turn it into a byte array) call: the_string.encode(e...
I want to create a dictionary whose values are lists. For example: {1: ['1'], 2: ['1', '2'], 3: ['2']} If I do: d = dict() a = ['1', '2'] for i in a: for j in range(int(i), int(i) + 2): d[j].append(i) I get a KeyError, because d[...] isn't a list. In this case, I can add the following code after the assi...
#1001 Le 25/04/2010, à 17:05 oGu Re : [ VOS SCRIPTS UTILES ] (et eventuelles demandes de scripts...) Bonjour à tous ! Tout d'abord félicitations pour l'excellente tenue de ce forum et pour tous les scripts que j'ai piqué sur ce topic!! Etant passé de Firefox à IceCat dernièrement, j'aimerais qu'un Ubuntero sachant scri...
CyrilouGarou Création de miniatures pour dossiers d'artistes dans librairie amarok Bonjour à tous, Nous sommes nombreux à utiliser l'excellent amarok pour écouter notre zic. Amarok permet de ranger sa collection de la façon suivante (exemple de chemin pour la chanson hells bells d'ACDC) /home/cyril/Ma\ Musique/A/AC_DC/...
I'm trying to display a datetime column from MSSQL. However when I was displaying the date from the database, it appears as this. There is a .0 at the back of the time. Is there anyway to remove the .0? By the way, I'm using grails. This is my codes, hope you guys can help out over here. :) def result = sql.rows("selec...