text
stringlengths
256
65.5k
Someone is trying to sell Lisp to me, as a super powerful language that can do everything ever, and then some. Is there a practical code example of Lisp's power? (Preferably alongside equivalent logic coded in a regular language.) I like macros. Here's code to stuff away attributes for people from LDAP. I just happened...
I've spent the last few hours looking at Django Docs and similar questions on here but I'm still unclear on how to tackle the problem... In essense I want to access the list of email addresses relevent to a certain group, so I can send an email to these customers who are part of this group (named group_one, group_two e...
I need to label N objects with unique tuples (A, B, C), where A < B < C and the maximal number of identical As is M. The same for Bs and Cs each. Among all solutions one with the lowest highest value of C is searched for. (This last sentence means: if one of two solutions has a highest C of 4 and the other of 5, then t...
Brothers In Arms: Road To Hill 30 This walkthrough will explain the advantages and disadvantages of all of the weapons in the game. It is just a condensed explanation, so no history or historical facts will be quoted. THE***************************************************** RIFLE'S*************************************...
McPeter Re : Un 'autre' générateur de sources.list en ligne Je viens de rectifier le soucis sur le nom du fichier bash. Par contre je ne vois aucun soucis à l'exécution :\ pourrais tu me dire quel navigateur tu as utilisé et quel message d'erreur ça te renvoit ? (un copié/collé du message) le chmod +x est inutile là pu...
Ruby has a couple of well-known libraries for unit testing, mocking and stubbing HTTP interactions. My typical toolset includes RSpec, WebMock and VCR. I had the chance to work on a Python project recently and did some investigation into similar libraries for Python. General testing libraries The two most popular pytho...
I'm trying to create a custom function that I can place in a queryset "chain" that will apply a filter to the queryset. Like with normal Django queryset filters, it will take the queryset to the left of it and pass the resulting queryset to the right. Before adding my custom function to the queryset chain: models.MyMod...
too long didn't read- https://bitbucket.org/techtonik/async-console-input - public domain/MIT example for Windows implemented in pure Python (ctypes) What is asynchronous input? Given:The program need to terminate immediately when a subprocess exits or user hits 'q'. It should not eat 100% CPU time. Blocking synchronou...
I have some issue with too many Threads unfinished. I think that queue command .join() just close queue and not the threads using it. In my script I need to check 280k domains and for each domain get list of his MX records and obtain an IPv6 address of servers if it has it. I used threads and thanks for them the script...
When building a public key using the OpenSSL::PKey::RSA module by passing it a .pem file, what is the cause for a response: OpenSSL::PKey::RSAError: Neither PUB key nor PRIV key:: nested asn1 error from /Users/Matt/projects/placepop/lib/apn.rb:48:in `initialize' from /Users/Matt/projects/placepop/lib/apn.rb:48:in `new'...
Introduction web2py[web2py] est un framework web libre et open-source pour le développement agile et sécurisé d'applications web pilotées par base de données; il est écrit en Python[python] et programmable en Python. web2py est un framework complet, contenant donc tous les composants nécessaires pour construire des app...
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...
Here is a class vector in python 3, for n-dimmensional vectors. Please suggest ways to improve the code as well as fix bugs and errors. The only rule is not using: numpy, sympy, scipy and so on. Only math, cmath, Rational, Decimal, ... Python 3 default packages.. This code is only for learning to make classes with pyth...
You should use one table for this, unless you need more stringent constraints. Each area has the same number of rows and the same number of seats per row. Let's say there are 5 rows in every area, and 6 seats in every row. You'd want to use something along these lines. create table seats ( area char(1) not null check...
Ras&#039; 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...
LOG: ==== Jul 5 10:03:22 SWH-iRed-1 amavis[1853]: (01853-01) Passed CLEAN, <websupport@atlantic.net> -> <mailman-subscribe@lists.sensusplenoir.com>, Message-ID: <51d6e01b.TLq2r6xMGZdBrWGe%websupport@atlantic.net>, mail_id: ox3SqxCSbfs5, Hits: 0.011, size: 316845, queued_as: C974940D08, 30507 ms Jul 5 10:03:23 SWH-iRed-...
leYB Re : lexmark x2670 Que dit : ls -l /usr/local/lexmark/lxk08/bin/printdriver -rwxr-xr-x 1 root bin 63851 2008-11-06 09:47 /usr/local/lexmark/lxk08/bin/printdriver Hors ligne leYB Re : lexmark x2670 En changeant le groupe c'est toujours pareil? sudo chgrp root /usr/local/lexmark/lxk08/bin/printdriver Cela donne: ~...
this a second post, part of my previous question. I wrote a function in Python 2.7 (on Window OS 64bit) in order to calculate the mean value of of the intersection area from a reference polygon (Ref) and one or more segmented (Seg) polygon(s) in ESRI shapefile format. The code is quite slow because i have more that 200...
I can't seem to get Python to import a module in a subfolder. I get the error when I try to create an instance of the class from the imported module, but the import itself succeeds. Here is my directory structure: Server -server.py -Models --user.py Here's the contents of server.py: from sys import path from os import ...
I'm writing a log collection / analysis application in Python and I need to write a "rules engine" to match and act on log messages. It needs to feature: Regular expression matching for the message itself Arithmetic comparisons for message severity/priority Boolean operators I envision An example rule would probably be...
g_barthe interface python et apprentissage boa constrictor Bonjour, Je voudrais commencer à developper qq applications (avec interfaces graphiques) en python (pour windows et linux). Je recherche donc un éditeur qui permettrait de realiser l'interface de maniere simple et non en code pur. J'ai bien trouvé "wxglade" mai...
Short version: What's the best hashing algorithm for a multiset implemented as a dictionary of unordered items? I'm trying to hash an immutable multiset (which is a bag or multiset in other languages: like a mathematical set except that it can hold more than one of each element) implemented as a dictionary. I've create...
I want to get all the freebusy events of my Google Calendar between two given dates. I'm following the documentation of the freebusy object. Basically, I have an index.html with a form that allows to choose two dates. I send those dates to my application (Python Google AppEngine backed). This is the code, simplified, t...
I want to measure the execution time of the Python method sayHello() using the method getExecutionTime(). They are both in a module and the getExecutionTime()-method should be callable from outside. The code looks like this: def getExecutionTime(): t = timeit.Timer("sayHello", "from __main__ import sayHello") r...
I have the following ANTLR grammar that forms part of a larger expression parser: grammar ProblemTest; atom : constant | propertyname; constant: (INT+ | BOOL | STRING | DATETIME); propertyname : IDENTIFIER ('/' IDENTIFIER)*; IDENTIFIER : ('a'..'z'|'A'..'Z'|'0'..'9'|'_')+; INT : '0'..'9...
#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 using Python 3.2.I wrote a build log file by using the following code: rsltFile = open('buildLog.txt', 'wb') p = subprocess.Popen('call ant compile', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) for line in p.stdout.readlines(): rsltFile.write(line) retval = p.wait() Then I ...
I have an XML file with several thousand records in it in the form of: <custs> <record cust_ID="B123456@Y1996" l_name="Jungle" f_name="George" m_name="OfThe" city="Fairbanks" zip="00010" current="1" /> <record cust_ID="Q975697@Z2000" l_name="Freely" f_name="I" m_name="P" city="Yellow River" zip="03010" current="1" /> <...
Topic: Jquery update through XML Hi, We are building a web app that needs to be able to update records through jquery in an XML format to our controller. We already have this working, but when updating we always get something like this in our database --- !map:ActiveSupport::HashWithIndifferentAccess div: !map:ActiveS...
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...
It is recommended to not to use import * in Python. Can anyone please share the reason for that, so that I can avoid it doing next time? According to the Python Zen: ... can't argue with that, surely? You don't pass Since Python lacks an "include" statement, The Also, it has a concrete possibility of hiding bugs. impor...
Rules in Flask are unique. If you define the absolute same URL to the same function it will by default clash because you're doing something which we stop you from doing since from our perspective that is wrong. There is one reason why you would want to have more than one URL to the absolute same endpoint and that is ba...
You can use Bulbs (http://bulbflow.com/) with Neo4j Server or Rexster: >>> from bulbs.neo4jserver import Graph >>> g = Graph() >>> g.vertices.create(name="James") >>> g.vertices.create(name="Julie") >>> g.edges.create(james, "knows", julie) Or to use Rexster, just change the import: >>> from bulbs.rexster import Graph...
Anna's second solution is the inspiration for this one. First, load all the words into memory and divide the dictionary into sections based on word length. For each length, make n copies of an array of pointers to the words. Sort each array so that the strings appear in order when rotated by a certain number of letters...
How could I create playlists for all of the albums in iTunes for which I have all of the songs? Assume that track number & track count metadata is accurate where specified, and don't worry about catching tracks which lack that metadata. I assume this will require AppleScript. I realized this was a complicated enough qu...
Module blast_xml source code Bio.SearchIO parser for BLAST+ XML output formats. _empty_bytes_string = '' _ELEM_QRESULT_OPT = {'Statistics_db-len': ('stat_db_len', <typ... _ELEM_HIT = {'Hit_accession': ('accession', <type 'str'>), 'Hi... _ELEM_HSP = {'Hsp_bit-score': ('bitscore', <type 'float'>), 'H... _ELEM_FRAG = {'Hs...
#2601 Le 29/12/2012, à 21:49 bibichouchou Re : TVDownloader: télécharger les médias du net ! Dans le gestionnaire de paquet, as-tu remarqué s'il y avait une coche en face des lignes http://ppa.launchpad.net/chaoswizard/tvdownloader/ubuntu quantal main Si les lignes ne sont pas cochées, c'est que le dépôt n'est pas act...
After switching from optparse to argparse - I'm experiencing strange errors. Argparse parse args only if leave no space: myScript.py -oOpt or put an equal sign: myScript.py -o=Opt and it doesn't work the normal way: myScript.py -o Opt Here's my argparse initialization: #!/usr/bin/env python # to get description use th...
I am trying to grab frames from camera and add them into a single image to get the effect as in this image: http://www.danheller.com/images/California/DeathValley/Nite/tent-star-trails.jpg But my image turns white after a couple of seconds. Here is the code: #!/usr/bin/python import cv stream = cv.CaptureFromCAM(0) cv....
I've been opening quite a few bugs lately for distributions failing these 2 criteria, so, I figured I'd save everyone some effort and unify it cohesively. Reason While it may seem a trivial squabble, ABSTRACT and LICENSE components of your meta-data are reasonably important for communicating what your dist is to the wo...
This is the tutorial I wish I had for integrating Passport.js with Sails.js. When creating web applications, you'd love to have a user sign-in and sign-out function, while limiting access to certain functions if the visitor is merely a guest. Enter Passport.js. This fantastic piece of unobtrusive Express middleware pro...
Legos are perfect. I liked them as a kid, I liked them as a slightly older kid (even while pretending that I was too old for such things), and I like them now (having graduated from ninja temples to recreations of Fallingwater). There's something about playing with them that brings out creativity and imagination: even ...
I'm trying to measure the execution time of a small Python code snippet of mine and I'm wondering what's the best way to do so. Ideally, I would like to run some sort of setup (which takes a loooong time), then run some test code a couple of times, and get the minimum time of these runs. timeit() seemed appropriate, bu...
Let me reformulate. I am inside a ForEach loop what is supposed to add calculated decimal? values to the decimal? originalAmount that is of course null on the first time as you pointed out. So I just need to check null first otherwise do the addition. decimal? convertedAmount = Calculate(inputValue); //always returns a...
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...
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...
Andreas R. Impossible de joindre les serveurs. Bonsoir, Je suis sous Kubuntu 5.10 fraichement installé (mais pas pour la premiere fois ). J'ai donc petit(gros) probleme. Lorsque je lance un apt-get update je reçois ceci. funky@funkycrash:~$ sudo apt-get update Err http://kubuntu.org breezy Release.gpg Connexion à kub...
use the following search parameters to narrow your results: e.g. subreddit:aww site:imgur.com dog subreddit:aww site:imgur.com dog see the search faq for details. advanced search: by author, subreddit... ~27 users here now Welcome to r/DailyProgrammer! First time visitors of Daily Programmer please Read the Wiki to lea...
The role of the network administrator is broad and varied. While most of our time is spent with day-to-day operational tasks such as assigning IP addresses and configuring hosts and applications to use an existing network, we'll occasionally be called upon to do some more interesting things. One of the more interesting...
Some answers claimed a "10x" speed advantage for deque vs list-used-as-FIFO when both have 1000 entries, but that's a bit of an overbid: $ python -mtimeit -s'q=range(1000)' 'q.append(23); q.pop(0)' 1000000 loops, best of 3: 1.24 usec per loop $ python -mtimeit -s'import collections; q=collections.deque(range(1000))' 'q...
toma222 [HOW TO] adesklets : configuration des desklets Il existe désormais un article sur le wiki concernant Adesklets donc je vous conseille de vous y fier, ce tutoriel n'étant plus mis à jour. J'ouvre ce deuxième post au sujet de adesklets, afin de permettre une meilleure lisibilité de l'ensemble.Celui-ci a donc pou...
Sounds simple enough def create_cookie(): bag = string.ascii_uppercase + string.ascii_lowercase + string.digits cookie = Cookie.SimpleCookie() cookie['sessionid'] = ''.join(random.sample(bag,24)) cookie['sessionid']['expires'] = 600 return 'Set-Cookie: ', cookie.output().replace(...
After a few weeks of fruitful and not so fruitful work sessions, I am slowly approaching the benchmark for a 0.1 release of z3c.formjs. So what will be provided in the 0.1 release? Easy to use JavaScript button widget built right into z3c.form Easy JavaScript event handler attachment to form widgets A demo of the above...
Marrrrrrrie Pas de scroll avec le touchpad (ubuntu 12.04) Bonjour, Je viens d'installer ubuntu 12.04 sur un Dell latitude E6330. Il y a un seul problème majeur : le scroll sur le côté droit du touchpad ne fonctionne pas. Le scroll-down marche avec une souris externe. Dans les paramètres systèmes il semble que mon touch...
I m making a 2D board game for python for hw. I asked user to input a integer for the board size. for example, 7. I have modified a bit (only show the important ones) before posting. the function is like follows def asksize(): while True: ask=raw_input("Input board size: ") try: ...
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...
redcat Introduction Since about four years ago Debian has distributed patches to its indexes of packages available for download -- so that rather than having to download the full lists (currently about 30MB uncompressed or 6MB compressed) every time you want to get a package that's only just become available, you can j...
I want to add a field to an existing mapped class, how would I update the sql table automatically. Does sqlalchemy provide a method to update the database with a new column, if a field is added to the class. SQLAlchemy itself doesn't support automatic updates of schema, but there is a third party SQLAlchemy Migrate too...
How to write a setup.py file so that a binary egg distribution (bdist_egg) inludes a sample configuration file and upon installation puts it into the {prefix}/etc directory? A sample project source directory looks somewhat like this: bin/ myappetc/ myapp.cfgmyapp/ __init__.py [...]setup.py The setup.py looks somewhat l...
#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...
Fibonacci We started this series (no pun intended) by providing a simple Python script that gave us the Fibonacci numbers less than 50. As previously mentionned, the code was (save as fibonacci.py): a, b = 0, 1 print a, while b < 50: print b, a, b = b, a + b We would then run it as: $ python fibo.py Fibospeak ...
The subprocessmodule, which was introduced in Python 2.4, provides you with aconvenient interface for spawning subprocesses, and for interactingwith these subprocesses in your parent process. The module wasintroduced in PEP 324, andis a replacement for the proliferation of other functions and modulesthat were used prev...
Gnome desktop application framework based on Webkit, HTML5, CSS3, Javascript and Python "AppKit" will be a framework for gnome desktop application powered by WebKit engine, which means we can bring web technology such as HTML5, CSS3, Javascript and Web browser engine to desktop. Linux, Gnome $ pip install appkit $ pip ...
Judepaum [Résolu] Twinview changement résolution impossible Bonjour et bonne année ! Je viens de faire une installation fraîche de 12.10 et j'ai pas mal de soucis pour retrouver la configuration de TwinView que j'avais sur 12.04 ... Donc, dans les faits, dans nvidia-settings je ne peux choisir que Off ou Auto pour la r...
For my Python 2.7.3 project I have a class called custom_date, which has a property called fixed_date: from datetime import date class custom_date(): def __init__(self, fixed_date): self.fixed_date = fixed_date def __lt__(self, other): return self.fixed_date < other #__gt__, __ge__, __le__, ...
Consider the following Friendship model, where for every friendship made, there is a User who sent the friend request, and a User who received the friend request: from django.contrib.auth.models import User class Friendship(models.Model): sender = models.ForeignKey(User) receiver = models.ForeignKey(User) How ...
JavaScript one_relic — 2011-07-27T20:46:59-04:00 — #1 First and foremost, I want to state that while I have a basic understanding of javascript, I'm still fairly new to it, so any assistance or advice is greatly appreciated. I've recently been going through the process of redesigning my website to include some jquery f...
If you register a tag like this: # mytags.py import datetime from django import template register = template.Library() @register.simple_tag def my_current_time(format_string): return datetime.datetime.now().strftime(format_string) Then use it: # details.html {% load mytags %} {% <check this completion list It doe...
How can I print the following lines of code but get a floating point number of of it instead of a rounded int? print "Math Question: ", 100 - 25 * 3 % 4 print 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6 Division with from __future__ import divison or run Python with the Python3 has this behaviour by default If you use integers,...
What does the TombstonedTaskError mean? It is being raised while trying to add a task to the queue, from a cron-job: Traceback (most recent call last): File "/base/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 501, in __call__ handler.get(*groups) File "/base/data/home/apps/.../tasks.py",...
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...
Cooking with Python, Part 1 Pages: 1, 2 Recipe 5.10: Selecting the nth Smallest Element of a Sequence Credit: Raymond Hettinger, David Eppstein, Shane Holloway, Chris Perkins Problem You need to get from a sequence the nth item in rank order (e.g., the middle item, known as the median). If the sequence was sorted, you ...
Tagged: portfolio tags AuthorPosts May 9, 2013 at 3:23 am #23012 Hi Guys, One small thing, I followed this thread.. [ http://www.kriesi.at/support/topic/view-portfolio-entries-based-on-tags ] to get the tags working on Portfolio entries, the code Nick provided is fine and I’m able to add tags in the backend to portfoli...
I am having an issue on saving my model, my UserProfile reference on a foreign key to a Customer, and I have gotten sure that my form in sending the needed info and the customer object is being loaded, however when I save my model, this lost the reference to customer My code is models.py from django.db import models fr...
malbo [Tuto] identifier si on est dans un système UEFI ou Bios ATTENTION : CETTE MÉTHODE D’IDENTIFICATION EST OBSOLÈTE : IL FAUT UTILISER LA PROCÉDURE DE LA DOC : http://doc.ubuntu-fr.org/efi#identifier … n_mode_efi Le problème se pose pour des PC achetés en 2011 (et +) pour ceux qui souhaitent faire cohabiter Windows ...
[Windows 7 64 bit; Python 2.7] If I try to use Urllib2, I get this error Traceback (most recent call last): File "C:\Users\cYanide\Documents\Python Challenge\1\1.py", line 7, in <module> response = urllib2.urlopen('http://python.org/') File "C:\Python27\lib\urllib2.py", line 126, in urlopen return _opener.o...
Topic: [SOLVED] dashboard statistics pgsql 1.4.1 ==== Required information ==== - iRedMail version: 1.4.1 upgraded from 1.4.0 - Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL - Linux/BSD distribution name and version: debian 7 64bit - Related log if you're reporting an issue: ==== Hi, Happy New Year to ...
Magic 8 Ball is a toy you can use to seek advices when you are bored or need to make some tough decisions but you cannot ask anybody else, even your parents, siblings, friends or your cat. There are a lot of Magic 8 Ball tools out there, both online and offline, but you can create your own Magic 8 Ball script with your...
JavaScript paul_wilkins — 2013-04-26T23:39:48-04:00 — #1 While watching Nicholas Zakas' Maintainable JavaScript talk at the Fluent 2012 conference, there was a very informative section in there about keeping JavaScript separate from the HTML, and other similar concerns of separation. You can see it from the 25:40 secti...
Are unix/linux sha256/sha512 passwords in /etc/shadow key-strengthened? Yes. They use a crypt procedure that does a default of 5000 rounds of hashing. The sha256-crypt/sha512-crypt procedure is described hereand in java Can I change the number of rounds? Yes. Simply edit /etc/pam.d/passwd or /etc/pam.d/common-password ...
Is there a effective quick way to generate a large prime of a given length? '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' 'Humanity is still kept intact. ...
Running python version 2.4.3. I am using python-amazon-product-api. However in api.py the following lines of code is causing problem: if sys.version_info[:2] > (2, 4): # pragma: no cover from urllib2 import quote from hashlib import sha256 # pylint: disable-msg=E0611 else: from urllib import quote from ...
I am trying to copy from one location to other as below and running into following error,can anyone provide inputs as to how to overcome this? import argparse import shutil, errno def copystuff(src, dst): try: shutil.copytree(src, dst) except OSError as exc: # python >2.5 if exc.errno == errno.E...
I'm trying to produce a plot in a loop that updates itself every iteration. Working in a linux environment with python 2.6.6 I have it working, but when I run the same code in windows XP with python 2.7.3 it fails. Minimal code that has produced this error for me is: import matplotlib.pyplot as plt plt.ion() plt.figure...
I would like to use properties from an inheriting model's Meta class to configure a field defined in an abstract model higher up the inheritance tree: class NamedModel(models.Model): class Meta: abstract = True verbose_name = 'object' name = models.CharField("Name", max_length=200, ...
Please don't do that :) Dynamically re-sizing arrays as necessary is unnecessarily confusing. Multi-dimensional arrays are unnecessarily confusing too. So dynamically re-sizing a multi-dimensional array is unnecessarily torturous. When the size of the array is dynamic, don't use an array. Use a Collection, instead, suc...
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...
Each Amazon EC2 instance has associated metadata, as well as user data supplied when launching the instance. The meta and user data is instance-specific, and therefore only accessible to the instance. The data is useful on several levels, such as configuring SSH public keys, programmatically configuring the instance ac...
Like in this question, except I want to be able to have querysets that return a mixed body of objects: >>> Product.objects.all() [<SimpleProduct: ...>, <OtherProduct: ...>, <BlueProduct: ...>, ...] I figured out that I can't just set Product.Meta.abstract to true or otherwise just OR together querysets of differing ob...
Introduction web2py[web2py] est un framework web libre et open-source pour le développement agile et sécurisé d'applications web pilotées par base de données; il est écrit en Python[python] et programmable en Python. web2py est un framework complet, contenant donc tous les composants nécessaires pour construire des app...
In the template below, I am trying to get the name of the court (that is captured through the "establishment" field). I am passing "club_id" through the avail_times function, but how do I pass the "establishment" field passed through the template from this? The model: class Club(models.Model): establishment = model...
mac-gyver31 Re : Client Ubuntu + Active Directory et partage avec Windows serveur 2003 En fait ce post est plutôt tournée vers l'intégration d'un ordi dans un domaine windows 2003 dans le cadre d'un serveur LTSP. Un serveur LTSP ?? Tu veux dire Linux Terminal Server Project ? T'es sûr ? Car je ne vois pas bien le rappo...
The Python language About Python Python is a general-purpose high-level programming language. Its design philosophy emphasizes programmer productivity and code readability. It has a minimalist core syntax with very few basic commands and simple semantics, but it also has a large and comprehensive standard library, incl...
#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...
What you request cannot be done in Python 2.whatever, for a very specific reason. You want to write: class Task(model): title = '' isDone = False In Python 2.anything, whatever model may possibly be, this cannot ever allow you to predict any "ordering" for the two fields, because the semantics of a class stat...
I'm finally settling back into the groove of some of my side projects. I guess I'm handling the new position a bit better as time goes on, and feel that I can spend some free time working on somethings that I want to do, not just things that I feel that I should do. So, these side projects I do for fun, and they are th...
I'm trying to use QGIS to loop through a set of points, find their elevation from a DEM and use that value to update the point layer's attribute table. The loop works fine until I try to use changeAttributeValues(), and I can change the attribute values outside of the loop, but when I try to put the two together I caus...
I managed to store a picture in the Google App engine blob (I can see it in the Blob Viewer from the dashboard, and also in my app using a serving handler).. However, now that i have this picture there..i want to resize it while serving it to the client...Problem is that i can't do that...I can't make an Image out of t...
I have this code in Google AppEngine (Python SDK): from string import maketrans intab = u"ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ".encode('latin1') outtab = u"aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn".encode('latin1') logging.info(len(i...
Great answers here! I'm developing a card game using Python and Pygame, which has no double-click support, so I stumbled upon the same problem. Inspired on Marcel Böttcher's answer, to measure your own time and then double it, I've created a small tool to measure the speed of double-clicks, and I'm sharing with you: i...