text stringlengths 256 65.5k |
|---|
We installed ArcGIS SERVER (not Desktop!) 10.1 on a RHEL (Red Hat) machine. ArcGIS Sever is supported for Linux.
However, it appears they don't make it easy to script in python, from the command line, making use of the arcpy module.
There are many things awkward about this. The arcpy library that they use is actually f... |
As discussed on the mailing list, this thread is to collect information how to set up a map with local names i.e. Serbian cyrillic. Once successfull, it would be worth to summarise.
Basic setup:
PostgreSQL with PostGIS extension -> Mapserver (renderer) -> OpenLayers (Web Presentation)
So basically start with installing... |
(I asked this question in stackoverflow.com, but I am now thinking my mistake may be mathematical rather than programming).
I am simulating geometric brownian motion, using closed-form solution for the value after an arbitrary (not necessarily infinitesimal) step dt. My drift = 0, standard deviation = 1, initial value ... |
Download
FREE PDF
JavaFX is an exciting new platform for building Rich Internet Applications with graphics, animation, and media. It is built on Java technology, so it is interoperable with existing Java libraries, and is designed to be portable across different embedded devices including mobile phones and set-top boxe... |
just noticed this thread,http://crunchbanglinux.org/forums/topic … -use/page/ and it seems a lot of people were having trouble with mpd, just set it up myself so ive written this how to.
first of all install mpd:
sudo apt-get install mpd
then because its a daemon (Music Player Daemon) you need something to control it ... |
Hizoka
Re : [g2s] GUI d'extraction de fichiers mkv
En fait la fonction qui permet d'extraire dans le même dossier, il faut cliquer dessus à chaque fois. Tu pourrais pas mettre une option à cocher dans préférences qui permettrait de la garder toujours active ?
Réinitialise les préférences.
Par contre il n'y a plus l’icô... |
Beaucoup d'entre vous sont certainement en période d'apprentissage de Python (comme moi), et à cela rien de plus normal, car Python nous offre énormément d'outils très performants pour développer !
Dans ce tutoriel, je vais vous parler d'un module en particulier, ftplib.
Si vous utilisez un client FTP (ce dernier étant... |
When it comes to working at the command line, there is really no limit to the amount of customization you can do. Sometimes it is hard to know where to start.
These are the three most helpful tools I use.
Autojump
Seth Brown introduced me to Autojump, and I am extremely grateful.It tracks which directories you use and ... |
I am having trouble arriving at a normalized relational database design to describe a small hierarchy which deviates enough from the typical hierarchy examples such that I am unsure how to proceed my first time tackling such a problem.
My problem is as follows:
Each branch in the hierarchy is guaranteed to be either 2,... |
You are essentially splitting the list, reversing it, then rotating it.
So this works:
>>> st='the price of food is 12 dollars'
>>> li=st.split()[::-1]
>>> n=3
>>> print ' '.join(l[n:]+l[:n])
food of price the dollars 12 is
Or, more directly:
>>> li='the price of food is 12 dollars'.split()[::-1]
>>> print ' '.join(li... |
gtk.TreeModelSort — a tree model that is a sorted version of a child gtk.TreeModel
class gtk.TreeModelSort(gobject.GObject, gtk.TreeModel, gtk.TreeSortable):
gtk.TreeModelSort(child_model)
def get_model()
def convert_child_path_to_path(child_path)
def convert_child_iter_to_iter(sort_iter, child_iter)
... |
I have an excel file which I am trying to put into mysql. There are 32 fields which I want to extract using the python plugin xlrd and put into mysql. The data is laid out like so:
My methodology is to iterate over the rows and columns, adding fieldnames as I go. The code adds the field name but then there is an error ... |
Possible Duplicate:
How to clone a Python generator object?
Suppose I have a generator 'stuff_to_try', I can try them one by one but if I had a method that wanted to go through the generator and that method is recursive, I want to let each recursion get a fresh new generator that starts at the first yield rather than w... |
Is there something more simple we could try first?
Should we compare the secrets?
'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 in... |
ljere
Re : Live Voyager 12.10
merci pour les précisions c'est vraiment cool je plains rodofr si il veut intégrer tout ça
Hors ligne
metalux
Re : Live Voyager 12.10
Le repos aura été de courte durée, qu'est-ce qu'on peut dire des C.....quand on a un coup de barre!
Quelqu'un a testé ce que j'ai exposé au post #314? De mo... |
Last night, I decided to take the plunge, and install Ubuntu as complimentary part to my dual boot system (with Windows 7). Unfortunately, the entire process has been a struggle uphill, namely with getting the bootloader configured properly.
A short historical synopsis, for the full context of the situation:
Generated ... |
Aegyptos
[En cours] Installation Dual Boot W7 : OS non reconnu
Bonjour,
Pour des besoins pro j'ai besoin d'installer Ubuntu, mais je dois également garder une session window, j'ai donc cherché à installer ubuntu, mais j'ai rencontrer quelques soucis. J'ai cherché à droite et à gauche des réponses, mais je n'y arrive to... |
Rick Muller, Sandia National Laboratories
version 0.5, Released 7/3/2013, Alpha
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Python is the programming language of choice for many scientists to a large degree because it offers a great deal of power to analyze and model scie... |
JDMK and Legacy IT Management
by Stephen B. Morris
02/16/2005
Consolidation, integration, refactoring, and migration are some of today's popular data center catchwords. All of these words reflect some kind of renewal or replacement process--the old is either substantially modified or thrown in the garbage and replaced ... |
Just for fun and because it was really easy, I've written a short program to generate Grafting numbers, but because of floating point precision issues it's not finding some of the larger examples.
def isGrafting(a):
for i in xrange(1, int(ceil(log10(a))) + 2):
if a == floor((sqrt(a) * 10**(i-1)) % 10**int(ceil(lo... |
This answer aims to explain mixins with examples that are:
self-contained: short, with no need to know any libraries to understand the example.
in Python, not in other languages.
It is understandable that there were examples from other languages such as Ruby since the term is much more common in those languages, but th... |
nesthib
[JEU] challenge bash #6
Espaçeur de paragraphes
Imaginons un texte, celui-ci est composé de différents paragraphes. La plupart du temps un paragraphe sera coupé en deux à la fin d'une page. Le but de ce challenge est de réaliser un script qui formate le texte de façon à ce qu'un paragraphe ne soit jamais coupé ... |
Django Registration for Newbies
introduction
This is another in a series of posts exploring how to build social networking capabilities in a Django application while also exploring related tools and approaches that are new to me. I have been sidetracked for some time now with discussions of REST, and if you’ve been fol... |
As one of the participants of the organization had to handle some unexpected event, I took the opportunity to start a small research during casual conversation: "What development tools do you use at company?". In an ideal world the answer would have been: "Perl", but they told me that they work mainly in Python, but ca... |
I am trying dual boot Windows 7 and Ubuntu on my Elitebook 8560w via WUBI. Between Microsoft and HP they used up all my primary partitions so I decided WUBI was the best way to go. It all goes smoothly until I reboot to finish the installation, then it hangs at copying files. It always freezes here:
debconf (filter): w... |
Piotr Roszatycki
About:I blog about Perl.
Recent Actions
Commented on On prototyping in public ... the long version I advocated your project last weekend at Polish Perl Workshop in Poznań. It was just a lighning talk about mop and extending it's traits: http://bit.ly/1jFqKfj...
Commented on Python's decorators in Perl ... |
Here is an interesting problem (or at least i think so) As an Admin I have a table with N entries (51 to give a number). Each entry in a row is a recruiter name with a link to 'Login' as that person. I want to be able to click on each recruiter 'login' which takes me to that account, verify some facts there, logout, Re... |
I had a similar problem, and it took me a long time to figure out all the math, as some of the proofs can be rather terse. So, I took it upon myself to write a full explanation of how to factor N, without all the symbols and relying on a bit less prior knowledge.
This is an application of the shared modulus attack expl... |
A long time ago, when I was first introduced to email, I was using the Mail program from Unix. I quickly converted to Elm, then Mutt, which were both better in terms of interface. Then I found out about Gnus, and I wouldn't dream of letting it go now. However, Gnus has started showing its age several times, and several... |
Jx7
Re : [script] Télécharger de nombreuses quotidiennes de canal+ (suite)
J'ai l'impression que tu as un problème de droits d'écritures.
Hors ligne
Jx7
Re : [script] Télécharger de nombreuses quotidiennes de canal+ (suite)
Où as-tu placer le script?
Hors ligne
Jx7
Re : [script] Télécharger de nombreuses quotidiennes d... |
ogaby
Re : [ATTENTION] Faille de sécurité critique dans le noyau Linux !
vi...
Avec cette simple ligne, on peut bénéficier des mises-à -jour de sécurité plus rapidement que sur un dépà´t européen. Je dis "européen" car je vis en Allemagne et mon dépà´t "normal" n'a pas encore cette mise-à -jour.
Hors ligne
zappinggg
Re... |
Mathieu11
[ VOS SCRIPTS UTILES ] (et eventuelles demandes de scripts...)
Edit admin : le sommaire renvoyant vers les différents scripts se trouve désormais sur cette page de la documentation.
Les nouveaux scripts peuvent donc être discutés ici, puis inclus dans le sommaire
J'ouvre ce sujet pour proposer a chacun de pos... |
I would like to determine the tab width used in source files indented with spaces. This is not hard for files with particularly regular indentation, where the leading spaces are only used for indentation, always in multiples of the tab width, and with indentation increasing one level at at time. But many files will hav... |
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... |
2fast4u
Squid3 (AD/NTLM) - performances médiocre (TCP_MISS, TCP_DENIED)
Bonjour,
Je viens d'installer squid en suivant ce tuto et j'ai un comportement étrange de mon proxy.
Installé sur une version serveur 12.04
l'authentification kerberos semble ok, kinit et klist montrent qu'un ticket est bien validé
l'intégration au... |
xxkirastarothxx
MegaUpload : BotMU v1.0.1
Bonjour à tous
Et bien voila, depuis quelques temps j'ai remarqué que le capcha de Megaupload a disparu.
Comme il s’agissait du point le plus bancale du développement d'une automatisation de téléchargement sur Megaupload, le projet était en attente.
Maintenant que ce point n'ex... |
28 November 2011
[This post is by Eric Chu, Android Developer Ecosystem. —Dirk Dougherty]
In the 24 months since the first Android device became available locally, Korea has quickly become one of the top countries in Android device activations. In parallel, we’ve also seen tremendous growth in app downloads from Androi... |
siscard
Re : Open Office, Reconnaissance de caractères, Xsane, Kooka et Cie...
L'erreur de segmentation est revenue comme elle avait disparue.
Si quelqu'un a une idée, je suis preneur.
Tout ce que j'ai trouvé, c'est que le logiciel essaie d'utiliser un espace de mémoire qui ne lui est pas attribué; alors cela provient ... |
TravellingFroggy
ttf-mscorefonts-installer : Erreur au démarrage
Bonjour,
J'ai un message d'erreur à chaque démarrage :
Data files for some packages could not be downloadedName-ar.UTF-8
The following packages requested additional data downloads after package installation, but the data could not be downloaded or could n... |
n3o51
Re : ADesk Bar : Barre de lancement rapide [python/gtk/cairo]
Ah ok je regarde ça merci, bone je n'arrive pas as avoir les options du plugins c'est ou ? je clique dessus est pas possible de modifier
Dernière modification par n3o51 (Le 08/02/2012, à 21:10)
Welcome to the real world
________________________________... |
Your problem is actually Eclipse. Assuming that you use PyDev, I was able to reproduce the problem. When entering something in the Eclipse console, the problem occurs as described in your question. But when directly executing the very same script with the Python 3.1.1 interpreter, inputted does not include a newline ch... |
<HTML>
<HEAD><TITLE>Login Page</TITLE></HEAD>
<BODY>
<CENTER>
<FORM method="POST" action="http://yourserver/cgi-bin/login.py">
<paragraph> Enter your login name: <input type="text" name="login">
<paragraph> Enter your password: <input type=password name="password">
<paragraph> <input type="submit" value="Connect">
</FO... |
I am thinking that there might be two ways to do this? I don't have photoshop so...Maybe I'll try python.
Hopefully you used a tripod, a remote, and continuous shooting. I could see variable and long times between images very problematic.
I have never done this, just thinking out loud. I'll have to take a time series a... |
From Python's sources object.c:
/* Test whether an object can be called */
int
PyCallable_Check(PyObject *x)
{
if (x == NULL)
return 0;
if (PyInstance_Check(x)) {
PyObject *call = PyObject_GetAttrString(x, "__call__");
if (call == NULL) {
PyErr_Clear();
return 0;
... |
I've seen a quite a few questions on the Project Euler and other places asking how to time the execution of their solutions. Sometimes the given answers are somewhat kludgey - i.e., adding timing code to __main__, so I thought I'd share my solution.
Python includes a profiler called cProfile. It not only gives the tota... |
I have a python script that takes information from the user through the built in input() function.
My question is why do the backspace and arrow keys not function correctly and how can I fix it so they function as intended.
A simple example of the problem I am having...
#!/usr/bin/env python3
while 1:
x=input("enter ... |
Here's a small python program that can do it:
import sys
def chunkCheck(fileObject, chunkSize=1024):
while True:
data = fileObject.read(chunkSize)
if not data:
return False
if data.strip("\0"):
return True
sys.exit(chunkCheck(open(sys.argv[1])))
And in action:
$ prin... |
Consider a weapon firing shots every $f^{-1}$ seconds (i.e. $f$ is the weapon's fire rate). Each shot deals $n$ damage to is target. Consider another weapon firing every $3f^{-1}$ second, but dealing $5n$ in damage. You want to determine which weapon has the greatest damage potential, assuming those weapons are equally... |
TextMate is and will always be a modern GUI application. However, developers are often forced to walk in two worlds using both GUI and command-line tools. TextMate has always bridged the gap between these environments with its trusty command-line sidekick: mate.
In TextMate 2, mate has learned some new tricks. A new pa... |
Mod_python's PSP: Python Server Pages
by Gregory Trubetskoy
02/26/2004
The new 3.1 version of mod_python introduces several major additions and enhancements over the previous 3.0 version. They are PSP, Cookie, and Session support. This article will introduce the first addition on the list, PSP.
Python Server Pages (PSP... |
Trac
warrenp at June 25th, 2012 09:51 — #1
Bitnami Trac Stack is installed on a Win2008R2 box.
I would like to install the mercurial plugin as shown here called TracMercurial.
I follow the instructions to download and build an .egg and get that put into the Trac installation, and if I get the right version (0.12) inste... |
However,in the pseudocode ,there is a line where count is incremented by the number of remaining elements in array 'a'.In the above python code,it is given as
count += len(a) - i
can't we do the same by
count += len(a[i:])
Also,instead of
c += a[i:] + b[j:]
I wrote,
c.append(a[i:])
c.append(b[j:])
In total my versio... |
Running GUI Applications
Tkinter applications are normal Python scripts, but there are a couple of complications worth knowing about when running graphical applications under Windows. These were discussed in Chapter 3, Python on Windows, but are important enough to reiterate here; what we say in this section applies eq... |
toward a RESTful approach to Django applications
Although it may not look like it at first, this is intended to be the second in a series about implementing a tagging application in DJango. Part of my motivation was to learn more about Django and to become more familiar with technologies like Selenium, and architectura... |
PPdM
Coup de gueule contre les anglicismes inutiles
Salut
J'en ai ras le bol des ces gens qui se croient toujours obliger de souligner leurs propos d'anglicismes parfaitements inutiles.
En plus souvent ceux ci sont employés a mauvais escient, quand ce n'est pas totalement a contre-sens.
Hier, j'écoutais a la radio une ... |
Viel Gutes habe ich über die Scriptsprache Python gehört, beispielsweise dass es aufgrund des Aufbaus schwer ist, damit überhaupt unübersichtlichen (und damit schwer wartbaren) Code zu erzeugen. Deswegen wollte ich mir die Sprache schon seit geraumer Zeit unbedingt mal ansehen. Den ersten Schritt habe ich heute gemacht... |
Salutations. Dijkstra wrote that even a few lines of seemingly simple code could be hopelessly ambiguous. In at least one work, which I can't find now to save my life, he gave a little example program to demonstrate this ambiguity. Can anybody point me to a paper of his where he includes one of these examples?
Read thi... |
Topic: Error 500, Upgrading from OpenSource to Pro
Hi Guys !
Finaly i buyed this Masterpiece of Mailserver and now i upgraded to iRedAdmin Pro.
Used the guide from Zhang.
in my apache log i get this error:
[Thu Oct 07 13:31:22 2010] [error] [client 80.123.169.178] mod_wsgi (pid=3289): Target WSGI script '/usr/share/apa... |
I want to send a datetime.datetime object in serialized form from Python using JSON and de-serialize in JavaScript using JSON. What is the best way to do this?
You can add the 'default' parameter to json.dumps to handle this:
>>> dthandler = lambda obj: (
... obj.isoformat()
... if isinstance(obj, datetime.date... |
最近几个月虽说没有以前补番那么疯狂了,但看的几部作品都是绝对佳作,记录一下。
首先是神枪少女/Gunslinger Girl,以下简称GSG
神枪少女是日本漫画家相田裕的作品,故事舞台是在现代的意大利都市。政府机关“社会福址公社”表面上是收容重伤残障的少女给予医治和帮助职业训练的福利机构,但实际上是将收容的少女加以义体改造并投入药物加以洗脑制约使其成为对抗恐怖份子的尖兵。每位少女都搭配一位辅佐官,而这组合称为"fratello",是意大利语中“兄妹”之意,每位少女对其辅佐官都有制约造成的混合了爱情及亲情的绝对忠诚。(来自百度百科)
GSG的动画是03年的,和钢炼03一样,在动画化的时候漫画未完结,所以动画原创了一个结局。但是,这个结... |
I'm trying to learn Python by working my way through problems on the Project Euler website. I managed to solve problem #3, which is
What is the largest prime factor of the number 600851475143 ?
However, my code looks horrible. I'd really appreciate some advice from experienced Python programmers.
import math
import uni... |
You are probably importing the wrong os.py module. Try starting python2.6and then
>>> import os
>>> print os.__file__
That should be /usr/lib64/python2.6/os.py or /usr/lib64/python2.6/os.pyc.If it is not remove (or rename) the file that you found.If it is try:
>>> os.urandom(3)
This should give you a string of 3 char... |
In my SQLAlchemy app I have the following model:
from sqlalchemy import Column, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker
from zope.sqlalchemy import ZopeTransactionExtension
DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExt... |
In normal LFSR, the state is a function of the initial seed, taps positions and time, nothing else. I've seen a modification of LFSR that works like this:
TAPS = const
MASK = (1<<L)-1 #L=bitlength of state
def parity(x):
return (number of ones in x)&1
def tick(state):
b = parity(state & TAPS)
return (st... |
Anyone know a quick easy way to migrate a SQLite3 database to MySQL?
Here is a list of converters:
An alternative method that would work nicely but is rarely mentioned is: use a ORM class that abstracts the specific database differences away for you. e.g. you get these in PHP (RedBean), Python (Django's ORM layer, Stor... |
Even though pseudo-code seems closer to code than an algorithm, in practice, pseudo code is less formal and it is a more high level description. For instance you can describe a chess playing computer as a pseudo code like this:
place initial pieces in their locations
show board
while game is not over
make move and disp... |
Clhiver
[RESOLU] Messages d'erreur dans le fichier ~/.xsessions-errors
Salut à tous,
Je viens de jeter un coup d'oeil au fichier sus-nomméqu i contient pas moins de ...12000 lignes d'erreurs. Heureusement, elles sont des mêmes genres :
(gksudo:2450): Gtk-WARNING **: Impossible de trouver le moteur de thème dans module_... |
This is a follow-up question from my other question:
I have the following data frame, subsetted from my original data frame, with columns ob, event, unixtime, and day, and I want to add another column arbday which is the nth day since the first event (with the first visit being day 1) grouped by ob:
import numpy as np ... |
I'm realy sorry, if this question is a bit stupid... But this is my first time on mathematics stackexchange.
Do you guys now for example, how to know the number of monday in a year?
This program computes days of the week for modern dates. You can step through the lines and attempt to glob together a compressed formula.... |
This program has been disqualified.
Author &&&
Submission date 2011-06-20 19:41:33.053292
Rating 5647
Matches played 5
Win rate 60.0
import random
#Weighted random beat previous inputs
def weighted_choice(C, p):
x = random.random()
for elmt in range(len(C)):
if x <= p[elmt]:
return C[elmt]
... |
Both solutions here address an object already in your workplace. If possible (or at least in the future) you can make use of the na.strings argument in read.table. Notice that it is plural "strings", so you should be able to specify more than one character to treat as NA values.
Here's an example: This just writes a fi... |
Python + Piet one-liners: 417 chars + 7391 7107 executing codels
This Python script produces a 7393 x 2 image; the rightmost 2x2 block of which is a "sentinel" which terminates the program; so I'm not counting those; and the second row is otherwise white. I can probably golf the piet code down further by using addition... |
Does anyone know how to delete all datastore in Google App Engine?
If you're talking about the
If you're talking about the
Make sure to clean your project afterwards.
This is one of the little gotchas that come in handy when you start playing with the Google Application Engine. You'll find yourself persisting objects i... |
So this is my first project with Django. As a result, I seem to learn new things about how it handles models every day. Because of this, my database is changing every day. Each time I want to update my database, I need to drop it, create it, run syncdb, and then populate it with user data. I was hoping to automate this... |
I shoot RAW+JPG, namely NEF and JPG. After viewing sometimes hundreds of images (using a simple program) and deleting the JPGs, I have many unnecessary leftover NEF files. If there was a script to delete any orphan NEF files in the directory, that would be very helpful. I read a similar question here "How to delete JPG... |
All standard YMMV disclaimers apply.
Update (20090324−2): According to John Millikin, the author of jsonlib, cjson is buggy and unmaintained. I will evaluate further and post a followup blog entry. My discussion with Dan Pascu, the author of cjson, corroborates these claims. I urge readers to read John ... |
I want to execute the following two functions at exactly the same time.
from multiprocessing import Process
import os
import datetime
def func_1(title):
now = datetime.datetime.now()
print "hello, world"
print "Current second: %d" % now.second
print "Current microsecond: %d" % now.microsecond
def func_2... |
Module EbuildPhase
source code
__package__ = '_emerge'
_post_phase_cmds = {u'install': [u'install_qa_check', u'instal...
Imports: gzip, io, sys, tempfile, AsynchronousLock, BinpkgEnvExtractor, MiscFunctionsProcess, EbuildProcess, CompositeTask, _prepare_workdir, writemsg, MetaDataXML, portage, os, _encodings, _unicode_... |
Is there a way in Python to initialize a multi-dimensional array / list without using a loop?
Sure there
arr = eval(`[[0]*5]*10`)
or
arr = eval(("[[0]*5]+"*10)[:-1])
but it's horrible and wasteful, so everyone uses loops (usually list comprehensions) or numpy
Depending on your real needs, the de facto "standard" pack... |
A ‘logout’ button has suddenly appeared underneath the main nav bar on some pages of my site, but not linked to the menu system in WP.
Any ideas what is generating this and how to get rid of it??
Hey,
open up abundancewoocommerce-configconfig.php and remove following code line:
$output .= "<li class='account_logout_lin... |
Editor's note: The second edition to Python Cookbook has been updated for Python 2.4 to include more than 200 recipes with solutions to problems that Python programmers face every day. We've selected two new recipes from the book to showcase here; check back next week for two additional recipes on implementing a ring b... |
With the drudgery of last month's article behind us, let's explore the DISLIN data visualization package. If you do not have DISLIN installed, you can obtain the software from http://www.linmpi.mpg.de/dislin. DISLIN provides the Python programmer with a robust package capable of producing both 2D and 3D graphs. DISLIN ... |
edit Totally rewritten example, the issue is the same.
I have SConsctruct file:
env = Environment()
def write_main( out ):
out.write("""
#include <iostream>
int main(int argc, char **argv)
{{
std::cout << "[{0}]" << std::endl;
return 0;
... |
nesthib
[JEU] challenge bash #6
Espaçeur de paragraphes
Imaginons un texte, celui-ci est composé de différents paragraphes. La plupart du temps un paragraphe sera coupé en deux à la fin d'une page. Le but de ce challenge est de réaliser un script qui formate le texte de façon à ce qu'un paragraphe ne soit jamais coupé ... |
benoitfra
[Script] reconnaissance vocale avec google
Voilà pas mal de temps que le projet avait été lancé (2012) mais je n'avais pas les compétences et le temps pour amener le projet là où je le désirais. J'ai donc repris tout le projet à 0 afin de fournir un système beaucoup plus souple et rapide de prise en main.
Pri... |
Today, I updated my Ubuntu (I have KDE Desktop installed on it before) and after the update, Ubuntu Software Center said: Items cannot be installed or removed until the package catalog is repaired. Do you want to repair it?; and when I'm clicked on Repair, after 2 seconds it says:
The installation or removal of softwar... |
I tried to use the jquery plugin "uploadify" to upload multiple files to My App in Google App-Engine, and then save them with blobstore, but it failed. I traced the code into get_uploads, it seems field.type_options is empty, and of course does not have 'blob-key'. Where does the key 'blob-key' come from?
the code like... |
I'm trying to print out the body of a HTTP response using Python.
Here is my code sofar:
from twisted.web import proxy, http
from twisted.internet import reactor
from twisted.python import log
import sys
log.startLogging(sys.stdout)
class ProxyFactory(http.HTTPFactory):
protocol=proxy.Proxy
reactor.listenTCP(8080, Pr... |
I've been at this for some time and read many sites on the subject. suspect I have junk lying about causing this problem. But where?
This is the error when I import MySQLdb in python:
>>> import MySQLdb
/Library/Python/2.6/site-packages/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg/_mysql.py:3: UserWarning: ... |
I am reading in a file using numpy.genfromtxt which brings in columns of both strings and numeric values. One thing I need to do is detect the length of the input. This is all fine provided there are more than one value read into each array.
But...if there is only one element in the resulting array, the logic fails. I ... |
I am running into this sqlachemy error that I haven't been able to understand:
sqlalchemy.exc.InvalidRequestError: SQL expression, column, or mapped entity expected - got '<class '__main__.JobRecord'>'
What does this error mean? What are possible causes?
This is the method that triggers the error:
@classmethod
def fin... |
An example from the book Core Python Programming on the topic Delegation doesn't seem to be working.. Or may be I didn't understand the topic clearly..
Below is the code, in which the class CapOpen wraps a file object and defines a modified behaviour of file when opened in write mode. It should write all strings in UPP... |
I had a problem with the Django tutorial so I asked a question here. No-one knew the answer, but I eventually figured it out with help from Robert. Python seems to be treating import datetime the same as from datetime import *.
Working code:
import datetime
from django.db import models
class Poll(models.Model):
que... |
I agree with Laksham that you should avoid this situation. But sometimes, we have to. I face this situation and proceed this way.
If you want to avoid losing data you can dump the old application data into a json file.
python manage.py dumpdata old_app --natural --indent=4 1> old_app.json
Note the --natural option tha... |
Gemnoc
Re : Logiciel de CAO 2D/3D (Conception Mecanique)
Une autre demande pour Ellypsis, pourrais-tu démarrer FreeCAD de cette façon dans le terminal :
freecad --write-log
Ceci va enregistrer un fichier journal FreeCAD.log dans le dossier ~/.FreeCAD, ouvres-le et postes le contenu ici.
J'ai testé rapidement le Sketch... |
O'Reilly Book Excerpts: Gaming Hacks
Gaming Hacks for Geeks, Part 2
by chromatic
Editor's note: Last week, in part one of this two-part series of hack excerpts from Gaming Hacks, author Simon Carless showed you how to write your own MMORPG macros. This week, Simon is back, giving you the hacking tools you need to creat... |
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... |
PDemong
[Résolu] Avoir les accents sur mon serveur apache
Bonjour,
comment faire pour que mon serveur apache affiche correctement les accents ?
Je ne tiens pas spécialement à écrire mes textes avec des é etc...
Merci.
Dernière modification par PDemong (Le 16/01/2006, à 07:31)
Hors ligne
fingolfin
Re : [Résolu] A... |
Getting started with the R2MLwiN package
With the release of the R2MLwiN package late 2012, R users have access to another software package for running Bayesian models using Markov chain Monte Carlo (MCMC) methods. R2MLwiN is an R command interface to MLwiN, allowing users to fit multilevel models using MLwiN from with... |
For just five interview questions, it surely ended up as a long read. Nevertheless worth the read:
The Five Essential Phone-Screen Questions — Steve Yegge
I just might translate some of his examples to Python:
Example 1: Write a function to reverse a string
def reverse(text):
....result = list(text)
....return ''.join(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.