text
stringlengths
256
65.5k
I'm trying to make an appraisal system This is my class class Goal(db.Expando): GID = db.IntegerProperty(required=True) description = db.TextProperty(required=True) time = db.FloatProperty(required=True) weight = db.IntegerProperty(required=True) Emp = db.UserProperty(auto_current_user=True) Status = db.Boo...
pilepoil Asus X59SL problème accès internet (seulement Google, BNP) Salut, J'ai depuis peu de temps le Asus X59SL. J'ai mis un double boot Ubuntu et Vista. Sous Vista, pas de soucis d'accès à internet. Sous Ubuntu 8.10 64 bits, j'ai accès uniquement à Google et à BNP (et peut être d'autres, mais pas nombreux). J'ai fai...
Oni Re : [How-to] Desktop Screenlets Salut. Je viens de réinstaller screenlets. Lorsque je lance une musique avec Listen (mon lecteur par défaut), le module "Now Playing" me renvoie une erreur comme vous pouvez le voir sur la capture ci-dessous. J'ai installé le paquet "python-dcop" au cas où... mais même problème. Si ...
tiramiseb Re : configuration des DNS S'il-te-plait, pour des citations utilise la balise "[ quote ]" et non la balise "[ code ]", c'est pénible de devoir défiler horizontalement pour lire les phrases que tu cites... Hors ligne kr2sis Re : configuration des DNS ça y est je sui perdu...:o est ce qu'on peut faire doucemen...
I have a multidimensional array a with shape (nt, nz, ny, nx). The dimensions are time, z, y, x. For each time, x and y, I've selected the appropriate z in a new index array J with shape (nt, ny, nx). J contains the indices along the height dimension that I'd like to select. Using Python, I could do this in a loop: b=J...
I am trying to UPDATE a MySQL table using Python's MySQLdb module. Although the query seems fairly simple it just won't update the information. Here is my code: for username,info in users.iteritems(): if info[0] > 0 and info[1] > 0: month = 8 year = 2010 cursor.execute(""" UPDATE users_disk ...
Related Reading As mentioned in Chapter 4, Integrated Development Environments for Python, PythonWin is a framework that exposes much of the Microsoft Foundation Classes (MFC) to Python. MFC is a C++ framework that provides an object-based model of the Windows GUI API, as well as a number of services useful to applicat...
import cgi import webapp2 from google.appengine.api import users class MainPage(webapp2.RequestHandler): def get(self): self.response.out.write(""" <html> <body> <form action="/sign" method="post"> <div><textarea name="content" rows="3" cols="60"></textare...
Cleaning Data with Google Refine 27 Oct 2012 Using Google Refine to clean messy data Refine is a powerful tool for working with messy data. If you’re not familiar with a scripting language (or even if you are), it’s is great for formatting and cleaning data without suffering through nested LEFT() and RIGHT() functions ...
n3o51 Liste des onglets Bonsoir y a t'il un moyen de copier directement dans un fichier txt la liste des onglets ouverts dans opera et firefox ? ligne par ligne ? Merci d'avance Edit modérateur : si vous n'avez pas de réponses à donner, ne sortez pas le sujet des "Sujets sans réponses". Dernière modification par xabilo...
Is there a list somewhere of recommendations of different Python-based REST frameworks for use on the serverside to write your own RESTful APIs? Preferably with pros and cons. Please feel free to add recommendations here. :) Something to be careful about when designing a RESTful API is the conflation of GET and POST, a...
General idea Load both images as arrays (scipy.misc.imread) and calculate an element-wise difference. Calculate the norm of the difference. However, there are some decisions to make. Questions You should answer these questions first: Are images of the same shape and dimension? If not, you may need to resize or crop the...
The way I usually declare a class variable to be used in instances in Python is the following: class MyClass(object): def __init__(self): self.a_member = 0 my_object = MyClass() my_object.a_member # evaluates to 0 But the following also works. Is it bad practice? If so, why? class MyClass(object): a_member ...
I have imported a table with pandas read_frame. My DataFrame has special characters like é , à and so on. When i want to display it i have strange characters. I wold like to know what can i do to encode my html output : import pandas import pandas.io.sql from IPython.display import HTML df = pandas.io.sql.read_frame(...
I am trying to compile codec_g729x but having issue with its compilation here is the link for that codec https://bitbucket.org/arkadi/asterisk-g72x and I am getting below error after make all command [root@localhost@asterisk-g72x]# make all make all-am make[1]: Entering directory `/usr/src/asterisk-g72x' /bin/sh ./lib...
Hi i'm not very good at English but i'll try to explain myself the best i could. I'm using python and Django to create a web project. I have this 4 models (this is the best translation i can do of the tables and fields): class Humans (models.Model): name = models.CharField(max_length=15) surname = models.CharF...
It seems like a typical issue in programming, but i didn't find nothing usefull in google.This is the code: file=open('list.txt','r') for line in file: cursor.execute("CREATE TABLE IF NOT EXISTS \ %s(id INT(2) NOT NULL PRIMARY KEY AUTO_INCREMENT, \ entry TEXT NOT NULL)" % line) file.clos...
georgesgiralt [Résolu] [12.04 LTS] nouveaux thèmes Gnomes impossibles à utiliser Bonjour, Suite à gros coup de calcaire du PC de madame, je viens de lui installer la 12.04 au lieu de la 10.04LTS qu'elle avait. Pour ne pas trop perturber, je lui ai laissé Gnome. Mais les fenêtres ont leur 3 boutons de contrôles à gauche...
New Coder here I'm hoping to be able to clean this code up a bit. I want to be able to move the smtplib stuff out of the class but I still need it to send an email with the pinotify data If you look at my code you'll see. It is very redundant. if notify data > send email with file created data if notify data > send ema...
So far, I would do int(float('3.5')) Any other good way to do? Note: 3.5 is a string. I want to use the the built-in API that specify for this sort of problem. So far, I would do Any other good way to do? Note: 3.5 is a string. I want to use the the built-in API that specify for this sort of problem. You're on the righ...
This is my attempt def matcher(ex): if re.match(r'^[\w|\d][A-Za-z0-9_-]+$', ex): print 'yes' My goal is to match only submission that satisfy all the followings begins with only a letter or a numeric digit, and only letter, space, dash, underscore and numeric digit are allowed all ending spaces are strippe...
I'm working on adding pagination functionality to my models. I could do this with a method in a mixin, I think I understand what pagination is in this context, but I'm looking to add queries so I can pass in pagination wherever I want without hard coding a model method and without a mixin e.g.: Mymodel.query.filter(Mym...
Was recently introduced to the queue design in regards to ability to defer processing as well as implementing a "FIFO" etc. Looked through the documentation in attempt to get a sample queue going to understand how to implement it in my own design / program. But I'm having issues with just running this code: import queu...
I have a matplotlib code for creating a set of three subplots which share the same axes. My problem is that I am trying to plot an ellipse on each of these subplots, but the ellipse only shows up on one of the subplots. Can anyone tell me what I'm doing wrong? Sorry if this kind of thing has already been answered elsew...
Ok that's perl: #while (<>) {if(!/^\S+: |^[% \n]|^\*./) {print;}} I think it does run faster than python: hendry@scrooge-15:/tmp/acronym$ time perl vera.pl < vera.1 > /dev/null real 0m0.023s user 0m0.019s sys 0m0.002s hendry@scrooge-15:/tmp/acronym$ time perl vera.pl < vera.1 > /dev/null real 0m0.022s use...
I recently downloaded Kivy as it's given me the most comprehensible tutorials and documentation, etc. I've tried pygame and cocos but never could get a foundation, and with Kivy it's been easy. So heres my problem, I've made a pong game, and I'm trying to make the game pause by stopping the pong ball, and then starting...
If you want to use a parser (lepl in this case), but still want the intermediate results rather than a final parsed list, then I think this is the kind of thing you were looking for: >>> nested = Delayed() >>> nested += "{" + (nested[1:,...]|Any()) + "}" >>> split = (Drop("{") & (nested[:,...]|Any()) & Drop("}"))[:].pa...
What is it about the structure of counting sort that only makes it work on integers? Surely strings can be counted? ''' allocate an array Count[0..k] ; initialize each array cell to zero ; THEN ''' for each input item x: Count[key(x)] = Count[key(x)] + 1 total = 0 for i = 0, 1, ... k: c = Count[i] Count[i] ...
I want to create my own deb repository to store some packages. I've tried reprepro and it works fine, except for one fundamental feature. Reprepro can't store several versions of the same package in the repository. The ability to store several versions of the same package is essential to me, so I'm asking what software...
gaspard_1er [résolu] installation de vmware-player impossible Bonjour Je suis sous Kubuntu Gutsy et j'essaie d'installer le paquet vmware-player mais voilà : - Quand j'essaie avec adept je trouve le bon paquet, je clique sur le bouton Demander l'installation et là absolument rien ne se passe. La colonne Demandé devrait...
Using my rudimentary knowledge of Python, I was interested in exploring the use of rpy2 to eventually be able to bring together spatial data analysis done in Python, with some higher level tools in R – in this case the powerful graphics library ggplot2 to visualize the results. My setup is Mac OS 10.7.3, Python 2.7, R ...
I'm writing an asyncore server which fetches info from another module in same process and writes it back to client. The info basically is a dictionary where for each key we have a queue of messages. I'm required to dump the length of each queue. The code runs fine on a test machine but as soon as I install it on a prod...
Finally, I traced out why time-to-time my functional tests stop passing. * Some steps are associated with Python functions. * Signatures of such steps depend on the code of the functions. * If the code of a function is changed, the signature is changes, and the step is considered out-of-date. Therefore, small changes i...
I have a tree which I populate with a file list from my computer on the click of a button. While the program is populating the tree the whole GUI hangs. Is there a way to populate the tree in another thread so the tree gets populated as the files are found and not when everything has already been added? Or any other id...
Python deronsizemore — 2013-09-16T23:00:47-04:00 — #1 Hi, Sorry if this is the wrong place to post this as I don't see a Django specific area. I'm new to Python and Django. Spent a few weeks getting to know Python; went through "Python in a Day" and about half of "Python the Hard Way" before I dove into Django. I'm und...
I'm trying to initiate a dynamic backend using a cron task, however after I deploy I don't see the new cron task under the cron tab and also I don't see any instances of backends under my backend tab. What am I doing wrong? EDIT: Now the cron job runs properly (after I changed the schedule to "every 1 minutes". However...
I am trying to migrate over to Python from Matlab and can't figure out how to get interactive(?) plotting working within the Spyder IDE. My test code is shown below. With the .ion() nothing happens, I get a quick flash of a figure being drawn then the window instantly closes and spits out my Hello. Without the .ion() t...
20:10 13 December 2010 tl;dr: Don’t use Django to manage queries that have very large result sets. If you must, be sure you understand how to keep memory usage manageable. One of the great things about modern interpreted, garbage-collected languages is that most of the memory management happens behind the scenes for yo...
I have created a GUI calculator (a screen shot included) and when a button is pressed it adds text to the textctrl so that the equation is displayed to the user. when the user presses enter it takes that text and runs it usesing eval then prints using SetValue but if i run a problem in the texctrl like 5/6 it comes out...
I'd like to use placeholders as seen in this example: cursor.execute (""" UPDATE animal SET name = %s WHERE name = %s """, ("snake", "turtle")) Except I'd like to have the query be its own variable as I need to insert a query into multiple databases, as in: query = """UPDATE animal SET name = %s WHERE name =...
kryss Re : [HOW TO] adesklets : installation sous Ubuntu Dapper et Edgy ah la galere... etu tu crois que tu peux savoir pourquoi les desklets de gdesklet marchent pas? c est quoi un capteur rss grab? Hors ligne toma222 Re : [HOW TO] adesklets : installation sous Ubuntu Dapper et Edgy Non désolé, j'ai laissé tomber gdes...
I'm trying to get scons configured as conveniently as possible. My build script works fine, but I'm still having trouble with one thing. With make, if I run just 'make' twice in a row, the second time will do nothing because it will detect that the target is up to date (because I just built it). How can I make sure tha...
I have a library with a bunch of different objects that have similar expected behavior, thus I want to run similar tests on them, but not necessarily identical tests on them. To be specific lets say I have some sorting functions, and a test for checking if a sorting function actually sorts. Some sorting functions are i...
Are there any general heuristics, tips, tricks, or common design paradigms that can be employed to convert a recursive algorithm to an iterative one? I know it can be done, I'm wondering if there are practices worth keeping in mind when doing so. You can often entirely preserve the original structure of a recursive alg...
If this is my subprocess: import time, sys for i in range(200): sys.stdout.write( 'reading %i\n'%i ) time.sleep(.02) And this is the script controlling and modifying the output of the subprocess: import subprocess, time, sys print 'starting' proc = subprocess.Popen( 'c:/test_apps/testcr.py', shell=True...
#1626 Le 13/05/2012, à 15:13 Hizoka Re : [glade2script-GTK2] Interface graphique pour script bash ou autre. echo "TERM@@SEND@@$cmd\n" sleep 3 # permet de laisser le temps au process d'etre créer pid=$(pidof cdrdao) while kill -0 $pid >/dev/null; do sleep 0.2 ## barre de progression ####### ...
I have been trying to set up pyramid under mod_wsgi in windows. My app is a simple scaffold created with the command ..\Scripts\pcreate -s starter it My httpd.conf file has the following directives LoadModule wsgi_module modules/mod_wsgi-win32-ap22py27-3.3.so WSGIScriptAlias /x "C:/Documents and Settings/Administrator....
I am using geomap-linechart api in my application.. I want to view the map and the chart on a drop down selected index changed event.. It doesn't work if i put it inside update panel.. it becomes blank.. but it woks fine if i put the control outside the update panel.. Is there any reason or suggestion for this prob?? i...
I often find myself using this construct: dict1['key1'] = dict2['key1']dict1['key2'] = dict2['key2']dict1['key3'] = dict2['key3'] Kind of updating dict1 with a subset of dict2. I think there is no a built method for doing the same thing in form dict1.update_partial(dict2, ('key1', 'key2', 'key3')) What approach you us...
I didn't actually play around with it but I did look through your source code and noticed a few things: 1) Your function devnames: def devnames(): string = "" for name in developers: string += str(name) + ", " return string[0:(-2)] Isn't necessary because you can just use the string.join function: ...
malbo Re : [Tuto] Installation prudente de Ubuntu dans un PC UEFI Ou alors je n'ai pas trouvé comment faire... Il fallait aller dans le Bios au démarrage et sélectionner le démarrage sur le support d'installation de Ubuntu "sans" UEFI. Comme tu n'y connaissais rien en UEFI, tu as laissé démarrer le PC sur le support sa...
I am getting a blank page in "localhost:8080". Followed the process mentioned in developers.google.com/appengine for python Everything is working fine but the webpage is not displaying "hello world" as mentioned in the helloworld.py file. import webapp2 class MainHandler(webapp2.RequestHandler): def get(self): self...
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...
I want to create an object that contains 2 links to Users. For example: class GameClaim(models.Model): target = models.ForeignKey(User) claimer = models.ForeignKey(User) isAccepted = models.BooleanField() but I am getting the following errors when running the server: Accessor for field 'target' clashes wit...
I have the following network configuration: # ifconfig -a eth0 Link encap:Ethernet HWaddr 00:e0:1c:73:02:09 inet addr:10.1.4.41 Bcast:10.1.255.255 Mask:255.255.0.0 inet6 addr: fe80::2e0:4cff:fe75:309/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX pack...
I'd like to create a custom scope that searches and returns results from an online source for personal use. Is this possible? And if so, how? Yes it is absolutely possible and really easy to create new scopes. The Ubuntu App Developer site has lots of content to get you started writing scopes: For development in python...
Leenuks Impossible de faire apt-get update Bonjour à tous,:) Je suis debutant sous linux, je m'adresse donc à vous pour m'aider. En effet je souhaite utiliser ubuntu pour mettre en place Nagios (c'est mal partie !!):P J'aimerais utiliser la commande apt-get update mais elle me retourne un message d'erreur le voici : ro...
#8526 Le 21/02/2013, à 22:33 The Uploader Re : Topic des Couche-Tard (cinquante-sept) Pas chez moi. Passer de Ubuntu 10.04 à Xubuntu 12.04 LTS ASUS N56VV (UEFI + GPT, Core i5-3230M @ 2.60GHz, Intel HD4000 + GeForce 750M, 12 Go de RAM, SSD 1 To) Système principal : Archlinux (amd64), avec KDE Système oublié la plupart d...
Selected ramblings of a geospatial tech nerd Best bang for your analytical buck As (geo)data scientists, we spend much of our time working with data models that try (with varying degrees of success) to capture some essential truth about the world while still being as simple as possible to provide a useful abstraction. ...
Since I'm starting to get the hang of Python, I'm starting to test my newly acquired Python skills on some problems on projecteuler.net. Anyways, at some point, I ended up making a function for getting a list of all primes up until a number 'n'. Here's how the function looks atm: def primes(n): """Returns list of a...
Trying to edit object permissions using django-guardian in the admin site I get this error. Caught VariableDoesNotExist while rendering: Failed lookup for key [adminform] in u'[{}, {\'csrf_token\': }, {\'debug\': True, \'sql_queries\': [{\'stacktrace\':... Template error In template /Library/Python/2.7/site-packages/gr...
I've read the documentation on egg entry points in Pylons and on the Peak pages, and I still don't really understand. Could someone explain them to me, or point me at an article or book that does? An "entry point" is typically a function (or other callable function-like object) that a developer or user of your Python p...
Goal: Show data from server in wxPython GUI on client Newcomer to Twisted. I have a wxPython GUI running on a Windows 7 client, and I have a program running on an Ubuntu server that produces a log. My current attempt is to tail -f the log, pipe the output to a twisted server, then serve any data that meets my regex con...
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...
I use the following method, which works fairly well: 1) Store your passwords in separate gpg encrypted files. For example ~/.passwd/<accountname>.gpg 2) Create a python extension file with a name of your choosing (e.g., ~/.offlineimap.py), with the following contents: def mailpasswd(acct): acct = os.path.basename(acc...
How can I call the Ubuntu One authentication python script from a button using Glade? what I need to do is call a python script such as: $ python u1file.py login Gtk is a UI toolkit that is meant to be an event-driven framework. So the best approach would be to wait for some event to happen to execute your python code....
It is certainly possible to serve JSON from webpy, But if you and choosing a framework, I would look at starlight and my fork twilight (for documentation). It has a JSON wrapper for fixing the http headers for your json response. it uses either the json or simplejson libraries for json handling the conversions to and f...
List the coordinates of 8 squares adjacent to (0, 0) in a 2d grid. Namely, [(1,-1),(1,0),(1,1),(0,1),(-1,1),(-1,0),(-1,-1),(0,-1)] Order does not matter. The goal is to store the points into a list. Shortest answer wins. List the coordinates of 8 squares adjacent to Order does not matter. The goal is to store the point...
Given this code: class Shape: def area(self): pass # breakpoint here class Square(Shape): def area(self): return super().area() x = Square().area() When the breakpoint is hit, the callstack will show area twice but there is no way to tell which class it belongs to. (This has flow-on effects fo...
Suppose i have : models.py class Books(models.Model): owner = models.ForeignKey(User) title = models.CharField(max_length = 100) api.py class UserResource(ModelResource): #blhblahblah as usual class BooksResource(ModelResource): owner= fields.ToOneField(UserResource, 'owner') class Meta: qu...
I am trying to run a program that takes in input as a job is getting done. I have looked through several forms, and looked into the documentation. I'm running this in Debian, and I understand that I can use this getch function to receive characters without hitting the return key. To break it down, this is what I am try...
I'm reading my algorithms text book, and I'm reading about recurrence relations and finding the algorithms big O complexity. I run across this line "In the case of the merge-sort algorithm, we get the recurrence equation: t(n) = b if n < 2 = 2t(n/2) +bn if n >= 2 for b > 0 my respo...
We had a problem when using Reportlab to format some content that was originally html and sometimes the html was too complex. The solution (and I take no credit here, this was from the guys at Reportlab) was to catch the error when it occurred and output it directly into the PDF. That means you get to see the cause of ...
Here's the deal and reason I'm asking for your help. Last night I went on upgrading my Xubuntu 12.10 installation to 13.04, so at tty1 I run the command sudo do-release-upgrade and everything seemed to went well except that after rebooting and when I run sudo apt-get update && sudo apt-get upgrade I get this error: s...
Virtualici Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) j'ai tout tenté ! au mieux j'ai ça : ): [sudo] password for boubou: Sorry, try again. sudo: 3 incorrect password attempts boubou@boubou-M51SE:~$ ******* ******* : commande introuvable boubou@boubou-M51SE:~$ les : ******* c'est mon pass. Hors l...
last time I wrote the answer was fast and efficient, so here I go again. I got these 3 files, 2 .py and an html. The thing is that for some reason I get an error 404. It's clearly my url handing the issue. Here is my code # encoding: utf-8 import web import os import gettext import signup import verify_email urls = ( ...
pango.Color — an object representing a RGB color class pango.Color(gobject.GBoxed): pango.Color(spec) A pango.Color objectis a gobject.GBoxed pango.Color(spec) a string specifying the new color a new pango.Colorobject. Creates a new pango.Color usingthe color attributes specified by the string spec. The string in...
I've been writing a ton of Python code lately and I'm absolutely loving it. As a C programmer for the better part of the last 15 years, I find the syntax and ease of expression to be refreshing and fun. I found myself needing a periodic timer to update the window with newstatistics coming in from the daemon. You can do...
July 2nd, 2012 at 11:44 pm by Dr. Drang One of the things I like about TextExpander is the flexibility with which it can create date and time values. I used to think that some of that flexibility wasn’t available using the standard Unix/C strftime codes, but last week I learned I was wrong about that. The date/time for...
Soipacon [Tuto] Wallpapoz enfin ça marche !!!! Enfin j'ai trouvé un How To concernant wallpapoz. C'est trés bien fait et même sans être bilingue c'est facile. En tout cas chez moi ça marche impec sur Breezy noyau 686. http://ubuntuforums.org/showthread.php? … =wallpapoz Hors ligne Bob Morane Re : [Tuto] Wallpapoz enfin...
dave = [{'date':'12/10/12','time':'09:12','created_by':'adam','text':'this'}, {'date':'28/09/11','time':'15:58','created_by':'admin','text':'that'}, {'date':'03/01/10','time':'12:34','created_by':'admin','text':'this and that'}] How to I get a list of the values found in created_by. (e.g. ['adam','admi...
I am attempting to get my first Django project working, on Windows, but I get an error message that reads: File "c:\users\[username]\appdata\local\temp\easy_install-pazcre\MySQL_python-1.2.3-py2.7- win32.egg.tmp\MySQLdb\connections.py", line 187, in __init__ mysql_exceptions.OperationalError: (1045, "Access deni...
Urwid, a Ncurses library for Python, handle a signal system, witch is nice for a ncurses library. You may want to check others posts on urwid if needed. We’ll see two examples here. A first example Let’s start with the code from the last post, for reminder, it does aselectable list, with SimpleListWalker, and display t...
Raspberry Pi Colour Key Contents 0 Introduction Now we have the basics, and have been introduced to the libraries functionality we can look at some image processing algorithms. The algorithm we will look at is this tutorial is a fairly basic one. The aim is apply a Colour Key to an image, picking out a specific colour ...
nam1962 [résolu, du coup tuto] Comment nettoyer mauvaise install de langues Comment peut on récupérer un desktop en francais sous 12.04 ou 12.10 ? Je viens d'installer un Airis pour un ami en Xubuntu 12.04 Tout est total ok, mais le desktop est en anglais (tous les fichiers locale indique pourtant fr_Fr ou fr UTF8). Y ...
Eclipse Corner Article Summary This article shows you how to validate your internationalized product and prepares you for the types of common problems you can expect during translation testing. It includes an Eclipse plug-in that defines aProperties File Compareview that can help your translation testers find errors mo...
I got bored during the holiday season this year and randomly decided to write a simple list comprehension/filtering library for Java (I know there are some great ones out there, I just wanted to write it my self for the hell of it). For this list: LinkedList<Person> list = new LinkedList<Person>(); list.add...
Using Arrays as Materialized Paths in Postgres Something we've been casually working on at Disqus for quite some time is an improved pagination method for threaded comments. This is obviously pretty important to us, it drives the very foundation of our product. It also happens to be an area that's somewhat challenging,...
In a web application I'm coding with Flask/SQLAlchemy, several of my models needs a "Photo" column type, which would handle storing the original image somewhere on the filesystem, and creating differents thumbnails size of the image. Ideally, I-d want something like: class MyModel(Base): id = Column(Integer,...
I am trying to create a query which will return all shows in database ordered by number of users who have it as favorite. Simplified working code: from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.sql import func import logging app = Flask(__name__) db = SQLAlchemy(app) logging.basicCo...
How do I determine whether or not two lines intersect, and if they do, at what x,y point? There’s a nice approach to this problem that uses vector cross products. Define the 2-dimensional vector cross product Suppose the two line segments run from The two lines intersect if we can find Cross both sides with And since...
Leo 7 Re : A quoi ressemble votre environnement - printemps/été 2012 J'adore ton unity Mario_26 Est-ce que tu peux me donner le lien du wall STP, je le touve très zoli. Merci d'avance A+ hp 625: Ubuntu LTS xfce / Mac Mini ppc G4: Debian stable xfce / Les choses les plus simples sont les meilleures ! Hors ligne Major Gr...
I am new to python, however I have fair idea in MVC from Java experience. I have the following python code in view from django.http import HttpResponse from django.template.loader import render_to_string class MyListClass: def __init__(self, link, text): self.link = link self.text = text ...
my program is giving me an error when it tries to convert a string from a list of strings to a floating point number. The list is read from a line in a CSV text file and then separated into a list. How do I make this work and why is it going wrong? Here are the relevant bits of code: def Main(): srcf = open(bkp, 'r...
And you thought it helped us be more productive, ha! Ask for Help “Help! We’ve been Rick Rolled!“ Interesting Things If you want to run your Selenium tests in parallel, it looks like ThoughtWorks has released Selenium Grid. When testing Live Query, you don’t always want the event queue to be processed asynchronously, s...
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...
I am trying to port a processing.org app into python and have some difficulties with it. i need to write this in python: int[][] elevation; // elevations in meters float[][] felevation; // scaled to range [0,1] where 1=max int maxheight; void setup(){ size(600,600,P2D); // read srtm binary file elevation=new int[1201][...
Django newbie :) I'm using S3 storage via the package django-storages. This appears to work perfect when I upload/update a new image via the admin. models.py (image field) image = models.ImageField( upload_to=path_and_rename("profiles"), height_field="image_height", width_field="image_width", ...
The idea behind this omission is that static variables are only useful in two situations: when you really should be using a class and when you really should be using a generator. If you want to attach stateful information to a function, what you need is a class. A trivially simple class, perhaps, but a class nonetheles...
I have upgraded to XCode 4.3.2. In this version, the traditional Developer and Library folders are coming up with the XCode app, i.e. the path for the developer folder is Applications/Xcode.app/Contents/Developer instead of Users/UserName/Developer. With the previous version of XCode, I can build and run my project in ...