text stringlengths 256 65.5k |
|---|
Firstly let me mention I'm not a facebook user and that i'm utterly confused on how to implement the simple of task of having page/profile/whatever on Facebook for my Django app. Everything I read either seems to be conflicting or outdated.
Basically I want users to be able to follow/like my page/profile/app, which my ... |
The Google chart API produces PNG files. Just retrieve them with urllib.urlopen(url).read() or something along these lines and safe to a file the usual way.
Full example:
>>> import urllib
>>> url = 'http://chart.apis.google.com/chart?chxl=1:|0|10|100|1%2C000|10%2C000|100%2C000|1%2C000%2C000|2:||Excretion+in+Nanograms+... |
I've seen nothing definitive in the argparse documentation stating that it can or cannot permute. Based on your own observations, where permutation failed, and the following doc quotes, I'm going to conclude it cannot be done.
There's already a module explicitly named 'getopt':
Note The getopt module is a parser for co... |
I'm trying to write an abstract parent model in Django which will help me making some slug field from name field for many other child models. It uses trans encoding which works perfect for translitterating form cyrillic to latin letters. Then it uses slugify function from django to remove garbage.
class SlugModel(model... |
In this SO answer, I wanted to use the header Script component code in C# using the section title. However, the markdown syntax removed the hash sign (#) and it currently displays the text as Script component code in C. The only option that worked was ending the text with some character other than hash sign (
#) like p... |
rm -rf mydir
is painfully slow for a directory tree with 100000 files (in sub-directories) on a reiserfs file system.
Any ideas for faster removal of directory trees (even risking rare corruption) ?
The only solution I can think of is to have all your files on a separate files system. The file system can live on disk p... |
xbindkeys..
sudo apt-get install xbindkeys
Xbindkeys is a very versatile program that lets you remap keys very easily. It uses a config file, my default located in your home directory, to change key bindings into certain commands.
To create a default config file you use the command:
xbindkeys --defaults
Which prints t... |
Profiling shows this is the slowest segment of my code for a little word game I wrote:
def distance(word1, word2):
difference = 0
for i in range(len(word1)):
if word1[i] != word2[i]:
difference += 1
return difference
def getchildren(word, wordlist):
return [ w for w in wordlist if di... |
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've created a program in python and mySQL which creates a database and imports the data from text files and puts them into 4 different columns. The code works but I want to change the code and create functions.
Can anyone please help me create a function that creates a mySQL database? Here is the code I have at the mo... |
peterp@n
Re : Logiciel de CAO 2D/3D (Conception Mecanique)
Cool, ca se paufine bien tout ça.
C'est avec quelle versions exactement la vidéo ?
Ubuntu 12.04 64bits, Raspbian “wheezy”, Tango Studio sauce debian
Un bureau d'études techniques pour le bâtiment avec des logiciels libre.
Entreprise de construction bois. - Form... |
AnsuzPeorth
[HtmlDesktopTools] Tout pour votre bureau en HTML5/JS/CSS3
Bjr,
N'ayant pas trouvé une taskbar qui me convienne, j'ai codé, pour le fun, une taskbar html. Plutot que de me faire juste ma taskbar, j'ai plutot développé un outils qui permet de faire ses widgets en html pour le bureau, dont ma taskbar.
Ce proj... |
crawl.py. I try to port it to python3. I leave out all unnecessary details. Error:
Traceback (most recent call last):
File "crawl.py", line 44, in parseAndGetLinks
self.parser = html.parser(AbstractFormatter(DumbWriter(StringIO())))
TypeError: 'module' object is not callable
import html.parser
from formatter im... |
How do I add particular images which is situated in given url, in my app , can I do it in glade?
This works for me:
from gi.repository import Gtk
class Handler:
def on_window1_delete_event(self, *args):
Gtk.main_quit(*args)
def change_image(image):
the_image = builder.get_object("replaceimage")
the_... |
sosmayo
[Résolu]Udev HDMI pulseaudio changement automatique de la sortie audio
Bonjour à tous !
Il y a quelque temps j'ai partagé une petite astuce permettant de rediriger automatiquement le son vers HDMI lorsque celui ci est branché http://forum.ubuntu-fr.org/viewtopic.php?id=1119211.
Cependant depuis une mise à nivea... |
I'm having a bad time with date parsing and formatting today.
Points for somebody who can parse this date format into a datetime.date or datetime.datetime (I'm not too fussy but I'd prefer .date):
5th November 2010
Using dateutil:
In [2]: import dateutil.parser as dparser
In [3]: date = dparser.parse('5th November 2010... |
Hi all,
new here
i have this python function
def gtest(request):
p = request.POST
print p
g = p['information']
print g
to_json = {
"key1": "value1",
"key2": "value2"
}
jsonValidateReturn = simplejson.dumps({"jsonValidateReturn": "ddddd"})
return HttpResponse(jsonValidateRe... |
pontiac76
[résolu]Google Ok mais pas internet avec Ubuntu 12.04
Bonjour,
J'ai posté hier un message à propos de mon impossibilité d'aller sur internet sauf sur sur google avec mon installation toute neuve d'Ubuntu 12.04 LTS sur un second disque dur de mon pc fixe.
Devant l'absence de réponse, j'ai relu les règles du fo... |
Sissio
Boot kernel 3.5.0-17
Bonjour,
Ce matin j'ai eu la mise à jour du kernel en version 3.5.0-17 sur voyager 12.04 Lts.
Lors du reboot l'animation de démarrage se charge correctement et avant d'arriver sur le bureau cela reste figé et je perd totalement la main car même le clavier ne répond plus.
La seule solution qu... |
I've made a class containing a list, with the following code:
class ProdReg:
def __init__(self):
self.__Pliste=[]
This works perfectly. I've also added a method to print the contents of my list:
def printProdReg(self):
for produkt in self.__Pliste:
print(produkt)
This doesn't work all to great, When... |
Using Django and MongoDB to Build a Blog
4) Add the name of the LJblog app to the list of the INSTALLED_APPS in theLJ/settings.py file. If you do not install the app, you will not beable to use it. So, the INSTALLED_APPS variable should have the followingvalues:
INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib... |
Is there a quick way of replacing all NaN values in a numpy array with (say) the linearly interpolated values?
For example,
[1 1 1 nan nan 2 2 nan 0]
would be converted into
[1 1 1 1.3 1.6 2 2 1 0]
Lets define first a simple helper function in order to make it more straightforward to handle indices and logical indices ... |
I've just installed Ubuntu 13.04 on my MacBook Air, after toying around for awhile the machine felt really slow, so I checked out the CPU frequency. cpufreq-info, it reports 800MHz on all 4 cores (which is the lowest setting). The governor is set to ondemand. Now when I put some load on the system (running a small scri... |
Ce cours est visible gratuitement en ligne.
Ce cours existe en livre papier.
Ce cours existe en eBook.
Vous pouvez obtenir un certificat de réussite à l'issue de ce cours.
J'ai tout compris !
Voici enfin le moment de la pratique. Vous avez appris pas mal de choses dans cette partie, beaucoup de concepts, souvent théori... |
pittsburgh nosql _ mapreduce
By bearrito
Barrett Strausser
@FuncBearrito
sudo vi ~/.bashrc || sudo vi ~/.bash_profile
export EC2_HOME = ...export EC2_PRIVATE_KEY=pk-foo.pemexport EC2_CERT=cert-foo.pem
export EC2_KEYPAIR=...export EC2_URL=...
$sudo apt-get install python,pip$pip install boto
Machine-1 2012-11-28 22... |
by Cameron Laird and Boudewijn Rempt
07/07/2000
Editor's note -- Seldom do I run across an article on application development that is just plain fun. I have one here. There are four characters in this story talking about the Qt authoring environment: Cameron Laird, Boudewijn Rempt, Thomas, and Paul. Cameron and Boudewi... |
I'm trying to use python to parse a log file and match 4 pieces of information in one regex. (epoch time, SERVICE NOTIFICATION, hostname and CRITICAL) I can't seem to get this to work. So Far I've been able to only match two of the four. Is it possible to do this? Below is an example of a string from the log file and t... |
#0 Re : -1 » Qarte arte.tv browser (ex Qarte+7) » Le 31/07/2013, à 23:04
#1 Re : -1 » Qarte arte.tv browser (ex Qarte+7) » Le 01/08/2013, à 11:11
#2 Re : -1 » [RESOLU] Utiliser captvty sous wine » Le 28/10/2013, à 21:34
ET01
Réponses : 207
Bonjour,
@bibichouchou
J'ai suivi tes instructions. Cela ne marche pas. J'obtien... |
ljere
Re : ModCustom personnaliser un LiveCD base Ubuntu
modération: page débloqué
Hors ligne
frafa
Re : ModCustom personnaliser un LiveCD base Ubuntu
Merçi !
Hors ligne
melodie
Re : ModCustom personnaliser un LiveCD base Ubuntu
Bonjour,
Après avoir ajouté "maybe-ubiquity" sur la ligne de txt.cfg comme tu me l'as indiq... |
Trudy
Résolu ! Ouvrir fenêtre Dépôts
Bonjour, Je voudrais savoir comment ouvrir la fenêtre Dépots, si je ne l'ai pas dans Système-Aministration ... Merci pour vos réponses !
Dernière modification par Trudy (Le 04/12/2005, à 15:57)
Hors ligne
Express
Re : Résolu ! Ouvrir fenêtre Dépôts
Ca s'appel "Gestionnaire de paquet... |
I have to rewrite some Python Code, so that it is compatible with Python 3. Unfortunately one of my files imports Numpy, which isn't available for Python 3, yet. So I am trying to replace the Numpy-Code with normal Python Code. But I fail to replace Numpy's reshape-function. Reshape takes an array as input and reshapes... |
I would like to know how to calculate the bit-strength of Integer Factorization Cryptography (IFC) such as RSA by using Python. I gathered it is based off the complexity of factorizing the modulus (public key). I want to be able to calculate the bit strength of arbitrary key-lengths of RSA for example, such as 4096 whi... |
Python doesn't have (or need) "parameterized classes", so it's hard to provide examples of them in Python;-). A metaclass is simply "the class of a class": normally type (as long, in Py2, as you remember to make the class new-style by inheriting from object, or some other built-in type or other new-style class -- old-s... |
I'm just wondering if there is a way (maybe with regex) to validate that an input on a Java desktop app is exactly an string formated as: "YYYY-MM-DD".
I've searched but with no success.
Thank you
Use the following regular expression:
^\d{4}-\d{2}-\d{2}$
as in
if (str.matches("\\d{4}-\\d{2}-\\d{2}")) {
...
}
With... |
Fabric: a System Administrator's Best Friend
The Basics
Now that you understand the groundwork of Fabric, you can start puttingit to use. For this article, I explain how to make asimple fabfile for the purpose of installing/removing software and yourmachines. First, you need what is called a fabfile. The fabfilecontain... |
Fabric: a System Administrator's Best Friend
The Basics
Now that you understand the groundwork of Fabric, you can start puttingit to use. For this article, I explain how to make asimple fabfile for the purpose of installing/removing software and yourmachines. First, you need what is called a fabfile. The fabfilecontain... |
DJ Raging-Bull
Carte PCMCIA WiFi non détecté sur ThinkPad 600X
Bonjour,
J'ai récuperé un IBM ThinkPad 600X équipé d'un Penium III @ 500 MHz et de 446 Mo de RAM, le disque dur fait environ 12 Go et il dispose d'un lecteur CD.
J'aimerais le refiler à ma mère qui s'en servirait pour de la bureautique de base. Je lui ai do... |
I have a report model looking a bit like this:
class Report(models.Model):
date = models.DateField()
quantity = models.IntegerField()
product_name = models.TextField()
I know I can get the last entry for the last year for one product this way:
Report.objects.filter(date__year=2009, product_name="corn").ord... |
Topic: [HOWTO] Configure Mailman on CentOS/RHEL 5
Follow this configurations after installing iRedMail & Mailman.
* below method was only tested with iRedMail 0.6.1 & 0.7.0
Assumptions:
- Your server's FQDN is mail-server.mydomain.com
- iRedMail & Mailman installed on the same server
/etc/httpd/conf.d/mailman.conf
# Re... |
nathéo
Re : /* Topic des codeurs [8] */
Arf, j'ai oublié de traiter son cas je crois.
C'est rarement par le sarcasme qu'on élève son âme.Le jus de la vigne clarifie l'esprit et l'entendement.
De quoi souffres-tu ? De l'irréel intact dans le réel dévasté ?
N'oubliez pas d'ajouter un [RESOLU] si votre problème est réglé.... |
Month of Volatility Plugins
Today's post will cover a Shellbags plugin for Volatility that is currently a work in progress and will be included in Volatility 2.3.
Background
"Shellbags" is a commonly used term to describe a collection of registry keys that allow the "Windows operating system to track user window viewin... |
When running a large number of tasks (with large parameters) using Pool.apply_async, the processes are allocated and go to a waiting state, and there is no limit for the number of waiting processes. This can end up by eating all memory, as in the example below:
import multiprocessing
import numpy as np
def f(a,b):
... |
I'm relatively new to Python, cgi, and passenger-wsgi, so please bear with me.
I set up a python script that's not much more than
import time
startTime = time.time()
def main():
return time.time()-startTime
.. just so I know how long the passenger server has been running. I did this a few days ago, but it's only ... |
You are confusing setName and setResultsName. setName assigns a name to the expression so that exception messages are more meaningful. Compare:
>>> integer1 = Word(nums)
>>> integer1.parseString('x')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\python26\lib\site-packages\pyparsing... |
Although this won't exactly answer your question, it may help you debug the problem yourself.
The error is this :
ImportError: /usr/lib/libportmidi.so.0: undefined symbol: snd_seq_event_input_pending
The undefined symbol is a failure of the dynamic linker to find the code required for the snd_seq_event_input_pending f... |
The algorithm sorts all the numbers except the first one, and sets it as last. Please help!
def bubbleSort(numbers): # Bubble Sort Algorithm
numbers = list(numbers)
i = 0
j = 0
for i in range(len(numbers)):
for j in range(len(numbers) - i):
if numbers[j] < numbers[j-1]:
... |
My main problem is that i have just acquired an ASUS laptop with WINDOWS 7 and I want to install Ubuntu on it.
I want to have a dual boot to choose between both Operating systems, I read that it's better to first install Windows and then Ubuntu, because Windows installer overwrites Ubuntu's boot loader.
So, i tried to ... |
Hello I'm a newbie with Python but I've been interested on it for 2 years. I want to make robots and I'm trying to use Python with pyserial on blender. But I found a problem and after 2 hours of looking for the answer in Google and in this site I found that maybe I'm retarded because I can't solve it. I think it isn't ... |
sefiane
[résolu] Logithèque / Synaptic
Salut !
J'ai besoin de votre aide S.V.P !
Je suis débutant dans Linux , j'ai la version 12.O4 ATS.
Il fonctionnait très bien sans problème, une fois additionner Synaptic, Logithèque ne voulait pas répondre ! Il plantait, lorsque je fermais, une fenêtre apparaît, " logithèque ne ré... |
I have "upgraded" (clean iinstall) mythbuntu with mythtv 0.27. When it scans for new music it crashes the frontend:
Nov 23 12:57:01 mythserver01 mythfrontend.real: mythfrontend[3375]: I CoreContext main.cpp:227 (runScan) Scanning '/var/lib/mythtv/music/' for music files
Nov 23 12:57:14 mythserver01 mythfrontend.real: m... |
I'm trying to port a python application to jython and have run into a problem where jython cannot import kombu (which is used prominently in the original python app).
I have installed kombu via pip (and even tried the -U option to get the most recent version):
sudo pip install -U kombu
Downloading/unpacking kombu
Dow... |
I can't seem to be able to decode UCS-2 BE files (legacy stuff) under Python 3.3, using the built-in open() function (stack trace shows UnicodeDecodeError and contains my readLine() method) - in fact, I wasn't able to find a flag for specifying this encoding.
Using Windows 8, terminal is set to codepage 65001, using 'L... |
I use a 3rd party tool that outputs a file in Unicode format. However, I prefer it to be in ASCII. The tool does not have settings to change the file format.
What is the best way to convert the entire file format using Python?
You can convert the file easily enough just using the
>>> title = u"Klüft skräms inför på... |
It's not clear whether your requirements allow any user to approve a document, but I'm inferring that this is the case based on your models. If a Document can only be approved by a specific user, or set of users, or if a document is approved by multiple users, you will need to make some substantial changes to your mode... |
I need to run and print a Access report via vbscript or a command line. I have looked in many places but I remain lost. I need to do this for automation purposes.
Looking at How to use command-line switches in Microsoft Access, I don't see an option to open a specific report from the command line. However, you could do... |
I am trying to read a spreadsheet from app engine using text_db and authsub.
I read http://code.google.com/appengine/articles/gdata.html and got it to work. Then I read http://code.google.com/p/gdata-python-client/wiki/AuthSubWithTextDB and I tried to merge the two in the file below (step4.py) but when I run it locally... |
C++ could be interpreted like python, and python could be compiled like C++. The thing is, interpreted C++ would be quite a bit slower than compiled C++ (though some debuggers will interpret C++) and compiled python wouldn't be much faster.
The real difference between the languages is how fast the resulting code is.
C+... |
You could create a urllib2 opener which can do the validation for you using a custom handler. The following code is an example that works with Python 2.7.3 . It assumes you have downloaded http://curl.haxx.se/ca/cacert.pem to the same folder where the script is saved.
#!/usr/bin/env python
import urllib2
import httplib... |
I'm using the mock-0.6 library from http://www.voidspace.org.uk/python/mock/mock.html to mock out a framework for testing, and I want to have a mock method return a series of values, each time it's called.
Right now, this is what I figured should work:
def returnList(items):
def sideEffect(*args, **kwargs):
for i... |
pontiac76
[résolu]Google Ok mais pas internet avec Ubuntu 12.04
Bonjour,
J'ai posté hier un message à propos de mon impossibilité d'aller sur internet sauf sur sur google avec mon installation toute neuve d'Ubuntu 12.04 LTS sur un second disque dur de mon pc fixe.
Devant l'absence de réponse, j'ai relu les règles du fo... |
#0 Re : -1 » Problème mot de passe admin - commande passwd ne fonctionne pas » Le 19/12/2012, à 11:30
barda_ehmos
Réponses : 6
Il m'est arriver quelque chose d'équivalent il y a quelques mois.
Voici le lien du sujet, si cela ne marche pas, il faut attendre sagement quelqu'un de plus expérimenté:
http://forum.ubuntu-fr.... |
Somebody please explain me the Miller Rabin Primality test
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Humanity is still kept intact. It remains within... |
I am using cherrypy as a webserver. It gives good performance for my application but there is a very big problem with it. cherrypy crashes after couple of hours stating that it could not create a socket as there are too many files open:
[21/Oct/2008:12:44:25] ENGINE HTTP Server
cherrypy._cpwsgi_server.CPWSGIServer(('0... |
I just got a server running with ubuntu on it for the first time, I connect with ssh. I am a mac user, learning ubuntu. The idea is to automate some tasks on the server. One of these tasks involves doing some tests with selenium through python. I need to get firefox to work in order to use the driver. I always get this... |
I'd like to call all methods of a python object instance with a given set of arguments, i.e. for an object like
class Test():
def a(input):
print "a: " + input
def b(input):
print "b: " + input
def c(input):
print "c: " + input
I would like to write a dynamic method allowing me to r... |
Based on the documentation of GtkTextTags which are used in GtkTextBuffers, there should be a way to stretch or condense text just like underlining text or making it bold.
I have tried this (see example below), but it is not working for the stretching part. I have read somewhere, however, that the font has to support t... |
Use python and str.encode|decode functions.
>>> a="γεια"
>>> a
'\xce\xb3\xce\xb5\xce\xb9\xce\xb1'
>>> b='\xce\xb3\xce\xb5\xce\xb9\xff\xb1' # note second-to-last char changed
>>> print b.decode("utf_8")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.5/encoding... |
I have a fresh ubuntu 12.04 installation. When i connect to my remote server i got errors like this:
~$ ssh example.com sudo aptitude upgrade
...
Traceback (most recent call last):
File "/usr/bin/apt-listchanges", line 33, in <module>
from ALChacks import *
File "/usr/share/apt-listchanges/ALChacks.py", line 32... |
Updated and restructured by Jim Mock. Originally contributed by Jake Hamby.
ConfigureKernel
Configuring the DragonFly Kernel
The kernel is the core of the DragonFly operating system. It is responsible for managing memory, enforcing security controls, networking, disk access, and much more. While more and more of Dragon... |
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... |
hi I am using Jtidy parser in java.
URL url = new URL("http://l1.yimg.com/t/frontpage/baba-ramdev-310511-60.jpg");
Image image = new ImageIcon(url).getImage();
int imgWidth = image.getWidth(null);
int imgHeight = image.getHeight(null);
Above code is working fine,I am getting height & width properly.But I want to see... |
I have a directory that contains directories like /sample1, /sample10, /sample11 etc.when I am using os.walk to access all of them one by one, I am facing some difficulties.
for root, dirs, files in os.walk(mypath):
if 'sample1' in root:
print root
now, this returns all root /sample1, /sample10, /sample11 e... |
I've created a sample Asp.Net MVC 4 application where I've used D3.js to append an SVG element and then inside the SVG I've appended a text element (see code below). This all works fine until I try to append an img to the SVG using a local png file. The img gets appended to the DOM, but the img is not rendered on the p... |
Tagged: background image, Changing contact form input fields color, cufon, cufon issue, floating footer, header fonts not consistent accross browsers and comput, Login link, mp3-jplayer, multiple languages, Raleway font, theme graphics
AuthorPosts
February 28, 2012 at 5:33 pm #9784
Hey Kriesi,
First of all, let me cong... |
bowmore
Problème avec une HP Color LaserJet 4550N branchée en Ethernet .
Bonjour à tous.
J'essaye depuis quelques jour de faire fonctionner une imprimante HP Color LaserJet 4550N branchée en Ethernet sur un PC sous Lubuntu 12.04.
N'ayant pas de port USB sur l'imprimante, ni de port série sur ma carte mère, je n'ai que ... |
The Atom API
Atom is an up-and-coming format for editing, syndicating, and archiving weblogs and other episodic web sites. The final details are still being hashed out, but that's never stopped me before, having written several articles about XHTML 2. To understand the problems that Atom is designed to solve, we should... |
I've been trying (and failing) to figure out how to send email via Python.
Trying the example from here: http://docs.python.org/library/smtplib.html#smtplib.SMTP
but added the line server = smtplib.SMTP_SSL('smtp.gmail.com', 465) after I got a bounceback about not having an SSL connection.
Now I'm getting this:
Traceba... |
A walkthrough on how to manage Unicorn worker processes using Monit
Riding Unicorns
For many reasons I like using Unicorn as a web server for Ruby apps. Ryan Tomayko wrote a great article and the many Unix features that it has. It has the killer feature of supporting hot restarts so you can deploy new releases with zer... |
I have a set of data that I am trying to fit to an ODE model using scipy's leastsq function. My ODE has parameters beta and gamma, so that it looks for example like this:
# dS/dt = -betaSI
# dI/dt = betaSI - gammaI
# dR/dt = gammaI
# with y0 = y(t=0) = (S(0),I(0),R(0))
The idea is to find beta and gamma so that the nu... |
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...
~14 users here now
News and links for Django developers.
Slicing mp3 files? (self.django)
submitted 9 months ago by ... |
There is a Fourier transform method here. Using the example from belisarius it might be done as below. Caveat: I do not guarantee I made no cut-and-paste errors. Your mileage may vary. Considerably.
(* sample data *)
g[x_] := x + 1/2 Sin[x] + RandomVariate[NormalDistribution[.2, .05]];
SeedRandom[1111];
xmax = 8*Pi;
nH... |
I'm working on a project in which I'm supposed to build a Data Webhouse using as input a clickstream from an e-commerce store
In the clickstream we have a number that identifies the user (named 'loc_id'), his IP address, cookie (named "us") and the products he's clicked on, all in a txt file.
Since we''ll need to study... |
I am somewhat new to DSP. I'm trying to implement BPSK by following this Python QAM tutorial.
My code seems to work, but I really just ported the tutorial's Python code to C++, and do not understand it. This is the part that confuses me the most:
# Demodulate in "real" and "imaginary" parts. The "real" part
# is the co... |
evann83
Mode superutilisateur
Bonjour
Me voici avec un soucis que je n'arrive pas a résoudre:
j'aimera utiliser la commande "javac" pour pouvoir compiler un fichier java sur mon bureau mais apparement il n'a pas envie puisque il me demande d'installer la JDK, logique je me suis dis après coups. Me voilà parti pour inst... |
when trying to build indexes for elasticsearch on django-haystack, i get the error (full traceback below)
TypeError: index_queryset() got an unexpected keyword argument 'using'
It is on Python 2.6, Django 1.4, ElasticSearch 0.20.2. Previously i have encountered a similar prefetch error, which was the case of version m... |
Linux-based container infrastructure is an emerging cloud technology based on fast and lightweight process virtualization. It provides its users an environment as close as possible to a standard Linux distribution. As opposed to para-virtualization solutions (Xen) and hardware virtualization solutions (KVM), which prov... |
I have two lists
a: a, b, c, d, eb: blue, white, brown, yellow, red
I need a to become blue's key in a dictonary, so i need to do this:
dictonary[a]="blue"
but how do I do it using the same for...
Use
dict(zip(a, b))
Because the
If you actually want to loop over the lists concurrently, you can loop over indices:
dicti... |
I hope this captcha is not used anywhere.
Following is a dummy way to decode it. Basically what you need are the patterns from 0 to 9 as present in these captchas. From your examples, I have only the patterns for 0 3 4 5 7 8. Since everything is fixed on them, you know where to split each character. You also know each ... |
Using a pseudo random number generator (PRNG) even a simple one with a low weight seed is definitely NOT a a good solution. The PRNG do not keep the Hamming weight of the seed constant, and the whole idea of a PRNG is to remove the information of the seed.
If you want to have exacly bits sets to 1 out of n, your questi... |
If running the script results in a [Errno 111] Connection refused error such as this:
% test.py
E
======================================================================
ERROR: test_test (__main__.test)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/hom... |
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 a parity matrix ("H") that is not in canonical form (the identity matrix is not on the right side).
I'm trying to programatically calculate the generator matrix ("G") from it.
The Wikipedia entry on Hamming codes talks about the relationship between parity check matrixes and generator matrixes:
It says that H*tr... |
I am trying to authenticate users of my Django application into Facebook via the oauth2 Python package.
def myView(request):
consumer = oauth2.Consumer(
key = settings.FACEBOOK_APP_ID,
secret = settings.FACEBOOK_APP_SECRET)
# Request token URL for Facebook.
request_token_url = "https://www.facebook.co... |
Try adding in some windows using glade:
Open up a terminal, go to your project directory and type "quickly edit" - That will launch glade (gui designer) and it will automatically load in your project's ui files. In glade you can add windows by going to the Toplevels area on the left side and choosing which type of wind... |
WebLogic Scripting Tool
WLST enables you to create a new domain or update an existing domain without connecting to a running WebLogic Server (that is, using WLST offline)—supporting the same functionality as the Configuration Wizard.
You can create new configuration information, and retrieve and change existing configu... |
I am trying to pass a few variables but I am having some trouble and specifically have 3 questions. How do I encode the url string to take into account the special characters in the string? What is the correct regex I should use given the strings? And how do I decode the urls that have been encoded?
view
author = 'foo'... |
When I store a content with an integer value as a string, when I retrive it it's suddenly an int.
So here is what I'm seeing: I store with this
db = get_db()
hello = escape(str(request.form['name'])).striptags()
what = escape(str(request.form['content'])).striptags()
db.execute('''insert into entry (
title, content, sc... |
Max 6.0.1 Download Server Error
I am trying to download the current version of Max6 and I’m getting a python server error when it sends me to the link, http://www.filepivot.com/projects/maxmspjitter/files/latest6_mac
Attached is the error.
Traceback (most recent call last):
File "/base/python_runtime/python_lib/versi... |
Am a newbie in TastyPie. I have a very simple resource and am overriding the obj_create method in following way.
Ajax Call :-
var data2 ={
"crave": data1,
"uid": "100",
"access_token": "AAA"
}; ... |
When testing my django website by python manage.py runserver 0.0.0.0:8000, there is no error.
But if I deploy it to production with apache and mod_wsgi, it reports error cannot import name connection.
I find some other questions like django 1.4 database router - "cannot import name connection" suggesting adding from dj... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.