text
stringlengths
256
65.5k
Testing with Flask is generally straightforward but some things aren’t trivial. The Flask-Testing extension helps us with some really useful assertions like TestCase#assert_context and TestCase#assert_template_used but it miss a way to test flash messages. One of the ways to test flashes is asserting if the message is ...
I have a system with a virtual network interface eth0:1, and I want to send multicast packets that have a source IP of that interface. However, my packets end up with the source IP for eth0. How do I get the correct source IP in my multicast packets? The commands used to create the iface/route sudo ifconfig eth0:1 plum...
I have this confusion with static root and wanted to clarify stuffs. To serve static files in django following should be in the settings.py and urls.py import os PROJECT_DIR=os.path.dirname(__file__) 1.Absolute path to the directory static files should be collected: STATIC_ROOT= os.path.join(PROJECT_DIR,'static_media...
import numpy import rpy2 from rpy2 import robjects import rpy2.robjects.numpy2ri r = robjects.r rpy2.robjects.numpy2ri.activate() x = numpy.array( [1, 5, -99, 4, 5, 3, 7, -99, 6] ) mx = numpy.ma.masked_values( x, -99 ) print x # works, displays all values print r.sd(x) # works, but uses -99 values in calculat...
This is a minimal code to output pixel on the screen using PySDL2. UPD: (March 2014) Up for PySDL2 0.9.0 (RenderContext renamed to Renderer) UPD: (March 2014) Up for PySDL2 0.9.0 (RenderContext renamed to Renderer) #!/usr/bin/env python """ The code is placed into public domain by anatoly techtonik <techtonik@gmail.com...
Having a list of points, how do I find if they are in clockwise order? For example: point[0] = (5,0)point[1] = (6,4)point[2] = (4,5)point[3] = (1,5)point[4] = (1,0) would say that it is anti-clockwise (counter-clockwise for some people). Some of the suggested methods will fail in the case of a non-convex polygon, such ...
I've got some SA models and need some trick : class Entry(Base): __tablename__ = 'entry' id = Column(Integer, primary_key=True) title = Column(Unicode(255)) author_id = Column(Integer, ForeignKey('user.id')) date = Column(DateTime) content = Column(Text) author = relationship('User', backref...
#2676 Le 15/02/2013, à 19:14 mulder29 Re : TVDownloader: télécharger les médias du net ! Et je reçois python: can't open file alors que j'ai installé Python 2.7.3, hier. Hors ligne #2677 Le 15/02/2013, à 19:26 k3c Re : TVDownloader: télécharger les médias du net ! si tu tapes which python ça affiche quoi ? Dernière mod...
Shell calls to reverse (as mentioned above) are very good to debug these problems, but there are two critical conditions: you must supply arguments that matches whatever arguments the view needs, these arguments must match regexp patterns. Yes, it's logical. Yes, it's also confusing because reverse will only throw the ...
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...
Consider a simple example like this which links two sliders using signals and slots: from PySide.QtCore import * from PySide.QtGui import * import sys class MyMainWindow(QWidget): def __init__(self): QWidget.__init__(self, None) vbox = QVBoxLayout() sone = QSlider(Qt.Horizontal) vbox.addWidget(sone) stwo = Q...
I recently had a conversation with Paul Knopf on Twitter regarding the best way to embed code on a web site. Fabrik (what my blog runs on) uses Google Code Prettifier to format all code samples. This is made even easier by the fact that I use Markdown to write my posts. One disadvantage to this approach is when referen...
I wanted to make it easier to register callbacks using decorators when designing a library, but the problem is that they both use the same instance of the Consumer. I am trying to allow both these examples to co-exist in the same project. class SimpleConsumer(Consumer): @Consumer.register_callback def callbac...
PyRXP is a DTD validating XML parser developed by ReportLab. It is Python wrapper around RXP, a C parser developed by Richard Tobin and Henry Thompson of the Edinburgh Language Technology Group as the core of LT XML, "an integrated set of XML tools and a developers' tool-kit, including a C-based API". ReportLab is a ve...
When I write to a file, using python open(filename, 'w+'), I get multiple lines of NULL written to the file in addition to the new text. Python 2.7.3 from sys import argv script, filename, random = argv my_file = open(filename, 'w+') added_line = raw_input("Type what you want to add: ") my_file.write(added_line) print ...
I'm working through Effective Django's tutorial series. I'm currently having an issue trying to create a custom form to use in an app. I created the forms.py file as instructed in this part of the tutorial, and made the alterations to my views.py file. My directory structure looks like this: (project root) | ├── ...
I have a canvas that calls createCategoryMeny(x) when it is clicked. This function just creates a Toplevel() window, def createCategoryMenu(tableNumber): ##Not interesting below: categoryMenu = Toplevel() categoryMenu.title("Mesa numero: " + str(tableNumber)) categoryMenu.geometry("400x400+100+100") ...
The question is interesting. So you want a "loose" curve which joins points (A) and (B) and whose length is 8 units. Obviously, the difficult part is to ensure that the length is 8 units (or at least close to that amount). The general problem depends on which curve is chosen (See Wikipedia's arc length article), but in...
Alon Swartz - Thu, 2010/07/08 - 11:49 - 13 comments | Latest by kim Every web application needs a navigation bar. Common practice is to indicate to the user where he or she is, and is usually implemented by using a visual aid such as a bold type-face, different color or an icon. I wanted an elegant, generic, extendable...
Is it possible to get the RGB color of a pixel using PIL? I'm using this code: im = Image.open("image.gif") pix = im.load() print(pix[1,1]) However, it only outputs a number (e.g. 0 or 1) and not three numbers (e.g. 60,60,60 for R,G,B). I guess I'm not understanding something about the function. I'd love some explanat...
Maybe a bit of example code will help: Notice the difference in the call signatures of class A(object): def foo(self,x): print "executing foo(%s,%s)"%(self,x) @classmethod def class_foo(cls,x): print "executing class_foo(%s,%s)"%(cls,x) @staticmethod def static_foo(x): print ...
Python seems to need to have been compiled with --with-pydebug (on Ubuntu 12.04, package python-dbg contains the a Python executable that installs is also called python-dbg). The inferior Python does not need to be Python 2.7 -- 2.6 loads the 2.7 gdb extensions successfully (see the debugging session below). At least o...
This is not directly related to your question, but when you're in the python console, you can call help() on any function and it will print its documentation. also, you can call dir() on any module or object and it will list all of its attributes, including functions. This useful for inspecting contents of a module aft...
I'm starting to work on a small soccer league management website (mostly for learning purposes) and can't wrap my mind around a Django models relationship. For simplicity, let's say I have 2 types of objects - Player and Team. Naturally, a player belongs to one team so that's a ForeignKey(Team) in the Player model. So ...
This was a whole different question, but I'm editing it and adding a whole new one 'cause I solved former. Anyhow, I have models.py: from django.db import models from django.contrib.auth.models import * from django.utils.translation import gettext as _ class PLanguages(models.Model): plangs = models.CharField('Lang...
chaoswizard Re : TVDownloader: télécharger les médias du net ! Bonsoir, Non ce n'est pas possible, RtmpDump (et je suppose Flvstreamer) n'arrive pas à parser l'URL si elle n'est pas découpée. J'avais étudié ce problème en mettant au point Arte Live Web pour TVO. Bon courage pour votre projet Je viens pourtant de tester...
I'm having trouble with an or condition in a function. The if statement keeps evaluating as True no matter what value choice is. When I remove the or, the if works correctly. def chooseDim (): **choice = input ('Do you need to find radius or area? ') if choice == 'A' or 'a':** area = 0 area = in...
i am programing a client/server software in Python using sockets. I have a question, specifically for the TCP/IP and Socket models: I am using this example of code on my server side (server side program in Python): import socket # Create a TCP/IP socket server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Preve...
I have a hard time to model my applications data to get reasonable performance. It is an application that track costs within a group of people and today I have the following entities: class Event(db.Model): # Values name = db.StringProperty(required=True) password = db.StringProperty(required=True) class Pe...
mac-gyver31 Re : Client Ubuntu + Active Directory et partage avec Windows serveur 2003 En fait ce post est plutôt tournée vers l'intégration d'un ordi dans un domaine windows 2003 dans le cadre d'un serveur LTSP. Un serveur LTSP ?? Tu veux dire Linux Terminal Server Project ? T'es sûr ? Car je ne vois pas bien le rappo...
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 thoroughly feasible — even on a part-time basis. In fact, simpl...
oliver2004 problème wifi avec portable HP nx6125... Salut à tous, je viens d'installer sans trop de mal Kubuntu 7.10 sur mon portable HP Compaq nx6125 (j'ai de la chance il n'est pas tatoué...). Aparemment tout marche sur la machine... sauf le wifi... j'en ai pas besoin là maintenant mais j'en aurai sûrement besoin et ...
How can I translate django models without use verbose_name argument on each field? Occur a practicing to inherit all models by an intermediate class which looking for adding new fields and automatically supply it an arg verbose_name by name of field? Or is a best practice to integrate translation into the forms? Maybe ...
I am trying to define simple getter/setter methods for a mixin class that I intend to use in my database schema: from sqlalchemy import Column, Integer, create_engine from sqlalchemy.orm import synonym, scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base, declared_attr engine = create_e...
I'm new to python and Opencv and I tried to put in the following code to save an image to my computer from my webcam: import cv if __name__=='__main__': pCapturedImage = cv.CaptureFromCAM(1) rospy.sleep(0.5) pSaveImg=cv.QueryFrame(pCapturedImage) cv.SaveImage("test.jpg", pSaveImg) But when I try to...
malbo [Tuto] identifier si on est dans un système UEFI ou Bios ATTENTION : CETTE MÉTHODE D’IDENTIFICATION EST OBSOLÈTE : IL FAUT UTILISER LA PROCÉDURE DE LA DOC : http://doc.ubuntu-fr.org/efi#identifier … n_mode_efi Le problème se pose pour des PC achetés en 2011 (et +) pour ceux qui souhaitent faire cohabiter Windows ...
Groovy-stream is a library for Groovy that lets you create lazy Iterators (or streams) based on Iterators, Collections, Maps, Iterables or other Streams. As a simple example, lets create a Stream representing all positive integers: @Grab( 'com.bloidonia:groovy-stream:0.6.2' ) import groovy.stream.Stream def integers = ...
michcauch my-weather-indicator ne fonctionne plus après mise à jour my-weather-indicator ne fonctionne plus, juste après une mise à jour de my-weather-indicator sous 12.04. J'ai ce message d'erreur quand je le lance depuis un terminal : michel@bureau:~$ my-weather-indicator Traceback (most recent call last): File "/usr...
This program has been disqualified. Author dllu Submission date 2011-06-22 23:43:29.790718 Rating 7504 Matches played 2064 Win rate 75.24 # WoofWoofWoof # Woof Woof # Woof Woof # Woof Woof # ...
So lets say I have a list of numbers and I want to create a vector out of all of them in the form (x, 0, 0). How would I do this? hello = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] So when I access, say, hello[2] I get (3, 0, 0) instead of just 3. Try this, using numpy - "the fundamental package for scientific computing with Pyth...
The first thing to do after a successful completion of the file dialog is ask the dialog what the selected pathname was, and then use this to modify the frame's title and to open a BookSet file. Take a look at the next line. It reenables the BookSet menu since there is now a file open. It's really two statements in one...
blob: 6c9a2c4bb25f2e607a0f516b9add614b9c2afbd8 ( plain ) #!/usr/bin/python # gsttl_splitlog.py <logfile> # # splits logfile into separate logs per type # takes basename from log and creates subdir with splitted logs # it takes the first field from each logline as the key # does not remove anything if directory already ...
I'm fairly new to python, so I apologize in advance if this is something simple I'm missing. I'm trying to post data to a multipart form in python. The script runs, but it won't post. I'm not sure what I'm doing wrong. import urllib, urllib2 from poster.encode import multipart_encode from poster.streaminghttp import re...
Look at this simple function def prime_factors(n): for i in range(2,n): if n % i == 0: return i, prime_factors(n / i) return n Here's the result of prime_factors(120) (2, (2, (2, (3, 5)))) Instead of nested tuples, I want it to return one flat tuple or list. (2, 2, 2, 3, 5) Is there a simple way ...
Last summer, I had some internet connectivity problems. Specifically, I would have massive latency issues that affected my conversations on Skype and my relatively pathetic under the best of circumstances efforts at online gaming. It was driving me up a wall and I couldn't figure it out. It hadn't occurred earlier with...
Only 0 can be relied on, although the docstring for list.sort is interesting: print list.sort.__doc__ L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN PLACE*; cmp(x, y) -> -1, 0, 1 But in fact, sort doesn't actually impose this on it's comparison function as can be seen here: def mycmp(a, b): print "my...
I'm trying to make a POST request to retrieve information about a book. Here is the code that returns HTTP code: 302, Moved import httplib, urllib params = urllib.urlencode({ 'isbn' : '9780131185838', 'catalogId' : '10001', 'schoolStoreId' : '15828', 'search' : 'Search' }) headers = {"Content-type":...
I have got a sequence of strings - 0000001, 0000002, 0000003.... upto 2 million. They are not contiguous. Meaning there are gaps. Say after 0000003 the next string might be 0000006. I need to find out all these gaps. In the above case (0000004, 0000005). This is what I have done so far - gaps = list() total = len(curr...
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), and some additional JavaScript functions based on jQuery. Nothing in web2py prevents you from using other Ajax libraries ...
ffmpeg -i input.flv -ss 00:00:00.000 -pix_fmt rgb24 -r 10 -s 320x240 -t 00:00:10.000 output.gif It works great, but output gif file has a very law quality. Any ideas how can I improve quality of converted gif? Output of command: $ ffmpeg -i input.flv -ss 00:00:00.000 -pix_fmt rgb24 -r 10 -s 320x240 -t 00:00:10.000 out...
Based on the other answers to this question, I've implemented a new approach using bcrypt. Why use bcrypt If I understand correctly, the argument to use bcrypt over SHA512 is that bcrypt is designed to be slow. bcrypt also has an option to adjust how slow you want it to be when generating the hashed password for the fi...
Judepaum [Résolu] Twinview changement résolution impossible Bonjour et bonne année ! Je viens de faire une installation fraîche de 12.10 et j'ai pas mal de soucis pour retrouver la configuration de TwinView que j'avais sur 12.04 ... Donc, dans les faits, dans nvidia-settings je ne peux choisir que Off ou Auto pour la r...
I wrote this little script to format a timedelta object according to my needs: def due_format(self): time_diff = abs((self.due - datetime.datetime.now()).total_seconds()) days = time_diff / 60 / 60 / 24 hours = time_diff / 60 / 60 minutes = time_diff / 60 hours_wo_days = hours - ...
Could I code differently to slim down the point of this Python source code? The point of the program is to get the user's total amount and add it to the shipping cost. The shipping cost is determined by both country (Canada or USA) and price of product: The shipping of a product that is $125.00 in Canada is $12.00. inp...
raspouillas Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] Je ne faisait aucune allusion au problème de @souen. Dernière modification par raspouillas (Le 15/06/2012, à 20:37) ljere Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] alors voici la première partie du ...
When developing for the web a time will come when you’ll need to sanitize HTML. If you need to do this in Python then you should check out Bleach. Bleach is an HTML sanitizing library that escapes or strips markup and attributes based on a white list. Bleach can also linkify text safely, applying filters that Django’s ...
Mathieu11 [ VOS SCRIPTS UTILES ] (et eventuelles demandes de scripts...) Edit admin : le sommaire renvoyant vers les différents scripts se trouve désormais sur cette page de la documentation. Les nouveaux scripts peuvent donc être discutés ici, puis inclus dans le sommaire J'ouvre ce sujet pour proposer a chacun de pos...
I come from a python background, where it's often said that it's easier to apologize than to ask permission. Specifically given the two snippets: if type(A) == int: do_something(A) else: do_something(int(A)) try: do_something(A) except TypeError: do_something(int(A)) Then under most usage scenarios the second ...
I'm trying to make a grouped bar plot in matplotlib, following the example in the gallery. I use the following: import matplotlib.pyplot as plt plt.figure(figsize=(7,7), dpi=300) xticks = [0.1, 1.1] groups = [[1.04, 0.96], [1.69, 4.02]] group_labels = ["G1", "G2"] num_items = len(group_labels) ind = arange(nu...
I am a total matplotlib noob, at the moment making small changes to example programs and seeing what happens, and attempting to comprehend the extensive but not well ordered documentation. I'm trying to add a graph display to an existing tk gui based python program. I am quite happy for the graph to float in a new wind...
Hello! I have the following script: import os import stat curDir = os.getcwd() autorun_signature = [ "[Autorun]", "Open=regsvr.exe", "Shellexecute=regsvr.exe", "Shell\Open\command=regsvr.exe", "Shell=Open" ] content = [] def read_si...
Most of the time, code that we write doesn't have to perform as fast as if we wrote it in C. Most of the time, the first pass at writing it is "fast enough" and we don't have to optimize--but there are times when a piece of code just has to meet a certain standard of performance. For those "it's gotta run like a scalde...
I am trying to make a small script to remotely manage windows computers (currently only shutdown). The method I am using involves a webapp2 server. i would like to compile my first attempt into a .exe. The problem I am having is that after successfully compiling it I go to run it and it returns the error: Traceback (mo...
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...
benjou Re : Aidez moi s'il vous plait pour mon projet benoit@laptop-benoit:~$ picard Traceback (most recent call last): File "/usr/bin/picard", line 2, in ? from picard.tagger import main; main('/usr/share/locale') File "/usr/lib/python2.4/site-packages/picard/tagger.py", line 73, in ? from picard import ev...
Ricette Ajax Sebbene web2py sia pensato principalmente per lo sviluppo lato server, l'applicazione welcome (utilizzata come base per tutte le nuove applicazioni di web2py) include la libreria base del framework jQuery[jquery], i calendari jQuery (per selezionare una data, per selezionare una data ed un orario o per sel...
I need to lock a file for writing in Python. It will be accessed from multiple Python processes at once. I have found some solutions online, but most fail for my purposes as they are often only Unix based or Windows based. from filelock import FileLock with FileLock("myfile.txt"): # work with the file as it is now ...
htmlEncodeStringReplacement JavaScript performance comparison Info final compare, working! Preparation code <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script> specialString = "\\$&"; </script> <script> Benchmark.prototype.setup = function() {     var html = document.body.innerHTML...
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...
Of the pearl puzzle Comparison sort complexity In my first post I dropped a line about 525 being the theoretical minimal number of comparison required to sort a list of 100 elements without explaining it. I will do so here, and show how the same thought process can help solving the 12 pearls puzzle. Let’s got through a...
right now I'm trying to make the battleship board game as practice, and I've been using classes for the most part with a few misc standalone functions. Everything below is a standalone. I can't wrap my mind around it, this works if I attack ships in order from last to first in the list, but if you go in any other order...
i had created a python program but it was not working. this program would take in the input for a file and then display the file contents . the only error i was getting is a syntax error well i could not find the error . Please help me . the code was :- nm = input(“enter file name “) str = raw_input(“enter ur tex...
I'm using FuncAnimation in matplotlib's animation module for some basic animation. This function perpetually loops through the animation. Is there a way by which I can pause and restart the animation by, say, mouse clicks? Here is a FuncAnimation example which I modified to pause on mouse clicks.Since the animation is ...
I am using a model-based form to create a form based off a data model. The insert part works fine, but I am now trying to do the "edit" page. my problem is I need the ID/primary key of the original model for the post action and documentation (and a previous thread here) seems to have told me to try both form.id and for...
I don't really know why you want to do that, but you can install an excepthook that will be called by Python whenever an uncatched exception is raised, and in it clear the array of registered function in the atexit module. Something like that : import sys import atexit def clear_atexit_excepthook(exctype, value, traceb...
I've got a dict that has a whole bunch of entries. I'm only interested in a select few of them. Is there an easy way to prune all the other ones out? I've got a Constructing a new dict: dict_you_want = { your_key: old_dict[your_key] for your_key in your_keys } Uses dictionary comprehension. If you use a version which ...
I found one answer of resize an array in python ctypes from ctypes import * list = (c_int*1)() def customresize(array, new_size): resize(array, sizeof(array._type_)*new_size) return (array._type_*new_size).from_address(addressof(array)) list[0] = 123 list = customresize(list, 5) >>> list[0] 123 >>> list[4] 0 i...
I want a scatterplot with values exceeding a particular threshold to have another color then the ones "inside" the threshold. Here is what I wrote so far: import numpy as np import numpy.random as rnd import matplotlib.pyplot as plt n = 100 x = rnd.uniform(low = -1, high = 1, size = n) y = rnd.uniform(low = -1, ...
Suppose code like this: class Base: def start(self): pass def stop(self) pass class A(Base): def start(self): ... do something for A def stop(self) .... do something for A class B(Base): def start(self): def stop(self): a1 = A(); a2 = A() b1 = B(); b2 = B() all = ...
I have the following problem. I have a list of different text lines that all has a comma in it. I want to keep the text to the left of the comma and delete everything that occurs after the comma for all the lines in the file. Here is a sample line from the file: 1780375 "004956 , down , 943794 , 22634 , ET , 2115 , I'd...
I have a PyQt4 program that I froze using cx_freeze. The problem I am having is when I make a QGraphicsPixmapItem, which it is getting its' pixmap made from a SVG file, the Item gets made no problem, but the Pixmap doesn't load so there is no image just the item in the scene. The thing that confuses me is that this onl...
This is a good question. The problem was not obvious to me until I looked at the javadocs and realised that opencsv only supports a character as a separator, not a string.... Here's a couple of suggested work-arounds (Examples in Groovy can be converted to java). Ignore implicit intermediary fields Continue to Use Open...
1) Is there any R library/function which would implement INTELLIGENT label placement in R plot? I tried some but they are all problematic - many labels are overlaping either each other or other points (or other objects in the plot, but I see that this is much harder to handle). 2) If not, is there any way how to COMFOR...
I've just run across a fairly vexing problem, and after testing I have found that NONE of the available answers are sufficient. I have seen various suggestions but none seem to be able to return the last inserted value for an auto_increment field in MySQL. I have seen examples that mention the use of session.flush() to...
Class: ServiceResponse Inherits: ActiveRecord::Base Object ActiveRecord::Base ServiceResponse Defined in: app/models/service_response.rb Overview A ServiceResponse represents a single piece of data or content generated in response to a request. For instance, a full text link, a 'see also' link, a cover image, a library...
Well, I'd probably structure your lists a different way, but I'll get to that in a minute. To do what you want to do, you need to iterate in a more old-school way: neighbour = ['a', 'b', 'c'] scanned = [['a', 'b'],[1, 2]] localisation = [[],[],[]] for i in range(len(scanned[0])): if scanned[0][i] in neighbour: ...
The tkList Widget Wrapper Fredrik Lundh | March 2008 The tkList module is a simple wrapper for the Tkinter Listbox widget, which provides a somewhat more convenient API. The wrapper adds two things: a vertical scrollbar, and a list-based API for populating and querying the widget. When adding data to the widget, the AP...
Hizoka Re : [glade2script-GTK2] Interface graphique pour script bash ou autre. bah le principe en lui même je le pige. mais c'est son application où j'ai du mal. Il va falloir que je me penche bien sur tes exemples. Hors ligne frafa Re : [glade2script-GTK2] Interface graphique pour script bash ou autre. CouCou ! oulah ...
CyrilouGarou Création de miniatures pour dossiers d'artistes dans librairie amarok Bonjour à tous, Nous sommes nombreux à utiliser l'excellent amarok pour écouter notre zic. Amarok permet de ranger sa collection de la façon suivante (exemple de chemin pour la chanson hells bells d'ACDC) /home/cyril/Ma\ Musique/A/AC_DC/...
jibe [resolu] choix des dépôts Bonjour, Je viens d'installer ma première Ubuntu Je voudrais y installer Clamav (si, si, c'est utile pour scanner les partitions windows dont les virus ont désactivé les antivirus ;-) ) mais je me heurte apparemment à un problème de dépôts... Et pas facile de s'y retrouver dans tous ces p...
rmanf30 Re : Test de Qualité des Codecs Libre VS x264 - Septembre 2010 Ma surprise à propos des paramètres été justifiée, apparemment ils ne sont pas corrects. -sn -vcodec huffyuv -acodec flac %1.mkv J'ai le message d'erreur suivant : "Peut-être des paramètres incorrects tels que bit_rate , le taux , la largeur ou la h...
I use python to work with image processing. I'm used to cut, draw and other things, but for one image. Like in the script below, how can i aply a loop in the script to do for several images? import PIL import Image im=Image.open('test.tif') box=(50, 50, 200, 200) im_crop=im.crop(box) im_crop.show()
#2626 Le 05/01/2013, à 15:18 rvhm Re : TVDownloader: télécharger les médias du net ! bjr j'ai commencé à mettre les dépendance de tvdownloader il me manque "libkrb53 (>= 1.6.dfsg.2)" ou je pourrais le trouver ? merci Hors ligne #2627 Le 06/01/2013, à 18:23 rvhm Re : TVDownloader: télécharger les médias du net ! bonjour...
htmlEncodeStringReplacement JavaScript performance comparison Info final compare, working! Preparation code <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script> specialString = "\\$&"; </script> <script> Benchmark.prototype.setup = function() {     var html = document.body.innerHTML...
Simple Twitter Streaming API access with Python and Oauth At first go to app and create a new application. If you just want to get access on behalf of your twitter account you dont't have to go through Three Legged Authorization to get an oauth_token and an oauth_token_secret. Instead you can create the two tokens on t...
I'm looking to encrypt files using secure hashing and encryption algorithms in Python. Having used bcrypt in the past, I decided to use it for my passphrase calculator, then pass the output through SHA256 in order to get my 32 bytes of data, then use that with AES to encrypt/decrypt a file: #!/usr/bin/env python from a...
I tested this question with Sage, and the experiment suggests a clear pattern of asymptotics. Most polynomials are irreducible. Of the reducible ones, a third are of course divisible by $x$ (Edit: If 0 coefficients are allowed; see below.) An $O(1/\sqrt{d})$ fraction are each divisible by $x+1$ and $x-1$. That's becaus...
DonutMan75 [RESOLU] www et nom de domaine Bonsoir à tous, voilà j'ai une petite question qui me taraude l'esprit. Dans un nom de domaine tel que à quoi correspond le www ??? World Wide Web (cf. http://fr.wikipedia.org/wiki/Www), mais qu'est ce que ça apporte comme information ? D'après moi : - http:// >> Ca c'est le pr...
I am new to python (2nd) day and working on a problem that asks me to Write a program that reads ASCII files (asks for file name as input), checks if it has more than two words and prints out the two first words of the file on screen. Its a little vague but I am going to assume the file is all str, deliminiated by spac...
Okay, in your HTML, you have an image, and you want to make it do a little animated “bounce” to a slightly larger size when the mouse hovers over it: Here is the code to do that. First, the HTML for five yellow stars in a row. As you can see, these are just empty anchor tags with a CSS class of star. <a class="star"></...