text stringlengths 256 65.5k |
|---|
Accessibility
doubledee — 2014-01-07T19:43:25-05:00 — #1
When a User views a PM, there is a "Star" icon placeholder which can be used to denote if a PM is "Important".
By default, a PM is "Normal" and so a Grey Star is displayed.
However, by clicking on the "placeholder", the User can mark the PM as "Important" and a R... |
Quicksort is described as "in-place" but using an implementation such as:
def sort(array):
less = []
equal = []
greater = []
if len(array) > 1:
pivot = array[0]
for x in array:
if x < pivot:
less.append(x)
if x == pivot:
equal.appen... |
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... |
i folks, I'm trying to use the subsample method in the PhotoImage class to resize an image I have in a list that links to a Label widget in Tkinter but python says there is no such method. I know I could use Image.resize before calling Photoimage but since I'd like to resize the image at any time I don't know what to d... |
I have code that generates this error:
** Message: pygobject_register_sinkfunc is deprecated (GstObject)
Traceback (most recent call last):
File "PlayingVideo.py", line 199, in <module>
player = VideoPlayer()
File "PlayingVideo.py", line 84, in __init__
self.constructPipeline()
File "PlayingVideo.py", line 99, in const... |
I need to know how to get this code working on Django.
This example WORKS:
View:
def index(request):
if request.user.is_authenticated():
username = request.user.username
else:
username = None
Template:
{{ username }}
Now what I want to do is this, but this is NOT WORKING:
View:
def index(r... |
I'm categorically rejecting the 2to3 approach--for myself anyway. If you think it would help, feel free to:
Me, I'd rather just drop cherrypy/ into 3k and skip steps 1-5.
Changes I had to make so far (http://www.cherrypy.org/changeset/2029):
At the moment, I'm a bit blocked importing wsgiserver--we had a nonblocking ve... |
I've decided to make a wallet trough Armory so I can transfer Bitcoins to cold storage, so I went to install Armory.
Now, Armory installed all well and good and than asked me to install PPAs, which I followed the install procedure. Then I got an error.
I was saying that qt4 based programs are needed along with python-q... |
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/... |
My question is: What is it that makes those languages suitable? From what I know, they are slower than other languages, and operate at a higher abstraction level, which means they are too far from the hardware. The only reason I could think is because of their advanced string manipulation capabilities, but I believe th... |
I need to store an uptime in a mysql environment. The uptime can vary from a few hours to more than one year. I was considering using a DATETIME type for mysql. I'm working with python, and the uptime is obtained from
def convertdate(lastrestart):
# now in datetime
nowdt=datetime.now()
# last_restarted in date... |
Is it possible to chain metaclasses?
I have class Model which uses __metaclass__=ModelBase to process its namespace dict. I'm going to inherit from it and "bind" another metaclass so it won't shade the original one.
First approach is to subclass class MyModelBase(ModelBase):
MyModel(Model):
__metaclass__ = MyModelB... |
I am using mysqldb in python.
I need to do the following for a table.
1) Lock2) Read3) Truncate the table4) Unlock
When I run the below code, I get the below error. So, I am rather unsure on how to lock a table for reading it, then truncating the table. I need to be sure that no other connection reads the data.
asin_li... |
I'm trying to use celery in my Flask-based web app and monitore it's state. My idea is to store task's id in session, and use it for state polling.
Here is content of my tasks.py
from traceback import format_exc
import settings
from celery import Celery, current_task
from celery.utils.log import get_task_logger
from ce... |
8.2 Git et les autres systèmes - Migrer sur Git
Migrer sur Git
Si vous avez une base de code dans un autre VCS et que vous avez décidé d'utiliser Git, vous devez migrer votre projet d'une manière ou d'une autre. Ce chapitre traite d'outils d'import inclus dans Git avec des systèmes communs et démontre comment développe... |
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... |
You have just finished your beautiful web application, with lots of pages, links, forms, and buttons; you have spent weeks making sure that everything works fine, that it handles the special cases correctly, that the user cannot crash your system no matter what she does.
Now you are happy and are ready to ship, but at ... |
Here's my stripped-down setup.py script with non-code stuff removed:
#!/usr/bin/env python
from distutils.core import setup
from whyteboard.misc import meta
setup(
name = 'Whyteboard',
version = meta.version,
packages = ['whyteboard', 'whyteboard.gui', 'whyteboard.lib', 'whyteboard.lib.pubsub',
... |
I have configured hadoop1.0.3 on with 3 machines with fully distributed mode.on the first machine below jobs are running:
1)4316 SecondaryNameNode 4006 NameNode4159 DataNode4619 TaskTracker4425 JobTracker
2)2794 TaskTracker2672 DataNode
3)3338 DataNode3447 TaskTracker
Now when i run simple map reduce job on it,it takes... |
I would like to check commit message before git commit. I use pre-commit hook to do that, but couldn't find the way to get commit message in .git/pre-commit script. How could I get it?
In the pre-commit hook, the commit message hasn't been created yet. You probably want to use one of the
old, new, branch = sys.stdin.re... |
Chrome gives this error, yet I can ping the server!
The server at www.odesk.com can't be found, because the DNS lookup failed. DNS is the network service that translates a website's name to its Internet address. This error is most often caused by having no connection to the Internet or a misconfigured network. It can a... |
When I try to install any software from ubuntu software center it comes with error:
An unhandled error occured
There seems to be a programming error in aptdaemon. This is the software that allows you to install/remove software and to perform other package management related tasks.
details
Traceback (most recent call la... |
This node concerns using and understanding arrays of function pointers in the C language. Other languages not included, 1/bazillion chance of winning, see official rules for details. I have generally checked the code herein using gcc (and had to correct it extensively); the code that is shown here should work if used r... |
I'm trying to upload a CSV file via Django app into a blobstore file in Google App Engine. I'm running into a problem were dumping the file as uploaded could end up with the wrong newlines. So, I need to open the uploaded file in python's universal newlines mode. The Django documentation suggests that I can use .open()... |
<Database>
<BlogPost>
<Date>MM/DD/YY</Date>
<Author>Last Name, Name</Author>
<Content>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas dictum dictum vehicula.</Content>
</BlogPost>
<BlogPost>
<Date>MM/DD/YY</Date>
<Auth... |
I have a simple flask app, single page, upload html and then do some processing on it on the POST; at POST request; i am using beautifulsoup, pandas and usually it takes 5-10 sec to complete the task.
at the end i export the resultant dataframe to excel with pandas(with the update of the previous stored excel if presen... |
When I do ./manage.py process_email in my app, I get ImportError: No module named commands.process_email.
My directory layout is:
./âââ __init__.pyâââ admin.pyâââ forms.pyâââ managementâ âââ __init__.pyâ âââ commandsâ âââ __init.py__â âââ process_email.pyâââ... |
I'am using Centos 6.5 with latest updates.
My problem is that whenever i try to connect to some local service it just hangs for example:
wget
wget 127.0.0.1
--2014-03-11 12:43:42-- http://127.0.0.1/
Connecting to 127.0.0.1:80...
After a while timeout...
ssh
# ssh 127.0.0.1 -p 6060 -v
OpenSSH_5.3p1, OpenSSL 1.0.1e-fip... |
#0 Re : -1 » Besoin de testeurs pour Pap'rass » Le 12/12/2009, à 19:50
senacle
Réponses : 118
Bonjour,
Je commence à utiliser Pap'rass et il me semble bien fait.
Voici quelques suggestions.
1/ Lorsqu'on ajoute un document, dans la boîte de dialogue "Enregistrer le document", il faudrait que le champ "Saisir le titre du... |
Sure it can be done in polynomial time. It's an excellent exercise in dynamic programming or memoization.
Lets assume N (the number of digits) equals 10 for the example.
Think of it recursively like this: How many numbers can I construct using 10 digits starting from 1?
Answer is
[number of 9-digit numbers starting fro... |
Ruby 2.1.0 Language Changes
> string = "hi mom"f
= "hi mom"
> string.frozen?
= true
> string << "lol"
RuntimeError: can't modify frozen String
from (irb):27
from /Users/Justin/.rubies/ruby-2.1.0-preview1/bin/irb:11:in `<main>'
> 3.14r
= (157/50)
> 0.01r
= (1/100)
Very useful when the (im)precision of ... |
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... |
Whenever I render a JADE template, I get all HTML in a single line. This makes it difficult to read in view-source mode. How can I tell JADE to create HTML which is properly indented?
Here is my template:
#application
p#docs
a(href='/docs/index.html') Documentation
p#user-input
input#msg(name='msg', size='5... |
JavaScript
heinz_stapff — 2011-10-09T13:34:24-04:00 — #1
I don't understand why I can't get either of these methodes to work but for sure there are syntax errors in the script that are not being reported by 'Developer' tools in IE8.
Script not working
function getprompt(){
/*
f1.innerHTML=' ';
var f1prompt=document.cre... |
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... |
SQLAlchemy
Although it sometimes might seem as if relational databases have gone the way of the dinosaur, making way for non-relational (NoSQL) databases, such as MongoDB and Cassandra, a very large number of systems still depend on a relational database. And, although there is no requirement that a relational database... |
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... |
I have written some code to simulate some hardware I'm working with and uploaded it to the Arduino board. This code works. I know this, because I get the expected response from HyperTerminal.
However, when I try to connect using PySerial the connection does not error, but I get no response to the commands I send.
Why m... |
AlexandreP
Re : Generateur de sources.list en Francais
Euh... en même temps, je suis pas totalement sûr que ce soit ça : si on regarde le message d'erreur, Ubuntu tente de rejoindre l'adresse IP 1.0.0.0. Je doute très très fortement que se soit la bonne adresse du serveur
Un connaisseur, siouplease ?
«La capacité d'app... |
I have an undirected graph which is given as a neighbourship matrix. I need to find the count of 4 cycles: the cycles which contain 4 edges. If you have any idea about the algorithm, please help me.
Simple (not optimal) approach pseudo code:
output = []
skip_nodes = []
for node in input_graph:
if node in skip_nodes... |
unit testing in SCons
Wed, 15 Jun 2005 10:53
The scons-users mailing list has a few references to how people have implemented unit tests in their build, very few of those are accompanied by code examples. The SCons wiki has a page on unit tests, which sucks to say the least.
What I want is what Greg Ward wants:
all the... |
Can I automatically start and terminate my Amazon instance using Amazon API? Can you please describe how this can be done? I ideally need to start the instance and stop the instance at specified time intervals every day.
Just in case somebody stumbles on this ye old question, nowadays you can achieve the same thing by ... |
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... |
In February 2013 I heard about the MKE Event for the International Open Data Hackathon1. Since it had the word "hackathon" in the title, I thought I'd attend. I didn't know any more than that. It was awesome - here were a group of people, none of whom I already knew, who were part of the Milwaukee Data Initiative2. The... |
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 ... |
First in a series. Code will come as well.
Ex:
(ns sample.core-spec
(:require [speclj.core :refer :all]
[sample.core :refer :all]))
(describe "Truth"
(it "is true" (should true))
(it "is not false" (should-not false)))
(run-specs)
Transforming Code into Beautiful, Idiomatic Python
Kanonvideo om hur Python skall se ut.
... |
I can no longer install or upgrade packages with apt-get since the packages python-problem-report, python-apport and apport seem to cause some problems. Any apt-get command I have tried results in the following error message:
Preparing to replace python-problem-report 2.0.1-0ubuntu15.1 (using .../python-problem-report_... |
Bismut
Re : [HOW TO] adesklets : configuration des desklets
Bon, je ne trouve toujours pas le moyen d'afficher mes desklets au bon endroit, voici le contenu de mes fichiers :
.adesklets
# This is adesklets configuration file.
#
# It gets automatically updated every time a desklet main window
# parameter is changed, so ... |
I was thinking about generating passwords with combination of English, Arabic, Chinese charac. Is this pass secure enough against brute force attacks?
Selecting characters from a larger character set should increase security; if you use a rare character like ⥠or ಠin your password that a brute force isn't trying to... |
This question already has an answer here:
I had created an environment w/ juju + MAAS, then destroyed it due to some misconfiguration. But then I re-commissioned a node (MAAS is showing the node as deployed) and now when I run juju -v bootstrap I get the following:
sysadmin@myst-a-2:~$ juju -v bootstrap
2013-05-01 11:5... |
The issue I run into the most with this type of thing is that I often want to run the __init__.py file as a script to test features, but these should not be run when loading the package. There is a useful workaround for the different execution paths between python <package>/__init__.py and python -m <package>.
$ python... |
fabkzo
Photogrammétrie: équivalents linux de 123d catch d'autodesk?
Bonjour,
La question est dans le titre :-)
L'objectif est de modéliser en 3D à partir de photos : si blender peut le faire dites moi où...
Merci :-)
Dernière modification par fabkzo (Le 31/08/2013, à 22:17)
Hors ligne
fabkzo
Re : Photogrammétrie: équiv... |
I have a Django application that sends an email. The production server has an email server but my local box does not. I would like to be able to test sending of email locally. Is there any way that I can have django not send it through the email server and just print out to a file or console?
You can configure your app... |
Introduction
web2py[web2py] is a free, open-source web framework for agile development of secure database-driven web applications; it is written in Python[python] and programmable in Python. web2py is a full-stack framework, meaning that it contains all the components you need to build fully functional web applications... |
In my lesson I was tasked with creating a Caesar Cipher decoder that takes a string of input and finds the best possible string using a letter frequencies. If not sure how much sense that made but let post the question:
Write a program which does the following. First, it should read one line of input, which is the enco... |
When executing
radiotray --resume
It will give the output below, which basically says that --resume is loaded as being an url and not as argument.
Trying to load URL: --resume
Loading configuration...
/home/roel/.local/share/radiotray/bookmarks.xml
/home/roel/.local/share/radiotray/config.xml
/usr/share/radiotray/confi... |
inconnu
Re : Petit guide pour aider au choix d'un langage
Encore une fois merci pour toutes ces références (j'ai déjà trois bouquins de 300 pages à m'infuser ). Bon c'est quand même passionnant, dès fois un peu complexe, mais je suis globalement assez surpris de la qualité. Pour tout dire, je ne pensais pas qu'il exist... |
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... |
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... |
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...
~26 users here now
News and links for Django developers.
I need some help setting up a model, please. (self.django)
... |
DonutMan75
[RESOLU] www et nom de domaine
Bonsoir à tous,
voilà j'ai une petite question qui me taraude l'esprit.
Dans un nom de domaine tel que
à quoi correspond le www ??? World Wide Web (cf. http://fr.wikipedia.org/wiki/Www), mais qu'est ce que ça apporte comme information ?
D'après moi :
- http:// >> Ca c'est le pr... |
I'm testing out various phylogenetic libraries in Python. I want to read in a Newick tree, then, given a list of taxa, generate the smallest tree that contains them all. This task is quite simple and efficient in dendropy and ete2:
newick = '((raccoon, bear),((sea_lion,seal),((monkey,cat), weasel)),dog);'
taxa = ['racc... |
I have been banging my head against the wall on this one, for some reason I am having trouble tying the different aspects of Google App Engine together to make this work.
Basically I want to let a user upload a photo to the Blobstore, which I have working in the below code, and then I want to put the BlobKey into a lis... |
Sander Struijk’s websync looks like nice way to manage a bunch of scheduled rsync transfers
node.js
node.js is an event-driven I/O server-side JavaScript environment based on V8. Includes API documentation, change-log, examples and announcements.
Phantomas takes a “module” approach to its architecture and there are a b... |
Okay, since I didn't modify the pictures in Shotwell I'm fine with this little script:
from pysqlite2 import dbapi2 as sqlite
import os
import shutil
targetdirectory = "/home/dan/pictures new/"
db = sqlite.connect('photo.db')
cur = db.cursor()
cur.execute('SELECT strftime("%Y_%m", datetime(PhotoTable.timestamp, "unixep... |
echo '<h1>hello, world</h1>' | firefoxcat index.html | firefox
These commands don't work.
If firefox can read stdin, I can send html to firefox via pipe.
Is it possible to make firefox read stdin?
These commands don't work.
The short answer is, you're better off writing a temporary file and opening that. Getting pipes ... |
After quite a few weeks of work, Graffiti has (again) reached the stage where it can render it's first words. It's now at 488 lines of code, of which the CSS related stuff itself comes in at 288 lines! There is no word wrapping yet, or any layout logic. I've been busy fixing quite a few bugs in the CSS overlays and so ... |
The worst part about setting up the push notification service is the provisioning. The major stumbling block that I came across was that there is a certificate and a key in the .cer file you download from Apple's site, I wrote a system service in C# that sent out notifications and the connections kept failing because I... |
Write a simple program that reads a line from the keyboard and outputs the same line where every word is reversed. A word is defined as a continuous sequence of alphanumeric characters or hyphen (â-â). For instance, if the input is âCan you help me!â the output should be ânaC uoy pleh em!â
I just tryed with... |
I wanted to insert the user details in auth_user table, but it gives the error of create_user() got an unexpected keyword argument 'first_name'
forms.py
from django import forms
from django.contrib.auth.models import User
from django.forms import ModelForm
from customer_reg.models import Customer
class Registration_For... |
i have two python files communicating with socket. when i pass the data i took to stdin.write i have error 22 invalid argument. the code
a="C:\python27\Tools"
proc = subprocess.Popen('cmd.exe', cwd=a ,universal_newlines = True, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
data = s.... |
In Python, the defaultdict class provides a convenient way to create a mapping from key -> [list of values], in the following example,
from collections import defaultdict
d = defaultdict(list)
d[1].append(2)
d[1].append(3)
# d is now {1: [2, 3]}
Is there an equivalent to this in Java?
Why I chose Tendayi Mawushe's sol... |
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... |
JavaScript
todd_temple — 2014-01-09T11:07:17-05:00 — #1
I have a page shown here that uses a modified PrettyPhoto gallery. The modification is for it to show a thumbnail view of the other images within the same gallery along the bottom of the overlay image. Works well for me, but the client is unhappy about the small s... |
It's a bit tricky, but you can share sets of subplots with a common colorbar.
I've drawn on a few previous anwers that might be worth reading as well:
Matplotlib 2 Subplots, 1 Colorbar
How can I create a standard colorbar for a series of plots in python
And of course, the documentation for matplotlib:
import numpy as n... |
DOM creation libraries
JavaScript performance comparison
Info
Tests a number of ways of generating DOM.
Preparation code
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script src="https://rawgithub.com/KoryNunn/crel/master/crel.js">
</script>
<script src="https://rawgithub.co... |
PenguinCoder
less info
bio website penguincoder.com
location United States
age
visits member for 2 years, 5 months
seen Nov 13 '12 at 16:20
stats profile views 0
You want to know a bit about me?? Run the following code; or not.
from random import shuffle
alphabet="abcdefghijklmnopqrstuvwxyz+!@#$%^&*"
key="&frs^!yo+j*xd... |
settings.INSTALLED_APPS ???
[edit]
All applications are registered in the settings.py file.
In [1]: from django.conf import settings
In [2]: print(settings.INSTALLED_APPS)
['django.contrib.auth', 'django.contrib.contenttypes',
'django.contrib.sessions', 'django.contrib.sites',
'django.contrib.messages', 'django.con... |
I have a code below to make collection that bind to a gridview able to sort by clicking on the column header. The problem here is "IPerson" is unknown at compile time. I want the delegate type able to decide by getting from gridview datasource.
Dim list As List(Of IPerson) = CType(Session("DataSource"), List(Of IPerson... |
Is it? Maybe. My opinion would be that it would make for a very poor fit for entertainment software generally, although it might work well for the low level libraries.
EDIT: Here's some justification for my opinion.
Wikipedia defines BDD as a technique that "encourages collaboration between developers, QA and non-techn... |
#2626 Le 05/01/2013, à 15:18
rvhm
Re : TVDownloader: télécharger les médias du net !
bjr
j'ai commencé à mettre les dépendance de tvdownloader
il me manque "libkrb53 (>= 1.6.dfsg.2)"
ou je pourrais le trouver ?
merci
Hors ligne
#2627 Le 06/01/2013, à 18:23
rvhm
Re : TVDownloader: télécharger les médias du net !
bonjour... |
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... |
Introduction
I have encountered an interesting case in my programming job that requires me to implement a mechanism of dynamic class inheritance in python. What I mean when using the term "dynamic inheritance" is a class that doesn't inherit from any base class in particular, but rather chooses to inherit from one or a... |
You are here: Home ‣ Dive Into Python 3 ‣
Difficulty level: ♦♢♢♢♢
❝ Don’t bury your burden in saintly silence. You have a problem? Great. Rejoice, dive in, and investigate. ❞
— Ven. Henepola Gunaratana
Convention dictates that I should bore you with the fundamental building blocks of programming, so we can slowly work ... |
Recently for a project, I needed to build a Python, Django, PostgreSQL, NGINX Development Virtual Machine(VM). Below are the steps that I followed to build this VM in VMware Fusion on MacbookPro (MBP). This post is as much about sharing my build experience as documenting the steps for my future use and potential automa... |
In Django, I have the following models.py
class Product(RandomPrimaryIdModel):
title = models.CharField(max_length=20, blank=True, null=True)
price = models.CharField(max_length=20, blank=True, null=True)
condition = models.CharField(max_length=20, blank=True, null=True)
class Mattress(Product):
length = models... |
I am using ajax to call sqlalchemy and pyramid to pull data from my mysql database and paginate. My Ajax call is:
$.ajax({
type: 'GET',
url: "results",
dataType: 'json',
})
.fail( function (jqXHR, textStatus, errorThrown){
alert(errorThrown);
})
.done(function(data){
$.each(data.myite... |
I've installed postgre on a CentOS server.
I basically followed this guide here: PostgreSQL On the last step it says I need Open TCP port 5432 and to do so I need to add the following line to my /etc/sysconfig/iptables:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT
restarting iptable... |
Disclaimer: I don't really know what I'm doing, so I may have phrased things wrong. I've also never asked/answered a question on here before!
I have a Django app running on Apache that I deployed using mod_wsgi and virtualenv. I want some parts of the app to use SSL, however when I install the SSL certificate, the http... |
You have a great idea to start selling the most marvelous widget ever known. You're so sure of your enterprising idea that you decide to go into business for yourself and begin manufacturing said widgets. A few years pass and you're a success. However, lately you've noticed a slump in sales, and you decide that you nee... |
First, whatever you do is going to require reading up to 10 lines from the file.
If you just want to keep the first 10 scores, then stop recording new ones, that's easy. I'll use the linecache module for efficiency (so if you call storescores 1000 times in a row, it'll remember that it already looking for and failed to... |
I did a similar thing recently and used the audiere module
import audiere
ds = audiere.open_device()
os = ds.open_array(input, fs)
os.play()
This will open the first available audio device, since you're on windows it's probably DirectSound. input is just a numpy array, fs is the sampling frequency (since the input is ... |
Easy in-place file rewriting
Using a context manager to allow painless rewriting of files
Whenever you need to process a file in-place, transforming the contents and writing it out again in the same location, you can reach out for the fileinput module and use its inplace option:
import fileinput for line in fileinput.i... |
bishop
Re : Qarte arte.tv browser (ex Qarte+7)
VinsS !
J'ai réinstallé Qarte.
Avant de lancer Qarte j'ai refait un test avec rtmpdump... pas de problème.
J'ai supprimé le dossier caché .qarte puis testé Qarte:
bishop@JC:~/Bureau$ qarte -d
lang: /usr/share/locale/fr/LC_MESSAGES/qarte.mo
11:44:14: WARNING - utils Config ... |
tomtom
Re : [HOW TO] adesklets : installation sous Ubuntu Breezy
raaah ! j'ai un probleme d'interpreteur python !
J'ai installé toutes les librairies via synaptic et adesklets aussi.
J'ai DL YAB (Yet Another Bar) et j'ai ca :
[i]tomtom@barad-luin:/mnt/config/programmes/adesklets/yab-0.0.2$ [/i][b]ls -l[/b]
total 56
-rw... |
Akamine
Impossible d'accéder au menu "Pilotes additionnels"
Bonjour,
J'ai récemment installé Steam pour Linux. Sur le wiki associé ils demandent des mises à jour des pilotes additionnels, seulement impossible d'accéder au menu "Pilotes additionnels", Ubuntu rencontre une erreur que ce soit après plusieurs reboot, avec ... |
I have user profile model with M2M field
class Account(models.Model):
...
friends = models.ManyToManyField('self', symmetrical=True, blank=True)
...
Now I need to know HOW and WHEN add each other as a FRIEND And I created a model for that
class Account(models.Model):
...
friends = models.ManyToMany... |
Using JavaScript in HomeSite 4.0, Part II: Manipulating Toolbars, Part II
Using JavaScript in HomeSite 4.0, Part II
Manipulating Toolbars, Part II
AddAppToolbutton(toolbarName, executablePath, commandLineArg, toolTip) Boolean
Adds a button to an existing toolbar (toolbarName). When clicking the button, the given execut... |
I've been given a small task - to get the user to input a limerick, and for the program to store each line in a list as the line is entered. (I then have to print the limerick back) This is my current code:
limerick_line = []
for i in range(5):
limerick_line[i].append = input("Type in a limerick line. ")
print(lime... |
Sparklines, as defined by Tufte, are intense, simple, word-sized graphics. Kind of like this: . I seemed to stumble across them at just the right time, as I have regression tests I am adding to on a daily basis. The result is a flood of information. I believe sparklines may be the answer to my information avalanche.
Al... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.