text
stringlengths
256
65.5k
Suppose X is the input language, Z is the output language, then f is the compiler, which is written in language Y. f = X -> Z Since f is only a program, I think Y can be any language, right? So we can have compilers f1, f2, each written in Y1, Y2. f1 = f Y1 f2 = f Y2 g = Z -> M h = g . f # We get a compiler X -...
NSCA is a tool used to submit passive check results to nagios. Unfortunately, an incompatibility was recently introduced between wheezy clients and old servers. Since I don't want to upgrade my server, this caused some problems and I decided to just get rid of NSCA completely. The server side of NSCA is pretty trivial,...
Salutations. Dijkstra wrote that even a few lines of seemingly simple code could be hopelessly ambiguous. In at least one work, which I can't find now to save my life, he gave a little example program to demonstrate this ambiguity. Can anybody point me to a paper of his where he includes one of these examples? Read thi...
3rd updated version with a lot of input from the GAE group. Thanks to everyone! ER-Modeling with Google App Engine is somewhat different to "normal" modeling for a relational database. Here is a small tutorial on how to create well-known relationship models One-to-One (1:1), One-to-Many (1:n), Many-to-Many (m:n) and 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 à...
The only reason I can think of that you would need to do this in-place is that you're working under significant space constraints. If that's the case, it is possible to speed up what you've got a bit by iterating over a flattened view of the array. Since reshape returns a new view when possible, the data itself isn't c...
I have a Lenovo ThinkPad e531 laptop. This model has both a touchpad and a trackpoint. I'd like to use the Trackpoint, because I'm used to it from my previous laptop, but I'd also like to disable the touchpad, to prevent accidentally touching it. Problem is, there are no dedicated trackpoint buttons on e531. This is a ...
If you want to loop over an entire file, then the sensible thing to do is to iterate over the it, taking the lines and splitting them into words. Working line-by-line is best as it means we don't read the entire file into memory first (which, for large files, could take a lot of time or cause us to run out of memory): ...
I have a program with three threads. I call them like this: if __name__ == "__main__": while True: try: t1().start() except: log.debug('Trouble with t1 synchronizer') try: t2().start() except: log.debug('Trouble with t2 synchronizer') ...
I've been trying to use matplotLib to basically make a histogram of pixels using the image the user selects. The user select part of the image using JCROP and then when he/she his the submit button, The PlotsHandlers, post methods gets the parameters. I then crop it and try to just display the histogram using method de...
In SQLAlchemy, we can declare tables and their relations like this: user = Table( 'users', metadata, Column('id', Integer, primary_key=True)) address = Table( 'adresses', metadata, Column('id', Integer, primary_key=True), Column('user_id', Integer, ForeignKey('user.id'))) class User(object): pass cl...
I have implemented multithreaded code in two ways, but in both ways I got an error. Could someone explain what causes the problem? In version 1, I got an exception saying two arguments passed to writekey function instead of one. In version 2, one of the threads reads empty line, therefore exception is raised while proc...
I'm running a pipe of commands from a python3 program, using subprocess.*; I didn't wantto go trough a shell, for I'm passing arguments to my subcommands, and making sure these would not be misinterpreted by the shell would be nightmarish. The subprocess doc gives this example of how to do it: p1 = Popen(command1, stdo...
I'm trying to figure whats wrong with some autogenerated (with Pyste) boost::python code, but have no luck so far. There is C++ library, Magick++, which provides two classes, Magick::Drawable and Magick::DrawableRectangle: class MagickDLLDecl DrawableBase: public std::unary_function<MagickCore::DrawingWand,void> {.....
A question for the pythonistas beneath you. If this question makes no sense, please feel free to correct me. I for myself hope, that there is an answer to it, that will make my life easier. :-) I am using SQLAlchemy to populate a database and often I need to check if a orm object exists in a database before processing....
Selected ramblings of a geospatial tech nerd Best bang for your analytical buck As (geo)data scientists, we spend much of our time working with data models that try (with varying degrees of success) to capture some essential truth about the world while still being as simple as possible to provide a useful abstraction. ...
Answers I. a learning problem and reference-request. Please, see very good examples here. The code can also become useful here. Good tutorial video here. Main docs here. II. I am using DVO -layout where many keys such as " and ' are broken -- and many hotkeys are broken (things are apparently hard-coded to QWE -lay...
My data looks like this: TEST 2012-05-01 00:00:00.203 OFF 0 2012-05-01 00:00:11.203 OFF 0 2012-05-01 00:00:22.203 ON 1 2012-05-01 00:00:33.203 ON 1 2012-05-01 00:00:44.203 OFF 0 TEST 2012-05-02 00:00:00.203 OFF 0 2012-05-02 00:00:11.203 OFF 0 2012-05-02 00:00:22.203 OFF 0 2012-05-02 00:00:33.203 ON 1 2012-05-02 00:00:4...
I just ran into a problem with the snippets plugin of gedit 3.4.1 running on Ubuntu 12.04. The problem is that the snippets plugin stops working (i. e., doesn't react to keyboard shortcuts and tab-completion) when a file has an encoding other than UTF-8, e. g. ISO-8859-1. In that case, the snippets plugin doesn't work ...
I found some unexpected behavior when debugging my application. Does anyone know why I get the results described below? from google.appengine.ext import ndb class Person(ndb.Model): name = ndb.StringProperty() shared = ndb.BooleanProperty(default=False) class Department(ndb.Model): name = ndb.StringProperty() p...
I'm intending to use Python watchdog to handle a directory where files are written to, and I'm only interested in image files, trouble is I dont quite grok the code at this page. This is my attempt: from watchdog.observers import Observer from watchdog.events import PatternMatchingEventHandler class Beat(PatternMatchin...
using the following snip of code to access a url with a post. i can get it using wget and the following: wget --post-data 'p_calling_proc=bwckschd.p_disp_dyn_sched&p_term=201010' https://spectrumssb2.memphis.edu/pls/PROD/bwckgens.p%5Fproc%5Fterm%5Fdate for some reason, i'm having an issue with my python text, in that i...
I just want to programatically determine the name of an SQLalchemy model's primary key. If the model class is >>> from sqlalchemy.orm import class_mapper >>> class_mapper(User).primary_key[0].name 'id' If the model class is >>> from sqlalchemy.orm import class_mapper >>> [key.name for key in class_mapper(User).primary...
I have a simple piece of code: >>> string = "blah, lots , of , spaces, here " >>> mylist = string.split(',') >>> print mylist ['blah', ' lots ', ' of ', ' spaces', ' here '] I would rather end up with this: ['blah', 'lots', 'of', 'spaces', 'here'] I am aware that I could loop through the list and strip() each it...
As we’ve scaled Instagram to an ever-growing number of active users, Postgres has continued to be our solid foundation and the canonical data storage for most of the data created by our users. While less than a year ago, we blogged about how we “stored a lot of data” at Instagram at 90 likes per second, we’re now pushi...
import pandas df = pandas.DataFrame( {'A':['a','b', 'c'], 'B':['f', 'g', 'h']}, index=[10,20,30] ) I would expect df['A'].ix[0] and df['A'][10] both to return 'a'. The df['A'][10] does return 'a', but df['A'].ix[0] throws a KeyError: 0. The only way I could think of to get the value 'a' based on the index...
I was running ipython successfully on fedora 18 until now: I'm getting the following exception when trying to launch it: Traceback (most recent call last): File "/usr/bin/ipython", line 9, in <module> load_entry_point('ipython==1.1.0', 'console_scripts', 'ipython')() File "/usr/lib/python2.7/site-packages/IPyth...
I found a recipe in English that mentions a "pinch" of something. English is not my first language, and Google shows that "pinch" has many meanings. Do I have to pinch it with my fingers, or can i find a suitable amount of milliliters to use? A 'pinch' is the amount of powder/whatever that can be trapped between one's ...
Define Projection (Data Management) Summary This tool overwrites the coordinate system information (map projection and datum) stored with a dataset. The only use for this tool is for datsets that have an unknown or incorrect coordinate system defined. All geographic datasets have a coordinate system that is used throug...
I normally use nested dictionaries, but I'd like to move into classes and objects. I have a list of home work grades that look like: assignment_name assignment_subject student_name due_date grade grade_pct rank I'd like to make an object that holds all the students and each students holds all of their assignments detai...
Your second loop example is flawed. You will never want to write code like that because there are many common parts of your game that must run on each main loop iteration. More likely you'd end up with something like: MainLoop(): while not_quit: PumpOSMessages() PreFrameCommonUpdate() if is_day: Upd...
I am trying to save large files from Google App Engine's Blobstore to Google Cloud Storage to facilitate backup. It works fine for small files (<10 mb) but for larger files it get gets unstable and GAE throws and FileNotOpenedError. My code: PATH = '/gs/backupbucket/' for df in DocumentFile.all(): fn = df....
I'm currently writing a telnet server in Python. It's a content server. People would connect to the server via telnet, and be presented with text-only content. My problem is that the server would obviously need to support more than one simultaneous connection. The current implementation I have now supports only one. Th...
In arcgis 10 and python I want to get the extent (xmax, ymax, xmin, ymin) info of each of the polygons in a shape file. I can get the extent of the whole shape file using file=r"D:\SCRATCH\ARCGIS\100k_trc_tiles_TVM.shp" desc=arcpy.Describe(file) print desc.extent.Xmax 394551.52085039532 But I can't seem to figure out ...
I've recently purchased the Milkman StoreKit native extension for in-App purchasing on iOS. I'm having issues with initialising the StoreKit on my iPhone 4S. I've followed the instructions in the Milkman games example and my code looks like this: log("Is Supported " + StoreKit.isSupported()); if(StoreKit.isSupporte...
std::wstring text; hWndEdit = CreateWindowExW (WS_EX_CLIENTEDGE, TEXT("Edit"), _T("that's a test"), WS_CHILD | WS_VISIBLE | ES_MULTILINE |ES_AUTOHSCROLL | ES_AUTOVSCROLL, 100, 20, 340, 80, hWnd, (HMENU)IDC_TEXT_EDIT, NULL, NULL); (...) getText(hWndEdit, &text); TRACE(CTrace::NIV_DEB, "["<<narrow...
Hello World All of these examples assume you have access to a Yhat instance (either through the public sandbox or enterprise) and a Yhat username and apikey. To signup for the sandbox version of ScienceOps, go here You'll also need to have the Yhat client library installed $ pip install -U yhat. Deploying Your First Mo...
I want to simply access the database of mysql through python.But when I am running this code : import MySQLdb db = MySQLdb.connect(host = "127.0.0.1", port = "3306", user="Bishnu", passwd = "Pulchowk", db = "student") cursor =db.curs...
I have my two class in two separate files, customer and address. Address is going to be used in other places for instance vendors have addresses. The customer class needs to reference the address class in three ways. A customer has a default ship to address (one to one) a default bill to address (one to one) and his a ...
Here's the structure I'm working with. directory/ script.py subdir/ __init__.py myclass01.py myclass02.py What I want to do is import in script.py the classes defined in myclass01.py and myclass02.py. If I do: from subdir.myclass01 import * It works fine for the class defined in myclass01.py. But with this solution if...
McPeter Re : Un 'autre' générateur de sources.list en ligne Je viens de rectifier le soucis sur le nom du fichier bash. Par contre je ne vois aucun soucis à l'exécution :\ pourrais tu me dire quel navigateur tu as utilisé et quel message d'erreur ça te renvoit ? (un copié/collé du message) le chmod +x est inutile là pu...
I want to do disguised LSA attacks on OSPF network and be able to more analyze, so I do not know how it works in practice. This is a penetration test. The attack is described in the address [+]. I have run the network are as follows: Source program in accordance with the above photo are as follows: #!/usr/bin/env pytho...
I am attempting to access some functions in file that's one directory below the file where I want to use them. I am looking to do this in a dynamic fashion, as I will not know prior to runtime which functions the user will want to use. I will ask the user for a particular scenario, for example, and if they request the ...
I'm developing a key generator that generates RSA signatures that are to be downloaded to the clients computer. In the clients computer i would like to use a RSA signature and a public key to validate the string. What i would like to know, if you can help, is what is the algorithm that i should use to get the signature...
Python mauiman2 — 2012-07-23T19:04:21-04:00 — #1 I am a pro at front end development but am just now starting on a project that requires first time usage for me of Python/Django/Github as well as MySQL (which I used one time before about four years ago). I have a lot of this set up but have a few newbie questions to as...
nathéo Re : /* Topic des codeurs [8] */ Arf, j'ai oublié de traiter son cas je crois. C'est rarement par le sarcasme qu'on élève son âme.Le jus de la vigne clarifie l'esprit et l'entendement. De quoi souffres-tu ? De l'irréel intact dans le réel dévasté ? N'oubliez pas d'ajouter un [RESOLU] si votre problème est réglé....
Make the changes in models.py and then run ./manage.py schemamigration --auto myapp When you inspect the migration file, you'll see that it deletes a table and creates a new one class Migration(SchemaMigration): def forwards(self, orm): # Deleting model 'Foo' ...
When I try to upgrade from 12.10 to 13.04 I get this error: Checking for a new Ubuntu release Traceback (most recent call last): File "/usr/bin/do-release-upgrade", line 145, in <module> fetcher.run_options += ["--mode=%s" % options.mode, AttributeError: type object 'DistUpgradeFetcherCore' has no attribute 'run_opti...
I'm working with a pice of software written in python from US CERT to do some fuzzing. Included in the software is a minimizer.py tool which is designed to be ran against certain test cases that cause crashes in order to determine exactly which byte mutations are causing the crash. However when attempting to run the to...
Numerical Python For the past few months, I've been covering different software packages for scientific computations. For my next several articles, I'm going to be focusing on using Python to come up with your own algorithms for your scientific problems. Python seems to be completely taking over the scientific communit...
I am working with a Python class, and I don't have write access to its declaration. How can I attach a custom method (such as __str__) to the objects created from that class without modifying the class declaration? EDIT:Thank you for all your answers. I tried them all but they haven't resolved my problem. Here is a min...
bishop Re : Qarte arte.tv browser (ex Qarte+7) VinsS ! J'ai réinstallé Qarte. Avant de lancer Qarte j'ai refait un test avec rtmpdump... pas de problème. J'ai supprimé le dossier caché .qarte puis testé Qarte: bishop@JC:~/Bureau$ qarte -d lang: /usr/share/locale/fr/LC_MESSAGES/qarte.mo 11:44:14: WARNING - utils Config ...
g_barthe interface python et apprentissage boa constrictor Bonjour, Je voudrais commencer à developper qq applications (avec interfaces graphiques) en python (pour windows et linux). Je recherche donc un éditeur qui permettrait de realiser l'interface de maniere simple et non en code pur. J'ai bien trouvé "wxglade" mai...
How do I make a Logger global so that I can use it in every module I make? Something like this in moduleA: import logging import moduleB log = logging.getLogger('') result = moduleB.goFigure(5) log.info('Answer was', result) With this in moduleB: def goFigure(integer): if not isinstance(integer, int): log....
#2301 Le 28/10/2012, à 16:38 ynad Re : TVDownloader: télécharger les médias du net ! Re @11gjm la liste des correctifs, dans la dernière il y a 4h les deux nouveaux fichiers main.py (v 0.9.3) et PluzzDL.py qui permettent le changement url @+ Hors ligne #2302 Le 28/10/2012, à 16:56 11gjm Re : TVDownloader: télécharger l...
Ce cours est visible gratuitement en ligne. Ce cours existe en livre papier. Ce cours existe en eBook. Vous pouvez obtenir un certificat de réussite à l'issue de ce cours. J'ai tout compris ! Maintenant que vous commencez à vous familiariser avec la programmation orientée objet, nous allons pouvoir aller un peu plus vi...
I am wondering if there is a way to determine (given a variable containing a lambda) the number of parameters the lambda it contains. The reason being, I wish to call a function conditionally dependent on the number of parameters. What I'm looking for def magic_lambda_parameter_counting_function(lambda_function): "...
Lets say I have path to a module in a string module_to_be_imported = 'a.b.module' How can I import it ? >>> m = __import__('xml.sax') >>> m.__name__ 'xml' >>> m = __import__('xml.sax', fromlist=['']) >>> m.__name__ 'xml.sax' You can use the build-in import sys myconfigfile = sys.argv[1] try: config = __import__(my...
I would like my application to store some data for access by all users. Using Python, how can I find where the data should go? If you don't want to add a dependency for a third-party module like winpaths, I would recommend using the environment variables already available in Windows: Specifically you probably want e.g....
I want to convert mp4 video to mpeg Ts2. What's the best way to do it and preserve HD quality? Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'How to Get the Newest Smartphones from AT&T - YouTube.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 creation_time : 2013-09...
No, there is no standard guideline But there are some techniques that can make a function with a lot of parameters more bearable. You could use a list-if-args parameter (args*) or a dictionary-of-args parameter (kwargs**) For instance, in python: // Example definition def example_function(normalParam, args*, kwargs**):...
I need to create a DateTime object that represents the current time minus 15 minutes. import datetime and then the magic timedelta stuff: In [63]: datetime.datetime.now() Out[63]: datetime.datetime(2010, 12, 27, 14, 39, 19, 700401) In [64]: datetime.datetime.now() - datetime.timedelta(minutes=15) Out[64]: datetime.date...
So if you're like me, you're 5'10" and sport a ruggedly awesome beard. And if you're really like me, you swallowed theT/BDD pill years ago and have struggled to test on 15 to 20 projects trying to reallyfeel like you're experiencing those advantages. I'm not going to write a "why you should be using TDD" blog, that's b...
I have some doubts here... Imagine that I have 3 classes: class CarSpec(models.Model): x = models.IntegerField(default=20) y = models.CharField(max_length=100, blank=True) z = models.CharField(max_length=50, blank=True) chassis = models.ForeignKey(Chassis, unique=True, limit_choices_to={'type':'A'}) ...
I a have a question about PRNGs and this is my very first experience with them. I have the following generator that takes a 56-bit seed $p$ during initialization and then chooses both $X$ and $Y$ randomly from the interval $[0, p]$. Every time it is called, it returns the output of the next function: def next(self): ...
pandageek MCedit pour minecraft bonjour a tous, je joue à minecraft version linux sous xubuntu et j'aimerai pouvoir utiliser le logiciel MCedit qui sert a éditer les cartes du jeu. or il ne fonctionne pas malgré mes tentatives : panda@panda-USB:~/Bureau/MCEdit-stable33-linux$ ./mcedit.sh RuntimeError: Bad magic number...
I am attempting to parse a maven project definition using python to extract a version. The project definition looks like: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://m...
Databases brandonbuster — 2013-05-22T09:48:58-04:00 — #1 All I want is a single random value from this MySQL query. Both the outer inner and outer queries reference the same table but I'm assigning them different aliases. Yet, this query is still performing like a correlated subquery, often returning multiple results. ...
Maisondouf Re : Postfix est en train de me rendre fou ... Pourtant à première vue, ce que tu veux pouvoir gérer n'est pas spécialement complexe mais je ne sais peut-être pas tout. ASUS M5A88-v EVO avec AMD FX(tm)-8120 Eight-Core Processor, OS principal Precise 12.04.1 LTS 63bits½ Bricoleur, menteur, inculte, inadapté s...
I get an error on the following code and I don't understand what is wrong with it. I am just trying to learn how to do this, and this was a test. I can't figure out what is wrong or how to fix it. print "Would you like to see today's weather?" answer = input if answer = "yes": print "Follow Link: http://www.weather...
I have this Django model: class Log(models.Model): idlog = models.CharField(max_length=16L, db_column='idLog') # Field name made lowercase. idhandle = models.CharField(max_length=16L, db_column='idHandle') # Field name made lowercase. idprevious = models.CharField(max_length=16L, db_column='idPrevious', bla...
I have 50+ Watir test scripts which currently just check a specific URL which is defined inside each of them. Now we are launching 4 more sites and would like to run these tests on all 5 sites. To maintain 5 packs of 50+ tests would be a nightmare in the future. Is there a way I can pass a variable to all of the indivi...
We have a object method that returns a city/state tuple, i.e. ('Boston', 'MA'). Under some valid circumstances, there is no valid city/state to return. Stylistically, does it make more sense to return None, or a two element tuple containing (None, None) in that case? I would return It is also easier to test: result = g...
What is the best way to create rounded corners using CSS? Since CSS3 was introduced, the best way to add rounded corners using CSS is by using the If you are using a browser that doesn't implement I looked at this early on in the creation of Stack Overflow and couldn't find border-radius: Which is exactly how you'd wa...
How to build a login form on the startingpage within a little widget on the top left? I want to have a stylish web 2.0 like login...on the upper right sliding in (like on dropbox.com)...so far the design part... when it comes to the views and default login behavior of django (1.4) i can't get myself to the right direct...
Maisondouf Re : Postfix est en train de me rendre fou ... Pourtant à première vue, ce que tu veux pouvoir gérer n'est pas spécialement complexe mais je ne sais peut-être pas tout. ASUS M5A88-v EVO avec AMD FX(tm)-8120 Eight-Core Processor, OS principal Precise 12.04.1 LTS 63bits½ Bricoleur, menteur, inculte, inadapté s...
Unless a reply can be a reply to multiple posts, a ManyToManyField isn't what you want. You just need a ForeignKey: class Discussion(models.Model): message = models.TextField() reply_to = models.ForeignKey('self', related_name='replies', null=True, blank=True) Then you can get to a Discussion's replie...
ubuntuforce module turtle pour pygame [cherche testeurs] Salut les Ubuntues développement et programmation, Je vous invite mes amis pythons de bien vouloir tester le module que j'ai créer pour pygame: Un module permettant d'utiliser les fonctions d'une tortue dans pygame comme nommé curser (turtle étant déjà pris): -mv...
In short, I'd like to convert a ImageTk.PhotoImage object to either a Image (PIL) object or numpy array. Knowing that you can convert a Image (PIL) object to a numpy array with numpy.asarray(). I'm given a numpy array and can display it in Tkinter like: from Tkinter import * import numpy as np import Image, ImageTk ...
I know of the non-standard %uxxxx scheme but that doesn't seem like a wise choice since the scheme has been rejected by the W3C. Some interesting examples: The heart character. If I type this into my browser: http://www.google.com/search?q=♥ Then copy and paste it, I see this URL http://www.google.com/search?q=%E2%9...
In my Django-template: <div class="A"> {% url renders_data object.id %} </div> <div class="B"> {% render_data object.id %} </div> Div A is common way to call a method in views.py whereas Div B is for template tags. User will open a link. Let's say: /myapp/test/ a page will open contain two template tag section...
Getting Loopy with Python and Perl Pages: 1, 2 Aside from the lack of assignment, Python's while loops function almost identically to their Perl counterparts: Perl: $done = 0; while (!$done) { $input = getInput(); if (defined($input)) { process($input); } else { $done...
Sissio Boot kernel 3.5.0-17 Bonjour, Ce matin j'ai eu la mise à jour du kernel en version 3.5.0-17 sur voyager 12.04 Lts. Lors du reboot l'animation de démarrage se charge correctement et avant d'arriver sur le bureau cela reste figé et je perd totalement la main car même le clavier ne répond plus. La seule solution qu...
The source data is clearly UTF-16. In your post it is displayed interpreted as ISO-8859-1, and has become slightly mangled in the process - some bytes have been converted to �. There are also either some missing bytes caused by the copy-paste, or there are some control bytes in the middle of the sequence, which disru...
Etoma Re : /* Topic des codeurs [7] */ Écrire du code est très exigeant. C'est plaisant. Hors ligne tshirtman Re : /* Topic des codeurs [7] */ si les experts d'haskell peuvent l'aider… (j'aime bien ce gars… c'est le mec qui code git-annex et upload des paquets debian depuis un netbook tournant à l'énergie solaire dans ...
All right, still with these integration problems, and I don't know all the subtleties of passing extra-arguments to Maxima (ok, I reckon that @kcrisman doesn't stop pointing out Maxima flags now and then when some expert uses them but some list would be very handy). What I want is to integrate a function with the domai...
I have spent at least two hours now trying to get this to work. I have seen quite a few different questions on SO and in the Google groups, but none of the answers seem to work for me. Question: How do I bulk upload data as in the CSV file below to the datastore to create entities that have the key_name defined in the ...
I've been scouring the Blender Python API docs for 2.69x for a replacement to the 2.4x API's Mesh.getFromObject method. I can't find any way to get a fresh copy of a mesh with modifiers applied in advance. The option to apply modifiers is common for exporters included with Blender, so you can check how they do it. Typi...
Just want to provide a solution of problem I’ve faced, maybe it will be usefull for someone. Issue is next: We need to connect to remote ftp server, download and delete existing files. Look’s easy, let’s use standard library ftplib: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 from ftplib import FTP import os def get_data...
Web servers started as a solution to getting information from other sites. Then it became convenient to use HTML and HTTP on one's local-area network, and for some reason we had to call that idea an 'intranet' to make people pay attention. Sometimes it is useful to run a mini-server on the same computer as your desktop...
Hi! I use the latest xfce version on my Laptop and I' m experiencing an annoying issue: the xfce menu bar freezes quite often (note: mostly the rest of the taskbar works fine) - by freezing I mean that my mouse clicks are "ignored". I click but nothing happens. To temporary fix this problem I need to click on the Taskb...
I recently just found soya3d. I want to import .obj files, but it seems to only accept .data files. How can I import .obj files? Importing a .obj file named "house" produces this error: Traceback (most recent call last): File "introduction.py", line 7, in <module> model = soya.Model.get("house") File "/us...
This IPython notebook show some features of the Python Nazca library : Once you have created your datasets, and define your preprocessings and blockings, you can use the BaseAligner object to perform the alignment. The BaseAligner is defined as: class BaseAligner(object): def register_ref_normalizer(self, normalize...
kevlar Ella : projet de logiciel d'animation Flash & SVG pour Linux Le projet est aujourd'hui bien avancé : version 0.3.1.2 au 2 Novembre 2010 ! Ella (Elegant Light Linux Animator) est un projet amateur destiné à fournir à la communauté linuxienne un générateur d'animations Flash & SVG wysiwyg, fonctionnel, léger, bien...
I came back to this problem again (still on Natty); so I thought I'd post my results. First, I started looking up if you can run Gnome applets from the command line, and in a separate window - turns out, this was a technique for debugging Python applets; This is the script: import sys import gtk import pygtk pygtk.requ...
This is not easy to do vectorize further (as far as I see), unless id has some structure. Otherwise a bottleneck might be doing id==dummy often, but the only solution I can think of would be the use of sorting, and due to the lack of a reduce functionality for np.max() still requires quite a bit of python code (Edit: T...
I have a directory with several levels of sub-directories. All the files in the directories are html files (approx. 500 in total), and I'd like to go through each file to see if if contains a "sub_middle_1col" division. I found a great tutorial at palewire.com and have used that as my base. The two difficulties I am ha...
Mornagest [Résolu] Pilotes Nouveau sur 12.04 refusent de s'installer Salut les gens, J'ai constaté avec effarement que j'ai des pilotes proprio nVidia installés sur ma machine, ce qui ne m'intéresse absolument pas. J'ai donc voulu les remplacer par les pilotes Nouveau, mais... impossible de les installer :~$ sudo apt-g...
I was bitten by the following numpy behaviour: In [234]: savetxt(open('/tmp/a.dat', 'wt'), array([1, 2, 3])) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-234-2adef92da877> in <module>() ----> 1 save...
There was no thorough answer concerning Python3 time, so I made an answer here. As provided in other answers, there are 4 basic scopes, the LEGB, for Local, Enclosing, Global and Builtin. In addition to those, there is a special scope, the class body, which does not comprise an enclosing scope for methods defined withi...