text
stringlengths
256
65.5k
Are we really making the right coins from a mathematical point of view? Is a penny,a nickel, a dime a quarter and 1,5,10,20,50 and 100 dollars bills the optimal configuration? Or is there a better configuration that can be more useful? What do you think. I came up with this question because I was thinking about the met...
stack The stack is this chain of suspended function calls, because elements in the stack (function calls) depend on each other. In a stack of items, items sit one on top of the other in the order they were placed there, and you can only remove the top one (without toppling the whole thing over). heap The heap is simply...
I'm working in WinXP 5.1.2600, writing a Python application involving Chinese pinyin, which has involved me in endless Unicode problems. Switching to Python 3.0 has solved many of them. But the print() function for console output is not Unicode-aware for some odd reason. Here's a teeny program. print('sys.stdout encodi...
I was looking to do basically the same thing, and Stéphane Chazelas's answer was very helpful. I do this often enough that I wrote a simple Python script to automate things, using the commands he suggested. By default, it reverses the order of the even pages, but this can be suppressed with a command line flag. The qu...
I am having a real hard time trying to determine why the date that is entered via a javascript date widget (that produced dates in the format mm/dd/yyyy) isn't making its way in the backend. I am using crispy forms with a custom template and django 1.6. The error I'm seeing is that the date isn't valid, or missing in t...
Despite the frequently expressed antipathy for Regular Expressions on the part of many in the Python community, they're really a precious tool for the appropriate use cases -- which definitely include identifying words and phrases (thanks to the \b "word boundary" element in regular expression patterns -- string-proces...
Python Scripts as a Replacement for Bash Utility Scripts Often in Python scripts that are used on the command line, argumentsare used to give users options when they run a certain command. Forinstance, the head command takes a-n argument that takes the numberfollowing it and prints only that number of lines. Each argum...
You said that you used these for input: 2010-00-10 (was int, not text) 20.90 (was int, not float) Your original code: def dataType(string): odp='' patternBIT=re.compile('[01]') patternINT=re.compile('[0-9]+') patternFLOAT=re.compile('[0-9]+\.[0-9]+') patternTEXT=re.compile('[a-zA-Z0-9]+') if patternTEXT.match(str...
Basically doing a whole bunch of joins gets messy real quick and you end up querying way more data than you necessarily want (remember that if you join person to 6 addresses the person information is returned 6 times; now keep multiplying that out by extra joins). Imagine a Person entity with 0:M collections of Address...
I have two keyborad keys, "Back" and "Forward". Forward works like it should, here is the output from xev for it: KeyPress event, serial 36, synthetic NO, window 0x4600001, root 0x175, subw 0x0, time 16491048, (21,-17), root:(771,35), state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES, ...
I am trying to check if a user is a member of an Active Directory group, and I have this: ldap.set_option(ldap.OPT_REFERRALS, 0) try: con = ldap.initialize(LDAP_URL) con.simple_bind_s(userid+"@"+ad_settings.AD_DNS_NAME, password) ADUser = con.search_ext_s(ad_settings.AD_SEARCH_DN, ldap.SCOPE_SUBTREE, \ ...
An Introduction to GraphViz and dot Pages: 1, 2 Basic Concepts of dot A generic dot graph is composed of nodes and edges. Our hello.dot example contains a single node and no edges. Edges enter in the game when there are relationships between nodes, for instance hierarchical relationships as in this example, which produ...
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...
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...
cathmaouche carte pinacle PCTV 300i non reconnue par ubuntu - résolu - sos j'ai une carte pinacle PCTV 300i PAL Stereo DVB-T Capture Device elle marche sous windows , je me suis mis à unix de puis peu Ubuntu 6.06 LTS - Dapper Drake j'ai mis kaffeine, mais l'icone DVB est inactive dans gestionnaire de peripherique je ne...
Zakhar Uploader sur votre Freebox Révolution à distance UPLOAD de fichiers sur votre Freebox "distante" ! Free a récemment ouvert la possibilité d'accéder à l'interface de gestion de la Freebox V6 à distance. Vous pouvez donc facilement "récupérer" (download) des fichiers de la Freebox distante vers votre PC, via l'int...
Table Of Contents Configuring Ethernet Interfaces Ethernet Interface Configuration Quick Start Configuring a Layer 2 Ethernet Port Adding a Description for an Ethernet Port Configuring the Ethernet Interface Speed and Duplex Mode Configuring the Ethernet Interface Speed Setting the Interface Duplex Mode Designating an ...
Accessibility doubledee — 2014-01-07T19:43:25-05:00 — #1 When a User views a PM, there is a "Star" icon placeholder which can be used to denote if a PM is "Important". By default, a PM is "Normal" and so a Grey Star is displayed. However, by clicking on the "placeholder", the User can mark the PM as "Important" and a R...
How do you convert a Unicode string (containing extra characters like £ $, etc.) into a Python string? title = u"Klüft skräms inför på fédéral électoral große" import unicodedata unicodedata.normalize('NFKD', title).encode('ascii','ignore') 'Kluft skrams infor pa federal electoral groe' You can use encode to ASCII if ...
Is there a way to select a region in a image with mouse click and crop these region using python PIL ? How can i do it? Thanks The PIL library itself provides no GUI code --what you are asking for is an application with a GUI. I'd suggest using Tkinter + PIL, but there is no way it is trivial - you will have to handle ...
Python 2.7 I defined my own exception like this: class PollNotFound(Exception): pass and when I type raise followed by a space, the completion list that appears doesn't contain my PollNotFound exception. Strangely it lists some exceptions from the azure package (if I import them). Those have a dunder init on them,...
I think you have the right idea, except that the colors will be more distinguishable if you pass the colormap hsv numbers which are spread out over the range (0,1): hsv(float(i)/(len(data)-1)) For example: import matplotlib.pyplot as plt import matplotlib.dates as md import numpy as np import datetime as dt import sci...
I want to do a double integral in python. Taking help from http://docs.scipy.org/doc/scipy/reference/tutorial/integrate.html, I did the following import numpy as np import matplotlib.pyplot as plt from scipy import integrate def func(x,a): return a*x*x def integrl(a): return integrate.quad(func,0,10,args=(a)) p...
I have followed the layout of my flask project from http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world. I have the following structure app/ __init__.py views.py forms.py myFile.pyrun.pyconfig.py In views.py, forms.py I am able to use from config import basedir However I cannot use that in m...
I have a bot in python that allows the users to evaluate mathematical expressions (via a set of safe functions), but I would like to define my own operator. Does python support such a thing? No, you can't create new operators. However, if you are just evaluating expressions, you could process the string yourself and ca...
On the Python Edu-sig, Dethe Elza announced a project to write a beginning Python programming book for artists. Many commercial art tools now use Python, including Blender, Poser, and Lightflow. Blender is a 3D animation tool that uses Python as its scripting language. The Poser Pro pack includes an altered version of ...
I've been trying to get this to work but keep getting the same errors. I've tried the fqdn and ip of the host. I've tried to pass it with credentials and without. I've looked at the lines indicated in the error message. Searched google, but cannot figure out why this is not working: import paramiko ssh = paramiko.SSHCl...
I have been confused by this as well for quite a while and I don’t believe that the reason for this has got much to do with the often-pronounced explicit is better than implicit but that it is just following a simple analogy there. Let’s take a simple vector class: class Vector(object): def __init__(self, x, y)...
I am trying to get some comments off the car blog, Jalopnik. It doesn't come with the web page initially, instead the comments get retrieved with some Javascript. You only get the featured comments. I need all the comments so I would click "All" (between "Featured" and "Start a New Discussion") and get them. To automat...
Apologies in advance, but I'm new to most of this so I might not get my terms or concepts quite right. That said, I'm fairly certain that SQLA is the right tool so any input is greatly appreciated. Here is a generic piece of code that I've taken from a posting on here which I've tried to expand upon to suit my own need...
There are some children sitting around a round table. Each child is given an even amount of $1$-cent coins ($0$ is even) by their teacher, all the children at once. A child will give half his money to the child by his right, then the receiving child gives half of his to the one by his right and it goes on like that. If...
What is the most efficient way, memory-wise, to store 1 million phone numbers? Apparently this is an interview question at Google,please give your ideas.. Write them in ASCII, space-separated. Zip the resulting string, using your favourite compression algorithm. If order isn't important, sorting them first might help t...
Aider web2py : Bugs, améliorations et documentation web2py est très ouvert aux rapports de bug, aux améliorations de documentation et améliorations. Google Group Le forum principal pour discuter des bugs et des nouvelles fonctionnalités est : web2py-users (L'URL est https://groups.google.com/forum/#!forum/web2py) Rempl...
how do you code in a home button for a web browser? im creating a web browser in ubuntu for use in ubuntu. I am using a mix of Glade, Python, quickly, WebKit and WebView i have got nearly everything done and thought a home button would be a nice touch. I already have the home button in place just need to know how to ge...
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 would like to automate the process of selecting a number of proposal reviewers that fit a conflict of interest criterion. Let's say I have 5 reviewers and 5 applicants from 5 departments. The department of a person can be obtained from the function getdept: depts = { "science", "language", "art", "history", "educa...
Programmatic Access Now that you have the Spread daemon running, you can try to access it from code. The latest version of the Spread module for Python (1.5) is available from Zope, and older versions from the original Python Spread page. Download and extract the contents of the distribution (see Resources), then from ...
You can do this easily from NetworkManager's pygi bindings: from gi.repository import NetworkManager, NMClient nmc = NMClient.Client.new() devs = nmc.get_devices() for dev in devs: if dev.get_device_type() == NetworkManager.DeviceType.WIFI: for ap in dev.get_access_points(): print ap.get_ssid() ...
I have a script that includes opening a file from a list and then doing something to the text within that file. I'm using python multiprocessing and Pool to try to parallelize this operation. A abstraction of the script is below: import os from multiprocessing import Pool results = [] def testFunc(files): for file ...
You could try this: In [9]: l = [[3,7,2],[1,4,5],[9,8,7]] In [10]: [sum(i) for i in zip(*l)] Out[10]: [13, 19, 14] This uses a combination of zip and * to unpack the list and then zip the items according to their index. You then use a list comprehension to iterate through the groups of similar indices, summing them an...
Hiya, I asked a question earlier regarding using keys which was answered perfectly. However, now I'm wondering if creating and using keys for my Models is the way to go, I've been told by my iPhone App guy that we need INTs to store in the database. I got my Python code working with Keys and now may have to back track....
I'm new to SqlAlchemy. We were working primarily with Flask, but in a particular case I needed a manual database connection. So I launched a new db connection with something like this: write_engine = create_engine("mysql://user:pass@localhost/db?charset=utf8") write_session = scoped_session(sessionmaker(autocommit=Fals...
I was using the pidgin dbus api to print the names of my gtalk buddies and their status by writing the following python code snippet: import dbus # Initiate a connection to the Session Bus bus = dbus.SessionBus() # Associate Pidgin's D-Bus interface with Python objects obj = bus.get_object("im.pidgin.purple.PurpleServi...
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'm currently trying to initiate a file upload with urllib2 and the urllib2_file library. Here's my code: import sys import urllib2_file import urllib2 URL='http://aquate.us/upload.php' d = [('uploaded', open(sys.argv[1:]))] req = urllib2.Request(URL, d) u = urllib2.urlopen(req) print u.read() I've placed this .py fil...
toto2849 Connexion VPN automatique (NetworkManager) Bonjour,:D -Actuellement en stage il met demandé de mettre en place une connexion VPN qui se lance automatiquement au démarrage du pc ne laissant juste à l'utilisateur une boite de dialogue demandant login+pass.:rolleyes: -J'ai déjà installé le plugin "network-manager...
I was also trying to fine my rank, but since I am not Jon Skeet or Marc Gravell it involves a lot of clicking through pages for me. Since I started learning Python I typed together a little script which would do the clicking for me. If you are a low reputation user like I am, it takes quiet a while. When asked for user...
I'm attempting to start some Outlook 2007 automation with Python. I got this great script (below) from Steve Townsend on this thread: Send Outlook Email Via Python? but I'm having trouble getting started with this. import win32com.client def send_mail_via_com(text, subject, recipient, profilename="Outlook2007"): s ...
I am trying to convert some python script to display a table (based on a dbf) of features located within a specific data driven page. So far, I have the script successfully able to refresh the map to the specific table, but it does not update the table. I have it set-up as three text boxes that should be updated with t...
I am new to Python and am trying to create a very simplified version of foursquare. I would like the user to be able to check-in as well as search through their previous check-ins by date and location. The code that I have seems to work alright with the check-in, but the searches are not returning results to the user. ...
I wanted to now share my conclusions so that others can benefit from them too. To do this I am going to first explain how this works, and secondly I have created a Python Snippet and added it to the Python Snippets libray so there is a great working example you folks can play with. You can use Acire to load the snippet...
L4ur3nt Réponses : 0 Bonjour à tous, J'ai un pc sur Ubuntu 13.04 et un NAS D-link DNS 320 connecté au réseau local et j'ai 3 soucis que j'aimerais solutionner : - Quand je réalise des transferts de fichier de dossier de photos, ça plante systématiquement après quelques photos transférées. - Je constate également que l'...
chaoswizard Re : TVDownloader: télécharger les médias du net ! Une idée ca pourrait sympas aussi de récupérer a partir de daylimotion ou youtube : vous savez genre des chaines de groupe : http://www.youtube.com/user/ProdigyChannel exemple france inter : http://www.dailymotion.com/franceinter C'est jouable. Dans ce cas ...
I have a code which get list of all functions in FooBar and a regular expression the function supports on its parameter message: functionList = [] def notify(RegExpression): def _notify(function): functionList.append((RegExpression, function)) return function return _notify class FooBar: @no...
A question on SO (10k-only link) that recently got some attention due to a meta post consisted entirely of python code, no additional text was present in the question body. This should theoretically have triggered the “Here code. You fix.” filter that should prevent questions that only contain source code. This did...
Developing a PythonWin Sample Application During the rest of this section, we will develop a sample application using PythonWin. This will lead us through many of the important MFC and PythonWin concepts, while also leveraging the dynamic nature of PythonWin. MFC itself has a tutorial/sample called Scribble, which deli...
I'm using Haystack and Whoosh with Django Within search_index.py I have this class PageIndex(RealTimeSearchIndex): text = CharField(document=True, use_template=True) creator = CharField(model_attr='creator') created = DateTimeField(model_attr='created') org = CharField(model_attr='organisation') site.re...
lekokeliko Tictactux jeu en Python Je tient a vous présenter ma grande réalisation : le Tictactux en python développé depuis la nuit du 24 decembre 2007 morpion like parametrable a souhait quelques précisions : versions antérieures : -1.07.29 beta test -1.07.30 détails des modifs plus bas (post 7) -1.07.31 modification...
What is a Python toolbox? Python toolboxes are geoprocessing toolboxes that are created entirely in Python. A Python toolbox and the tools contained within look, act, and work just like toolboxes and tools created in any other way. A Python toolbox (.pyt) is simply an ASCII-based file that defines a toolbox and one or ...
Hi, I'm having a problem with the Synaptic package manager on my Xubuntu Dapper subnotebook: When I click the "Reload" button, I get an error message saying a couple of sources - which are listed in the message - could not be loaded, might not be available anymore or whatever. When I search for a specific package, the ...
I've almost got to have a remote Ubuntu Desktop working exactly as id it was a local session, but still can't solve a little issue wich is driving me crazy. I have a remote machine with Ubuntu Desktop. I connect to it via VNC over SSH, and as I say "almost everything" works perfectly, except for a problem I'm not getti...
I’ve just uploaded version 0.0.1 of the simple-observer package to hackage, the Haskell package repository. This is an implementation of the Observer design pattern in Haskell. I am not the originator or even main author of the code in this package; that is Dutch computer scientist Bastiaan Heeren, who wrote the origin...
I've seen this question, but I want to be able to access the data that's POST'd, external from the handler. Is there a way to do this? Following is the code: import BaseHTTPServer HOST_NAME = '' PORT_NUMBER=8088 postVars = '' class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_POST(s): s.send_res...
I don't (yet) have any C# examples of authorization via service accounts, but the Google APIs support service account authorization flow. Here's an example of using this authorization flow with the Google BigQuery API, in Java & Python, using the Google APIs Client Libraries for these languages (http://code.google.com/...
I use python-mode in emacs. I have been using for 1 month with no problems. Now I have a problem, in that whenever I 'return' or 'pass' a function inside a class, the indent returns to the start of the next line EG class test(object): def method1(self): return 1 |cursor returns here, cant press tab to inden...
I want to play audio files with different playback rates using GStreamer. This already works fine. However, in contrast to the Python GStreamer reference, negative rates do not play the audio file backwards. Does anybody know how to accomplish my goal? Has this something to do with filesrc or decodebin2 not being able ...
The MicroFTX is a low-cost, reconfigurable, and compact Micro-USB breakout board based on the FTDI FT230X full-speed USB Serial UART IC. News! June 1, 2013: Now shipping revision 2boards, which include the following changes: Increased C1 from 0.1μF to 2.2μF. This improves USB connection stability in electrically noisy ...
Possible Duplicate: How to “log in” to a website using Python’s Requests module? I'm programming an application in python 3.2.3, and I don't know how to login to a website. I need to login... and save cookies(I think), but everything I tried doesn't work. I had try Requests, but no luck. My webpage is running on ...
Flask Response headers and IE's cache I'm working on a new project at work and my work with pyDimension recently meant I can switch from PHP to Python there too. It's already making my life easier. I hit upon an old issue that I'd solved long ago in PHP, Internet Explorer stupidly caches all XMLHttpRequest responses. I...
I've stared at this so long that it's all starting to run together. So I'm getting a valgrind error: ==25468== Invalid write of size 4 ==25468== at 0x52CF64D: _IO_vfscanf (vfscanf.c:1857) ==25468== by 0x52D730A: __isoc99_fscanf (isoc99_fscanf.c:35) ==25468== by 0x402DDB: loadMindRAW (gplib.c:172) ==25468== ...
It's not the same to POST to an URL than to GET it, DELETE it or PUT it. These actions are fundamentally different. However, Django seems to ignore them in its dispatch mechanism. Basically, one is forced to either ignore HTTP verbs completely or do this on every view: def my_view(request, arg1, arg2): if request.m...
I am not able to hear any sound. Does anyone have a clue how to proceed in fixing this? Issuing aplay gives this $ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: NVidia [HDA NVidia], device 0: VT1708S Analog [VT1708S Analog] Subdevices: 2/2 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 card ...
This is the first post in a multi-part series wherein I will explain the details surrounding the language prediction model I presented in my Pycon 2014 talk. If you make it all the way through, you will learn how to create and deploy a language prediction model of your own. OSEMN I’m not sure if Hilary Mason originally...
AuthorPosts October 12, 2011 at 12:04 pm #6349 Hi, Amazing theme, thanks very much. I would like to know if its possible to move the small box containing the rss, twitter and facebook links, currently sat at the bottom of the scroll, up the sidebar to directly beneath the “pages” section and have it remain there on eve...
I bought my girlfriend a Wacom Bamboo CTH-470 recently and it is running well after installing wacom-dkms. I have now run into a wall that I don't know how to get around. The touch on the tablet will not turn off. I am running Ubuntu 12.04 Beta 2. I have tried turning the touch off from the wacom settings in the settin...
tomtom Re : [HOW TO] adesklets : installation sous Ubuntu Breezy raaah ! j'ai un probleme d'interpreteur python ! J'ai installé toutes les librairies via synaptic et adesklets aussi. J'ai DL YAB (Yet Another Bar) et j'ai ca : [i]tomtom@barad-luin:/mnt/config/programmes/adesklets/yab-0.0.2$ [/i][b]ls -l[/b] total 56 -rw...
#1651 Le 31/05/2012, à 19:24 Hizoka Re : [glade2script-GTK2] Interface graphique pour script bash ou autre. Pour le blocage de l'interface ? Essai de mettre le sleep également avant la commande EXEC (ton ordi trop puissant ...) bien vu, ca semble etre ok avec un sleep 0.10 avant le load. Hors ligne #1652 Le 01/06/2012,...
I am trying to build this GUI tool in wxpython as part of my project. I have a basic frame that has a splitter window(wx.SplitterWindow object), split horizontally. When the application is first opened, it will show just the splitter window with some text. I also have a menu that houses various menu-items that are bind...
I want to be able to list only the directories inside some folder. This means I don't want filenames listed, nor do I want additional sub-folders. Let's see if an example helps. In the current directory we have: >>> os.listdir(os.getcwd()) ['cx_Oracle-doc', 'DLLs', 'Doc', 'include', 'Lib', 'libs', 'LICENSE.txt', 'mod_p...
I have been trying to create a small GUI for a definition-tester program I am making. My GUI needs to look like this: Word: # label, then entry widgetDefinition: # label, entry widgetPart of Speech: # label, then entry widgetGo Quit # each are buttons This is what I have so far: from Tkinter import * class GetWord: ...
I'm using quadmesh to create a simple polar projection plot. Here's a minimal script which produces basically what I'm trying to do: from __future__ import unicode_literals import numpy as np import matplotlib.pyplot as plt def make_plot(data,fig,subplot): nphi,nt = data.shape phi_coords = np.linspace(0,np.pi*2...
I am trying to write a script contains some classes and save for example as model.py. import numpy as np from scipy import integrate class Cosmology(object): def __init__(self, omega_m=0.3, omega_lam=0.7): # no quintessence, no radiation in this universe! self.omega_m = omega_m self.omega_la...
I'm writing a REST client for elgg using python, and even when the request succeeds, I get this in response: Traceback (most recent call last): File "testclient.py", line 94, in <module> result = sendMessage(token, h1) File "testclient.py", line 46, in sendMessage res = h1.getresponse().read() File "C:\Py...
How do I check whether a variable is an integer? If you need to do this, do isinstance( <var>, int ) unless you are in Python 2.x in which case you want isinstance( <var>, ( int, long ) ) Do not use class Spam( int ): pass x = Spam( 0 ) type( x ) == int # False isinstance( x, int ) # True This adheres to Python's st...
Tornado advertises itself as "a relatively simple, non-blocking web server framework" and was designed to solve the C10k problem. However, looking at their database wrapper, which wraps MySQLdb, I came across the following piece of code: def _execute(self, cursor, query, parameters): try: return cursor.exec...
I would assume a regex is better than checking for each substring individually because conceptually the regular expression is modeled as a DFA, and so as the input is consumed all matches are being tested for at the same time (resulting in one scan of the input string). So, here is an example: import re def work(): t...
ehmicky Stego++, projet de bibliothèque de stéganographie Salut à tous, [Message mis à jour 19/11/11] Je suis actuellement sur un projet de stéganographie (art de dissimuler un message secret dans "quelque chose" (fichier, phrase, etc.) d'apparence banal). Il s'agit de faire une bibliothèque C++, Stego++, qui permette ...
I had the same issue,Sometimes this happends if the WSGI application is located outside of any directories already configured to be accessible to Apache, particularly when it is on your home directory, its good to specify user=username directive. /etc/apahe2/sites-avaliable/myvhost [section] WSGIDaemonProcess localhost...
I have a .bin file, and I want to simply byte reverse the hex data. Say for instance @ 0x10 it reads AD DE DE C0, want it to read DE AD C0 DE. I know there is a simple way to do this, but I am am beginner and just learning python and am trying to make a few simple programs to help me through my daily tasks. I would lik...
After making an USB Audio card work with Arduino Yún, the logical second step was try to use an USB camera instead, and it worked! I was so amazed by this new huge set of possibilitities to create, that I started a little weekend project: to build an Arduino based Facebook photo camera I was so into this project that I...
I'm trying to write a simple script to log into Wikipedia and perform some actions on my user page, using the Mediawiki api. However, I never seem to get past the first login request (from this page: https://secure.wikimedia.org/wikipedia/en/wiki/Wikipedia:Creating_a_bot#Logging_in). I don't think the session cookie th...
There are actually two problems here. First, as Mike pointed out, n < len(string1) or len(string2) is equivalent to (n < len(string)) or len(string2). In other words, as long as len(string2) is not zero, this will always be true. To fix this, change it to n < len(string1) or n < len(string2). But when you fix that, not...
I have a Bash script which connects to MPD server and display current song and also accepts some keys to control the player. I have stripped some functions from it a few times when I needed to write a Bash script to do something with MPD, e.g. showing Last.fm playcount in Conky. A few times, I wanted to know what metad...
HKH Re : Cerise 0.8 - TPE, freelances, artisans effectivement ca ne fonctionne pas avec ces identifiants...! J ai crée une entreprise nom : Ubuntu login ubuntu pass ubuntu Bon test Hors ligne j1100 Re : Cerise 0.8 - TPE, freelances, artisans Hop je m'abonne. Ça va fortement m'intéresser dans 2-3 ans quand je serai patr...
I'm new to Django (and Python) and I have been trying to work out a few things myself, before jumping into using other people's apps. I'm having trouble understanding where things 'fit' in the Django (or Python's) way of doing things. What I'm trying to work out is how to resize an image, once it's been uploaded. I hav...
I've been working on a minor (first time) app with quickly and hit a hurdle - how do I get the selected row (the data) from a TreeView? The data to the TreeView is passed from a list of files in a directory, and I need to know which rows were selected (and thus which files were). What is the best way to do that? Here's...
sound karligula at March 8th, 2007 10:28 — #1 Hi folks, I'm writing some stuff using midi files and I need to convert the midi time stamps for each midi event into milliseconds. I've searched the web and every document I come across blathers on about quarter notes, tempo, beats per minute, measures, bars, ticks, metron...
pilepoil Asus X59SL problème accès internet (seulement Google, BNP) Salut, J'ai depuis peu de temps le Asus X59SL. J'ai mis un double boot Ubuntu et Vista. Sous Vista, pas de soucis d'accès à internet. Sous Ubuntu 8.10 64 bits, j'ai accès uniquement à Google et à BNP (et peut être d'autres, mais pas nombreux). J'ai fai...
inconnu Re : Petit guide pour aider au choix d'un langage Encore une fois merci pour toutes ces références (j'ai déjà trois bouquins de 300 pages à m'infuser ). Bon c'est quand même passionnant, dès fois un peu complexe, mais je suis globalement assez surpris de la qualité. Pour tout dire, je ne pensais pas qu'il exist...
We use CherryPy and SQLAlchemy to build our web app and everything was fine until we tested with 2 concurrent users - then things started to go wrong! Not very good for a web app so I'd be very appreciative if anyone could shine some light on this. TL;DR We're getting the following error about 10% of the time when two ...