text stringlengths 256 65.5k |
|---|
Commercial Services ✈ Flight Status API / Flight Tracking API / FlightAware API ✈ Documentation
FlightXML 2.0 Documentation
About
Using the FlightXML API, programs can query the FlightAware live flight information and recent history datasets.
Queries for in-flight aircraft return a set of matching aircraft based on a c... |
#1001 Le 25/04/2010, à 17:05
oGu
Re : [ VOS SCRIPTS UTILES ] (et eventuelles demandes de scripts...)
Bonjour à tous !
Tout d'abord félicitations pour l'excellente tenue de ce forum et pour tous les scripts que j'ai piqué sur ce topic!!
Etant passé de Firefox à IceCat dernièrement, j'aimerais qu'un Ubuntero sachant scri... |
jQuery and Ajax
While web2py is mainly for server-side development, the welcome scaffolding app comes with the base jQuery library[jquery], jQuery calendars (date picker, datetime picker and clock), the "superfish.js" menu, and some additional JavaScript functions based on jQuery.
Nothing in web2py prevents you from us... |
How Shellcodes Work
by Peter Mikhalenko
05/18/2006
It's not an easy task to find a vulnerable service and find an exploit for it. It's also not easy to defend against users who might want to exploit your system, if you are a system administrator. However, writing an exploit by yourself, to convert a news line from bug ... |
nknico
Un nouveau dépôt officiel pour Ubuntu (logiciels commerciaux)
Un nouveau dépot officiel vient d'ouvrir. Il contient des logiciels commerciaux. Pour l'instant Opéra et Realplayer sont disponibles.
En gros, pour l'installer, il faut:
* Activer les mises a jour de dapper
* Mettre a jour sa dapper :-)
* Via gnome-ap... |
I have a script where I ask the user for a list of pre-defined actions to perform. I also want the ability to assume a particular list of actions when the user doesn't define anything. however, it seems like trying to do both of these together is impossible.
when the user gives no arguments, they receive an error that ... |
Servicios
El W3C define los servicios web como "sistema de software destinado al soporte de interacción máquina-a-máquina en forma interoperable sobre una red". Esta es una definición muy general, e implica una gran cantidad de protocolos destinados a las comunicaciones máquina-a-máquina, no a máquina-a-persona, como p... |
I have been writing a class that encrypts and decrypts with block ciphers. I want to use Counter Mode(CTR/CM). We know that Counter Mode generates a keystream basing on counters, then XOR the keystream with plaintext to produce ciphertext. So, one can decrypt as long as he can reproduce the keystream, that is, to repro... |
Azerty46
Problème de démarrage et mise en veille
Bonsoir,
au démarrage de l'ordi, il me demande de choisir parmi plusieurs options:
ubuntu avec Linux 3.2.0-37-generic
ubuntu avec Linux 3.2.0-37-generic (mode de dépannage)
Previous Linux Versions
Memory test (86+)
Memory test (86+, serial console 115200)
Je lui demande ... |
Bybeu
[résolu] Problème veille carte nvidia 4200 nvidia96
EDIT 27 mars 2013: j'ouvre un nouveau fil ici: http://forum.ubuntu-fr.org/viewtopic.php?id=1210781
Bonjour
Mon portable 12.04 plante en sortie de veille;
J'ai essayé
sudo s2ram -n
Machine matched entry 222:
sys_vendor = 'Dell Computer Corporation'
sys_... |
Other recipes
Upgrading
In the "site" page of the administrative interface there is an "upgrade now" button. In case this is not feasible or does not work (for example because of a file locking issue), upgrading web2py manually is very easy.
Simply unzip the latest version of web2py over the old installation.
This will... |
Well, I think this is the most suitable site to ask about this. I want to know a verse which includes "a-z" english characters in whatever english Bible versions because I want to show it on a dialog of an android Bible app I'm making now (unless the verse is negative).
Thansk you in advance.
This is off-topic, but for... |
Web client programming is a powerful technique for querying the Web. A web client is any program that retrieves data from a web server using the Hyper Text Transfer Protocol (the http in your URLs). A web browser is a client; so are web crawlers, programs that traverse the Web automatically to gather information. You c... |
I am trying to verify backup from ftp server using this command.
duplicity verify ftp://xxx.net@ftpback-bhs1-15.ip-198-100-151.net/ /home
I am getting this error
Difference found: File home/nginx has permissions 0:0 700, expected 500:500 700
Difference found: File home/nginx/domains has permissions 0:0 700, expected 5... |
A job is a Python object, representing a function that is invokedasynchronously in a worker (background) process. Any Python function can beinvoked asynchronously, by simply pushing a reference to the function and itsarguments onto a queue. This is called enqueueing.
To put jobs on queues, first declare a function:
imp... |
Now that you all helped on the query as in below. How can I get the total time hh:mm:ss and get the average of it?
SELECT CONVERT(varchar(8),cast(
cast(
substring(right('000000'+cast(rptime as varchar),6),1,2)
+ ':' +
substring(right('000000'+cast(rptime as varchar),6),3,2)
+ ':' +
... |
I found really good example how to add new method to the class dynamically (transplant class):
def say(host, msg):
print '%s says %s' % (host.name, msg)
def funcToMethod(func, clas, method_name=None):
setattr(clas, method_name or func.__name__, func)
class transplant:
def __init__(self, method, host, method_na... |
It looks like you want to replace everything with the same string, but the code below is easily adaptable to other cases but I go with it for now.
To simplify I am assuming that you want to replace words and the words are only seperated by spaces (' ').
First make a dictionary out of the Items in the listbox:
dim dict ... |
smo
Re : logiciel creation/remasterisation/clonage de distributions base ubuntu
mwoe effectivement y s arrete direct y cree pas les fichiers et sort... je regarde
ht5streamer, streaming youtube/dailymotion...: http://forum.ubuntu-fr.org/viewtopic.php?id=1299461 / http://ht5streamer.free.fr
ubukey, createur ubuntu custo... |
Audiofeeline
Modifier GRUB avec GRUB CUSTOMIZER
Bonjour à tous,
alors que je surfais paisiblement, je suis tombé sur un article de Tux-Planet qui présente GRUB CUSTOMIZER : http://www.tux-planet.fr/grub-customizer/
Je tenais à vous en faire part car ça faisait un petit moment que je cherchais une telle solution.
Bien à... |
buffers name conflicting in instatiations of same device
hi guys.. I created a maxforlive device that uses a mechanism close to the sineqube sapling 1.1 MaxMSP standalone.. so, now I would like to add the capability to the patch to add simoultaneous intances to a live session.. but there is one small problem. In MaxMSP... |
Is there any proof of infinitude of A007500 primes?
If you want to generate them here is trivial and naive python program.
def is_prime(n):
i = 2
while i*i <= n:
if n%i == 0:
return False
i = i + 1
else:
return True
print [x for x in range(1,200) if is_prime(x) and is_pri... |
I am creating many figures for my LaTeX document using matplotlib with 'text.usetex': True.
My full preamble looks like this:
rc('font', **{'family':'serif', 'serif':['Computer Modern Roman']})
params = {'backend': 'pdf',
'axes.labelsize': 12,
'text.fontsize': 12,
'legend.fontsize': 12,
... |
I often hear from statistical experts (including on this site) that simulation is the preferred method to calculate power for a clinical trial (rather than using traditional sample size calculation formulae).
I use Stata, and I was wondering if anyone can show me how to do this in detail?
For example, two scenarios:
1)... |
I'm new to Python and WX. I created a simple test dialog shown below that prompts the user with a combobox. I would like to capture the value from the combox in my main program. How do I call it from my main program?
This is how I was purposing to call it that displays the dialog but does not currently capture the valu... |
toma222
[HOW TO] adesklets : installation sous Ubuntu Dapper et Edgy
Il existe désormais un article sur le wiki concernant Adesklets donc je vous conseille de vous y fier, ce tutoriel n'étant plus mis à jour.
Je poste ce sujet en complément du sujet sur l'installation de adesklets sous Breezy.
Je ne reviendrais pas sur... |
The Python garbage collector is useful for collecting reference cycles, but objects are collected by default when their reference count reaches 0, so, most of the time objects will be collected properly and the collector is only useful when you have a cycle.
Also, there's no guarantee when it'll bump in to do a collect... |
Here is the simple code which generates and saves a plot image in the same directory as of the code. Now, is there a way through which I can save it in directory of choice?
import matplotlib
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(range(100))
fig.savefig('graph.png')
|
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... |
loubrix
[RESOLU] sources.list bizarre...
Bonsoir,
après une mise à jour normale, faite dans la journée, je me suis aperçu que j'avais un triangle jaune dans le systray, avec un message "les informations de mise à jour sont obsolètes. Ceci est peut-être du à un problème sur le réseau ou à un dépot qui n'est plus disponi... |
I have Mathematica code that uses Import[] to download URLs. I noticed that first time I use the Import[] command it works. Next time it fails. I'm using Windows 7, Mathematica 8.0.4.
Here is an example. I start new sesssion of Mathematica, and then type
Import["http://groups.google.com/group/comp.soft-sys.math.mathema... |
To understand what yield does, you must understand what generators are. And before generators come iterables.
Iterables
When you create a list, you can read its items one by one, and it's called iteration:
>>> mylist = [1, 2, 3]
>>> for i in mylist:
... print(i)
1
2
3
Mylist is an iterable. When you use a list comp... |
I'm working on an A* search algorithm implemention and this is what I came up with for the open list:
from heapq import heappush, heappop
class OpenList(set):
'''
This uses a heap for fast retrieval of the node with the lowest path score.
It also uses a set for efficiently checking if a node is contained.
... |
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é ... |
Hagar de l'Est
[How-To] Installer OpenOffice.org avec les RPMs officiels
Si vous n'avez pas la patience d'attendre que les dépôts soient mis à jour pour installer la dernière version d'OOo, voici la méthode manuelle à partir des RPMs officiels.
NB: avant d'installer, si vous avez modifié la configuration des dictionnai... |
The following code:
class House:
links = []
class Link:
pass
class Villa(House):
pass
if __name__ == '__main__':
house = House()
villa = Villa()
link = Link()
house.links.append(link)
print house.links
print villa.links
results in this output:
[<__main__.Link instance at 0xb65a4b0c>... |
I am looking for an automatic code translator for Matlab to Python.I downloaded and installed LiberMate but it is not documented anywhere and I wasn't able to make it work.
Has anybody dealt with this kind of challenge before? Any advice welcome.
I've done it manually. Check this.
You can also try to call your MATLAB c... |
Advanced OOP: Declarative Programming and Mini-Languages
by David Mertz
07/31/2003
This article extends my discussion of advancedprogramming, but strays into an area that is not exclusively objectoriented. What we are interested in for this installment is ways ofwriting programs that are declarative rather thanimperati... |
Installing PyGNOME
We, however, don't just want to develop applets; we want to do it with Python. For this, we need to install the PyGNOME package. PyGNOME gives you access to the GNOME development libraries through Python. We will start out by downloading and installing PyGNOME on your system.
You can get PyGNOME here... |
I have a Django 1.1.1 project that works fine. I'm trying to import it to Google App Engine.
I'm trying to follow these instructions.
I run it on the dev server, and I get an import error:
ImportError at /No module named mysite.urls
This is the folder structure of mysite/:
app.yaml<DIR> myappindex.yamlmain.pymanage.py<... |
What could generate the following behavior ?
>>> print str(msg)
my message
>>> print unicode(msg)
my message
But:
>>> print '%s' % msg
another message
More info:
my msgobject is inherited fromunicode.
the methods __str__/__unicode__/__repr__methods were overridden to return the string'my message'.
the msgobject was i... |
PotatoMasher
Re : Script d'installation pour imprimantes Brother
D'accord, alors j'ai retiré brscan2 de /etc/sane.d/dll.conf. brscan-skey -l donne toujours le même device, "Not Registered".
Après avoir jeté un coup d'oeil aux groupes, je réalise que mon utilisateur n'est pas membre du groupe "scanner" et du groupe "san... |
I'm certain my problem is due to my almost complete lack of understanding of LaTeX's expansion rules...
I wrote some code, which uses the SageTeX package to keep track of a list of answers to homework problems and then print them all at the end. Here is an example of part of it:
\begin{sagesilent}
class AnswerList:
... |
I'm trying to create a messaging system where a message's sender and recipients can be generic entities. This seems fine for the sender, where there is only object to reference (GenericForeignKey) but I can't figure out how to go about this for the recipients (GenericManyToManyKey ??)
Below is a simplified example. Per... |
“Press This” helps you reblog quotes, images, and more
WordPress includes a bookmarklet called “Press This” to speed up your work when including text, photos, and more from other sites on the internet. Check out how it’s done, below.
Fixing “Press This” 404 errors
Note: Many folks get 404 errors when trying this great ... |
sometimes when programming recursivly, you call the function with the same parameters multiple times which is unnecassary.
The famous example Fibonacci numbers:
index: 1,2,3,4,5,6...
Fibonacci number: 1,1,2,3,5,8...
function F(n) {
if (n < 3)
return 1
else
return F(n-1) + F(n-2)
}
Let's run F(4... |
Sure thing. It is a bit tricky to do this with LINQ but certainly possible using only the standard query operators.
UPDATE: This is the subject of my blog on Monday June 28th 2010; thanks for the great question. Also, a commenter on my blog noted that there is an even more elegant query than the one I gave. I'll update... |
tiramiseb
Re : configuration des DNS
S'il-te-plait, pour des citations utilise la balise "[ quote ]" et non la balise "[ code ]", c'est pénible de devoir défiler horizontalement pour lire les phrases que tu cites...
Hors ligne
kr2sis
Re : configuration des DNS
ça y est je sui perdu...:o
est ce qu'on peut faire doucemen... |
I am relatively new to ArcPy 10. and I want to return the list of feature class from a dataset. I can see them through the message, but cannot see them from the result window. Actually there are only inputs, environments and messages I can view from the results window. Am I missing something in the script? Thanks.
impo... |
Using matplotlib, I want to be able to specify exact colors with pcolormesh. Here is what I have tried
import numpy as np
from matplotlib import pyplot as plt
imports at the top
X = np.linspace(0,1,100)
Y = np.linspace(0,1,100)
X,Y = np.meshgrid(X,Y)
Z = (X**2 + Y**2) < 1.
Z = Z.astype(int)
Z += (X**2 + Y**2) < .5
se... |
If you are using Arcpy scripting, data lock issues have become even more problematic with 10.1.
If the locks are being created by your code, then you aren't cleaning up after yourself. Release all references to feature classes, workspaces, cursors, etc. The locks are removed when you have no more references to the obje... |
I'm New to Cuckoo Sandbox. Why am I getting this error? I don't understand. If there is something wrong, can anyone please explain how to setup Cuckoo Sandbox? My setup works very well before I submit any kind of malicious thing. I've been working on it for the last 5 days.
Thanks !
Cuckoo Sandbox 0.5
www.cuckoosandbox... |
i have created a simple module to store all my choices and reuse them in my application ( see CharField choices )
Here my project structure
project_name/ -- manage.py -- settings.py -- ...... -- apps/ -- __init__.py -- simple_app/ -- __init__.py -- models.py -- .... -- common/ -- __init__.py -- choices/ -- __init__.py
... |
What is the best JSON library to get JSON data for Django, 'simplejson' or otherwise?
thanks very much
Python 2.6 comes with a
Django itself integrates
from django.core import serializers
json_serializer = serializers.get_serializer("json")()
As Alex notes, the
The reason that you may want to use your own version is t... |
So I have followed This guide and used a simple printing python file. Problem is, when I run my dev_appserver.py file either through eclipse or in terminal i get the following errors:
/Desktop/%/google/google_appengine/dev_appserver.py
Traceback (most recent call last):
File "/Desktop/%/google/google_appengine/dev_ap... |
Archives for: 2007
Could someone explain this?
Code:
list = (
(0, 'foo'),
(1, 'bar'),
(2, 'baz'),
)
class Klass:
def bat(self):
print '-1'
for l in list:
if not hasattr(Klass, l[1]):
print '%s should print %d' % (l[1], l[0])
def _f(self):
print l[0]
_f.__d... |
I am really finding the django formsets confusing.
I am especially having problems with the following concepts which I don't really understand:
The formset is smart enough to ignore extra forms that were not changed.
Talking about code trying to be too smart. What is this supposed to mean exactly ? Why would I even wan... |
From reading the Celery documentation, it looks like I should be able to use the following python code to list tasks on the queue that have not yet been picked up:
from celery.task.control import inspect
i = inspect()
tasks = i.reserved()
However, when running this code, the list of tasks is empty, even if there are i... |
GDB testsuite makes a term process go bonkers. The testsuite is terminated. The term process remanins. Next, a new shell (bash) is started that connects to this term process -- and hangs.
Hung bash process (27834), term (22634).
# portinfo -t 22634 27834 5 => 58: receive 11 => 18: receive 21 => 53: receive 26 => 51: re... |
tiramiseb
Re : configuration des DNS
S'il-te-plait, pour des citations utilise la balise "[ quote ]" et non la balise "[ code ]", c'est pénible de devoir défiler horizontalement pour lire les phrases que tu cites...
Hors ligne
kr2sis
Re : configuration des DNS
ça y est je sui perdu...:o
est ce qu'on peut faire doucemen... |
Understanding Network I/O, Part 2
by George Belotsky
02/12/2004
With today's technology, creating your own Internet services can be a relatively easy, one-person project. You may not produce the next Google, but helping your business, not-for-profit organization, school, or friends with a useful Internet application is... |
mturkcore.py is now on Github: https://github.com/ctrlcctrlv/mturk-python
The current state of Mechanical Turk API’s for programming languages is somewhere between “horrible” and “confusing”. It is completely astounding to me how something as simple as a REST/SOAP webservice is confused so much in every single SDK I tr... |
gtk.gdk.Cursor — standard and pixmap cursors
class gtk.gdk.Cursor(gobject.GBoxed):
gtk.gdk.Cursor(cursor_type)
gtk.gdk.Cursor(display, cursor_type)
gtk.gdk.Cursor(display, pixbuf, x, y)
gtk.gdk.Cursor(source, mask, fg, bg, x, y)
def get_display()
A gtk.gdk.Cursorrepresents a bitmap image used for t... |
I have the following code
from bs4 import BeautifulSoup
from stripogram import html2text
import commands
import os
import urllib2
import sys
import re
import string
response = urllib2.urlopen(sys.argv[1])
html = response.read()
soup = BeautifulSoup(html)
outter = soup.find("div",{"id":"ps-content", "class":"bucket"})
f... |
I tried running this,
>>> urllib2.urlopen('http://tycho.usno.navy.mil/cgi-bin/timer.pl')
But it is giving error like this, can anyone tell me a solution ?
Traceback (most recent call last):
File "<pyshell#11>", line 1, in <module>
urllib2.urlopen('http://tycho.usno.navy.mil/cgi-bin/timer.pl')
File "C:\Python26... |
Using nltk on the AI-Class mini-shredder problem
The Free On-line Stanford AI Class didn’t have the programming problems that the in-person class did, due to lack of grading resources - but we did get a simple, optional, mini shredder challenge where it was suggested that we use NLP techniques to reassemble 19 vertical... |
In Python 2.6 and earlier, the dict constructor can receive an iterable of key/value pairs:
d = dict((key, value) for (key, value) in iterable)
From Python 2.7 and 3 onwards, you can just use the dict comprehension syntax directly:
d = {key: value for (key, value) in iterable}
Of course, you can use the iterable in a... |
Audiofeeline
Modifier GRUB avec GRUB CUSTOMIZER
Bonjour à tous,
alors que je surfais paisiblement, je suis tombé sur un article de Tux-Planet qui présente GRUB CUSTOMIZER : http://www.tux-planet.fr/grub-customizer/
Je tenais à vous en faire part car ça faisait un petit moment que je cherchais une telle solution.
Bien à... |
rezzakilla
Re : [Info] Installation du driver Libre ATI Radeon
Je dis ça comme ça...mais ça marche terrible sur ma 7500.....:D
Hors ligne
hugo69
Re : [Info] Installation du driver Libre ATI Radeon
ton tuto est dans la doc officielle mais ca naide pas beaucoup ma 9700ATI Hercules à fonctionner correctement.
Si je mets l... |
I am using Many-to-many relationships in my app and I am not able to feed data into the table which is by default created by the Django to ensure the Many-to-many relationships.It gives the error in method (def Set_Checkout_Attributes(request):) that 'Customer_check_attributes' object has no attribute 'set_customers' I... |
Update (May 2014): Please note that these instructions are outdated. while it is still possible (and in fact easier) to blog with the Notebook, the exact process has changed now that IPython has an official conversion framework. However, Blogger isn't the ideal platform for that (though it can be made to work). If you ... |
Visible Whitespace in Sublime Text 2
I have been using jshint in my node projects lately. Jshint is a linting tool based on JSLint by Douglas Crockford, the ghost whisperer of javascript and author of JavaScript: The Good Parts. I prefer JSHint as it is a little more configurable and I can fine tune it to what I care a... |
While it's not really in a workably stable state yet, have a look at the html5 canvas backend for matplotlib. It looks interesting, anyway, and will probably be the best way to do this sort of thing (interactive webpage with a matplotlib plot) in the future.
In the meantime, as @Mark suggested, it's not too hard to dyn... |
This program has been disqualified.
Author dllu
Submission date 2011-06-21 22:36:53.725321
Rating 8079
Matches played 695
Win rate 81.15
# WoofWoofWoof
# Woof Woof
# Woof Woof
# Woof Woof
# ... |
You can use xprop, available in the xorg-xprop package.
Just run xprop and select the password prompt window. As an example, xprop outputs the following information for my terminal emulator.
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLASS(STRING)... |
pingouinux
Re : [Résolu] ! Script pour noms de musique
Pour l'erreur du print :
lon=int(audio.info.length)
print(" %s (%s:%s)" % (audio['TIT2'], lon//60,lon%60))
Pour avoir les fichiers par ordre alphabétique :
for fic in sorted( glob.glob("*.mp3") ) :
Dernière modification par pingouinux (Le 09/10/2012, à 20:22)
Hor... |
You can have custom classes where my_var == None will return True
e.g:
class Negator(object):
def __eq__(self,other):
return not other
thing = Negator()
print thing == None #True
print thing is None #False
is checks for object identity. There is only 1 object None, so when you do my_var is None, you'... |
I've been recently having this issue with my internet connection on my MacBook Pro Early 2011 running OS X 10.8.3: from time to time the connection "freezes" for about 5 seconds and then comes back.
It happens both over Wi-Fi or over Ethernet cable, and
(it won't happen when running Windows 7 on the same machine, or on... |
Lossless transmultiplexing from one container to another
Adding/removing streams of a file without recompressing the other streams.
Lossless concatenation of compressed files
Changing metadata of files (i.e. mp3/vorbis tagging)
Quicktime has some codecs, which correspond to image formats (png, jpeg, tiff, tga). Support... |
#2201 Le 22/02/2013, à 08:17
jpdipsy
Re : [Conky] Alternative à weather.com (2)
Bonjour,
je n'apporterai pas d'aide sur les scripts, mais juste pour dire que chez moi l'intégration avec XplanetFX fonctionne parfaitement. Il y a juste un délai de quelques secondes pendant lequel la météo disparaît juste après sa mise à ... |
I'm looking to create the following JSON in Django (I'm working with a DataGrid):
{
identifier: 'id',
label: 'name',
items: [
{ id: 'AF', name:'Africa', type:'continent', population:'900 million', area: '30,221,532 sq km',
timezone: '-1 UTC to +4 UTC',
chi... |
BIND 9 is principally written in C, with some additional code written in Python, Perl and Bourne shell. Style guidelines for each of these are below.
An ANSI standard C compiler and library are assumed. Feel free to use any ANSI C feature.
Given a reasonable set of things to warn about (e.g. -W -Wall for gcc), the goal... |
Hacker School is a three-month self-directed environment for becoming a better programmer. I’m in the current batch.
Several of the current Hacker Schoolers expressed a desire to learn more about hardware hacking. @leocadiotine and I decided to spend an evening building a Raspberry Pi sensor interface project to show h... |
A final "s" in a word is usually pronounced \z\, so it is an interesting that the final "z" in "quartz" is pronounced \s\. (I mention interesting quirks like this to my ESL students.) I was wondering if there were any other instances like "quartz". If an on-line dictionary in ordered by the last letter of the word exis... |
I'm using the AppDelegate's default managedObjectContext, and when I executeFetchRequest on it, it never goes to the next line or crashes with an error. This is on a background thread, so the UI does not freeze, but the data is never populated -- my activity indicator never stops and my debugging tell me it never gets ... |
I have the following code for my Facebook Registration Social Plugin:
<iframe src="https://www.facebook.com/plugins/registration?
client_id=xxxxxxxxxxxxxxxx&
redirect_uri=http://www.pingxxxxxx.com/facebook_registration_plugin/fbwe/trial.php&
fields=[
{'name':'name'},
{'name':'email'... |
Hi a beginner in writing python scripts for Maya. I am trying to write a script that automates the process of opening a Maya file along with its references. Usually when the parent file and reference files are in different destinations Maya cannot open a file being referenced and you have to browse the filename to open... |
Conceptually, a class exists to define what a set of objects (the instances of the class) have in common. That's all. It allows you to think about the instances of the class according to that shared pattern defined by the class. If every object was different, we wouldn't bother using classes, we'd just use dictionaries... |
I'm trying to extract SQLAlchemy query parameter values for use in caching, using the function _params_from_query from the SQLAlchemy Beaker Caching example.
Unfortunately when I try it with a query involving a subquery, it seems to only traverse the main query parameters, ignoring the subquery.
The following example c... |
Module OneDMaps:
def LogisticMap(a,nIts,x):
for n in xrange(0,nIts):
return 4.*a*x*(1.-x)
Actual Program:
# Import plotting routines
from pylab import *
import OneDMaps
def OneDMap(a,N,x,f):
return x.append(f(a,N,x))
# Simulation parameters
# Control parameter of the map: A period-3 cycle
a = 0.98
# S... |
no_spleen
Re : Petit guide pour aider au choix d'un langage
Le fichier de maillage est trops gros à poster !
Hors ligne
tshirtman
Re : Petit guide pour aider au choix d'un langage
un code permettant de générer un fichier de ce type alors?
je vais regarder ton code voir si je voit quelque chose de choquant pour les perf... |
Edit: More specifically, I'm looking for an practical way to plot the shape of the zeros of a scalar function with 2 variables. So the values only need to precise up to the resolution of the 2D mesh grid I choose. e.g. f(x,y) = sqrt(x^2 + y^2) - 4 should give me a circle.
The problem is that fsolve requires a vector fu... |
I'm trying to use multiprocessing's Pool.map() function to divide out work simultaneously. When I use the following code, it works fine:
import multiprocessing
def f(x):
return x*x
def go():
pool = multiprocessing.Pool(processes=4)
#result = pool.apply_async(self.f, [10])
#print result... |
This is a Drupal website running Ubuntu 12.04 LTS on Linode. The server is just a website. It is not a DNS server or anything else.
Here are my issues. It seems they are all related to DNS issues. (I've been troubleshooting this with Linode for a couple days and I also got help here regarding iptables. Now I can focus ... |
Here's a Python thing I found on www.nerdparadise.com:
import random
def find_pi():
hits = 0
trials = 0
while 1:
x = random.random()
y = random.random()
trials += 1
if x * x + y * y < 1:
hits += 1
if trials % 100 == 1:
print hits * 4.0 / trials
find_pi()
Yay Pi!
I'm currently making one that uses th... |
A few days ago, I have published a tutorial on building a Connector/C++ client application on Windows using Visual Studio. Its time for a Linux How-To. My I-Do-Everything (IDE) choice on Linux is NetBeans 6.5. NetBeans is open-source and free. A version with C and C++ support is lightweight (24MB download) and the code... |
I finally started using Bartender to organize my menu bar apps. I had resisted because I don’t use many menu bar apps and didn’t really feel the need to hide any. But Bartender provides a service that’s more important than hiding icons: it allows you to arrange the menu bar icons in the order you want and keeps them th... |
I've looked at the relevant section of the Piston documentation, but it only seems to focus on how to turn it on, not what it would look like for clients or how to test it to verify it's working. The example only seems to use HTTP Basic and curl. Finally, Ned Batchelder's question makes it look like a tutorial is in or... |
Hagar de l'Est
[How-To] Installer OpenOffice.org avec les RPMs officiels
Si vous n'avez pas la patience d'attendre que les dépôts soient mis à jour pour installer la dernière version d'OOo, voici la méthode manuelle à partir des RPMs officiels.
NB: avant d'installer, si vous avez modifié la configuration des dictionnai... |
Logging
Other languages: français | ...
Problem:
You want to control logging for default HTTPServer.
Solution:
This code works for wsgilog version 0.2
import sys, logging
from wsgilog import WsgiLog
import config
class Log(WsgiLog):
def __init__(self, application):
WsgiLog.__init__(
self,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.