text
stringlengths
256
65.5k
Is it possible to draw a graph of a Sesame RDF database using RDFLIB? This is what I tried: endpoint = "http://127.0.0.1:8080/openrdf-workbench/repositories/movies/explore?resource=%3Cfile%3A%2F%2Fmovies_export.rdf%3E" from rdflib import Graph g = Graph() g.parse(endpoint) This is the error: Traceback (most recent cal...
I am really struggling with this language issue. I went to System->Administration->Language Support and moved Turkish (Türkçe) to the top. Then I clicked "Apply System-wide" and restarted. However, after restarting, echo $LANG reported en_US.utf8, so I logged out and back in - and now it reports tr_CY.utf8. Now here'...
johnatan57950 Re : [tuto]Installation de Dofus 2.0 par paquet debian et rpm (pour la doc) bj quand je clique sur l'icone dofus je suis venue a telcharger dofus mise a jours et tout le reste et une fois fini je clique sur jouer et sa me met adobe air L'installation de cette application est endommagée. Essayez de la réin...
There must be a way to do this query through the ORM, but I'm not seeing it. The Setup Here's what I'm modelling: one Tenant can occupy multiple rooms and one User can own multiple rooms. So Rooms have an FK to Tenant and an FK to User. Rooms are also maintained by a (possibly distinct) User. That is, I have these (sim...
I have a custom Sequence type. It is essentially a wrapper for a list plus a boolean flag and I wanted it to emulate usual immutable sequence behavior. My issue is with slicing. I understand that in Python 3 the way to implement it is to have a __getitem__(key) method that returns an item if %key is a single index and ...
A set is an unordered data structure. Don't use a set, but rather collections.OrderedDict: >>> a = collections.OrderedDict.fromkeys([1, 2, 20, 6, 210]) >>> b = collections.OrderedDict.fromkeys([6, 20, 1]) >>> collections.OrderedDict.fromkeys(x for x in a if x not in b) OrderedDict([(2, None), (210, None)]) Note that t...
Sorry for a newbie question but I could not figure out how to print a text which a user enter in a GTKEntry field after he press a button. I design my app with glade, a simple TextEntry Field and a button. After I change the code of myappWindow.py: def on_button1_clicked(self, widget, data=None): print 'pressed' ...
vince06fr Re : Nettoyage dans les noyaux (kernel) Umuntu : Si tu veux prendre le temps de traduire ce script, surtout ne te gêne pas comme tout est "hardcodé" dans le script, la seule chose à faire est... De modifier l'ensemble des textes en français présents dans le script pour les mettre en anglais. Une fois le scrip...
I want to programmatically determine if the current user (or process) has access to create symbolic links. In Windows (Vista and greater), one cannot create a symbolic link without the SeCreateSymbolicLinkPrivilege and by default, this is only assigned to administrators. If one attempts to create a symbolic link withou...
Dernière news : Fedora-Fr aux 15èmes Rencontres Mondiales du Logiciel Libre Ou plutot 2.7.0 Savez vous pour quelle version de Fedora elle sera intégrée et aussi si il est possible de la tester sous Fedora 12 (avec RPM, j'ai pas le temps de la compiler en ce moment...) Car j'en ai ras le bol d'utiliser toshop, et comme ...
I've tried some suggestions from similar questions etc. None of it helped my situation. I'm using Facebook.py Licensed under the Apache License in Google App Engine with Python solution. I've the GraphAPI object created with the valid access token which was mine. And it was shown in App Engine log: Graph >>> facebook.G...
I try to build a very simple website where one can add data into sqlite3 database. I have a POST form with two text input. index.html: {% if top_list %} <ul> <b><pre>Name Total steps</pre></b> {% for t in top_list %} <pre>{{t.name}} {{t.total_steps}}</pre> {% endfor %} </ul> {% else %...
this says, it should be straight forward [as] long as your local Python has SSL support. If you use just HTTP Basic Authentication, you must set different handler, as described here. Quoting the example there: import urllib2 theurl = 'http://www.someserver.com/toplevelurl/somepage.htm' username = 'johnny' password = 'X...
Welcome to Python 2.7! This is the online help utility. ... >> help() help> modules Please wait a moment while I gather a list of all available modules... /usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed import gobject._go...
I have created a custom QDialog class and overridden the closeEvent to just hide the dialog as it is a child of another widget. My dialog must only close when its parent is closed and not when it's accepted, rejected or the user clicks the close button. This all works fine but now I need to open a connection to a datab...
When Foo.__contains__ is not defined: a['bar'] calls Foo.__getitem__, which executes self[key] = data This calls OrderedDict.__setitem__, which is defined this way: def __setitem__(self, key, value, PREV=0, NEXT=1, dict_setitem=dict.__setitem__): 'od.__setitem__(i, y) <==> od[i]=y' # Setting a new item crea...
I have seen few py scripts which use this at the top of the script. In what cases one should use it? import sys reload(sys) sys.setdefaultencoding("utf-8") As per the documentation: This allows you to switch from the default ASCII to other encodings such as UTF-8, which the Python runtime will use whenever it has to d...
I recorded one script using Selenium IDE which contain clicking on a link and now i want to add loop to run same script multiple time, for this i am converting script to python but unable to add loop.Please help me in this regards. Heres some text direct from selenium docs: # Collection of String values source = open("...
gtk.Border — an object containing data for a border (new in PyGTK 2.4) class gtk.Border(gobject.GBoxed): def copy() def free() All attributes are available in PyGTK 2.16 and above. This object is available in PyGTK 2.4 and above. Starting with PyGTK 2.16 you can also treat gtk.Border objects as sequences of 4 ...
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...
The following code causes a segmentation fault after printing the string: #include <iostream> using namespace std; int main() { cout << "ndktest" << endl; return 0; } If I change cout to printf, it doesn't crash. If I call cout in a different function other than main, and that function is never accessed, it st...
I trying to do a Qtreewidget to attend a customer design suggestion. I am coding it on QtPython. I did a first try using Qt Designer, then generated the code. But when I try to run it, an error comes out: self.centralwidget.setSortingEnabled(__sortingEnabled) AttributeError: setSortingEnabled I googled around, but did...
Is there a python library out there than can allow me to send UDP packets to a machine (sending to localhost is ok) from different source addresses and ports? I remember that one existed, but can't find it anymore. You can spoof an IP address using Scapy library. Here's an example from Packet Wizardry: Ruling the Netwo...
There are two important one line idioms in Python that help make this "straightforward". The first idiom, use zip(). From the Python documents: The left-to-right evaluation order of the iterables is guaranteed. This makes possible an idiom for clustering a data series into n-length groups using zip(*[iter(s)]*n). So ap...
I'm looking for a script (Perl, Python or batch would be fine) that will go through a designated file tree and renames all the child files. For example, Folder1>File1.anytype becomes Folder1>Folder1File1.anytype. Thanks You mention a batch file, which probably means that you are on Windows (I assume you refer to a .bat...
I want to implement a symbol type, which keeps track of the symbols we already have(saved in _sym_table), and return them if they exist, or create new ones otherwise. The code: # -*- coding: utf-8 -*- _sym_table = {} class Symbol(object): def __new__(cls, sym): if sym not in _sym_table: return s...
I've got the following installed through MacPorts on MacOS X 10.5.6: py25-sqlite3 @2.5.4_0 (active) python25 @2.5.4_1+darwin_9+macosx (active) sqlite3 @3.6.12_0 (active) python25 is correctly set as my system's default Python. I downloaded a fresh copy of Django 1.1 beta (I have the same problem with 1.0 and trunk, th...
Gemnoc Re : Logiciel de CAO 2D/3D (Conception Mecanique) Une autre demande pour Ellypsis, pourrais-tu démarrer FreeCAD de cette façon dans le terminal : freecad --write-log Ceci va enregistrer un fichier journal FreeCAD.log dans le dossier ~/.FreeCAD, ouvres-le et postes le contenu ici. J'ai testé rapidement le Sketch...
In Snow Leopard the Play / Pause media button (on the F8 key) opens up iTunes. How can I disable that? Preferably keeping the old Leopard behaviour, so I can use it to control other media applications (e.g. Spotify). a better temporary fix is to start quicktime and just have it running(not playing a movie) in the backg...
JavaScript macaela — 2011-07-19T17:49:29-04:00 — #1 Hi i have the following function that display a list depending on the drop down option the user selects but doesnt not work on explorer it works on other browsers but on exploere i get the following error SCRIPT600: Unknown runtime error manitest.html, line 76 charact...
ubuntiny [Résolu] Problème avec arista Salut à tous! Voilà le problème: j'ai essayé d'installer arista, un encodeur permettant de manipuler les vidéos (encodage, modification du format de lecture etc...), mais après installation, lorsque je clique sur le raccourci arista situé dans le menu applications de gnome, ou lor...
enebre Re : Gmediafinder : Youtube/dailymotion/vimeo.. sans flash et bien plus.... bonjour smo, je viens de réinstaller gmf sur mon petit netbook et git clone git://github.com/smolleyes/gmediafinder2.git gmf2 cd gmf2/Gmediafinder python gmediafinder.py je constate que python-mecahanize n'est plus intégré dans les deps...
Hay, i was wondering how to get the current URL within a template. Say my URL was /user/profile/ How do i return this to the template? Thanks You can fetch the URL in your template like this: <p>URL of this page: {{ request.get_full_path }}</p> or by If you need the You must also from django.conf.global_settings impo...
evoMPS simulates time-evolution (real or imaginary) of one-dimensional many-particle quantum systems using matrix product states (MPS) and the time dependent variational principle (TDVP). It can be used to efficiently find ground states and simulate dynamics. The evoMPS implementation assumes a nearest-neighbour or nex...
blob: 6f93786965a93ddfef21fde56e7c3163b6ed5eed ( plain ) #!/usr/bin/python2 import os,sys import argparse import subprocess import shutil import glob from lxml import etree debug = False mergeLog = open("/var/tmp/merge.log","w") def headSHA1(tree): head = None hfile = os.path.join(tree,".git/HEAD") if os.path.exists...
[ ok I edit my question since I just got answers corresponding to the first lines of my previous post, and actually this was not the question... so if you post smtg please test before and read the whole thing before thinking I need to know how to test paths in python ;) ] the whole script, which is detailed below : htt...
I have the following bottleneck and am wondering if anyone can suggest ways to speed it up. I have three lists x,y,z of length N. and I apply the following summation. def abs_val_diff(x1, x2, x3, y1, y2, y3): """ Find the absolute value of the difference between x and y """ return py.sqrt((x1 - y1) ** 2.0 + (x2...
June 18th, 2014 So here is another project that I’m working on. This is just going to be a short post because a few people have asked for more information and code (what there is). What it is: Two zone temperature/humidity monitor with custom case for my wife’s orchid tank. Orchids have unique environmental requirement...
New to Ubuntu. In the other sofware sources i have "Debian 4.0 eth" officially supported "non-us.debian.org/"; etc ... "ppa.launcpad.net" and installing applications has stopped working. I think i first came across this problem after installing Blender 2.58 When using update manager it is prompting for a partial upgrad...
#1 Kopretinka žeby jejím jménem? vysledek:=ExtractText(zadani,znak1,znak2); napriklad: vysledek:=ExtractText('nejaky text','j','x'); melo by to vratit: vysledek='aky te' #1 wrany Skutečné parametry funkcí a procedur jsou v jazyce C předávány pouze hodnotou, tj. hodnota skutečných parametrů je zkopírována na zásobník (p...
The Software Center has a section of For Purchase programs —see screenshot below—, which is annonying me every time I want to install something. Is there any way to remove or hide these programs from the Software Center? Links to answers: The Software Center has a section of Is there any way to For 12.04 1. Ignore the ...
vvf Re : [résolu] install clé wifi WG111v2 sur modem routeur netgear DG834Gv3 je retrouve qqch de normal pour : $ ndiswrapper -lInstalled ndis drivers:net111v2 driver present, hardware present j'avais oublier de désactiver du network manager... Je l'avais oublié celui-là ... J'ai essayé de resuivre le tuto sans succès....
When trying to install virtualenv using a brewed python, I get the following error: $ pip install virtualenv Requirement already satisfied (use --upgrade to upgrade): \ virtualenv in /Library/Python/2.7/site-packages/virtualenv-1.9.1-py2.7.egg Cleaning up... So clearly pip is somehow looking into the system python f...
Perhaps someone more fluent in Python's Multiprocessing Pool code could help me out. I am trying to connect to several hosts on my network simultaneously (N at any one time) over a socket connection and execute some RPC's. As one host finishes, I want to add the next host into the Pool to run until all are complete. I ...
Chris__ Re : gReemote, télécommande + prog TV pour Freebox HD Merci tocks. Je pense aussi que la meilleur des solutions serait de minimiser dans la zone de notif quand on ferme la fenêtre. Je vais regarder ça dès que j'aurai un peu de temps. Pour réduire la fenêtre j'ai peur que ca commence à compliquer pas mal l'appli...
I've been trying to combine 2 videos together with gstreamer with a short transition (like smpte) between them using gstreamer & gnonlin in python. However I can't get the gnloperation/smpte transition to work. Goal Below is a programme. I want it to play the first 4 sec of one file, and at 2 sec to start doing a smpte...
Basically I just need to figure out how to produce modes (numbers occurring most frequently) from a list in Python, whether or not that list has multiple modes? Something like this: def print_mode (thelist): counts = {} for item in thelist: counts [item] = counts.get (item, 0) + 1 maxcount = 0 maxitem = Non...
Application processors Other languages : français | ... Application processors allow the programmer to execute common code before each request is processed. This is helpful for authentication schemes or for setting up user state on each request. Multiple processors can be added per application, and they will be execute...
THE PROGRAMMER'S QUICK GUIDE TO THE LANGUAGES The proliferation of modern programming languages (all of which seem to have stolen countless features from one another) sometimes makes it difficult to remember what language you're currently using. This handy reference is offered as a public service to help programmers wh...
You can Manually set the governor by running the cpufreq-set command (as root). Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the commands below. sudo cpufreq-set -c 0 -g ondemand To install cpufreq: sudo aptitude install cpufrequtils cpufrequtils includes a daemon which allows users to ...
I'm currently developing a game in Python + Pygame and i came up with a problem with the player and the platforms. The game is a 'runner' where the player it's fixed (The 'x' position isn't variable, only the jump). This is how i'm currently doing the collisions managment: def collide(self, yvel, platforms): for p ...
Inspired by David Beazley’s Keynote at PyCon, I’ve been digging around in code objects in Python lately. I don’t have a particular axe to grind, nor some particular task to solve (yet?), so consider this post just some notes and ramblings that might be of interest (and my apologies if not). Disclaimer: This post is abo...
i have a drop down list that i add items to it,i ask the user to type in brand name and check first if that brand is already found on the drop down list if yes prints a message if no do some actions. here is the code: def add_brand(self,x): self.elem=self.driver.find_element_by_id('MainContent_txtBrand') self...
I'm trying to access two legacy de/compression functions from Python that are written in C and are currently available via a DLL (I have the C source). The functions are passed a (partially) populated C struct and use this information to either compress or decompress the data in the buffer provided. This is how the fun...
I am using a local DHCP and DNS server on my home network on a linux machine. It is running CentOS 6.3 with dnsmasq 2.48. It's all working fine except for local DNS lookups for Windows machines only. I have a mix of Ubuntu, CentOS and Windows machines on the network, some virtual, some physical. I have a machine called...
For my assingment I'm supposed to create a file of precomputed hash values from a given dictionary with a salt of 0 - 255 to each password. I have the hashes, but when I try to compare them with the given shadow file, I get nothing. This leads me to believe I'm perhaps hashing incorrectly? My professor did say that the...
Kanor Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... D'aprés ce que je comprend Salome utilise code_aster Sinon pdf qui me semble intéressant http://calcul.math.cnrs.fr/Documents/Journees/dec2006/aster.pdf ça date un peu 2006 Hors ligne ossatureLibre Re : Idée projet Logiciel RDM Eurocodes Str...
If you have a circle with center (center_x, center_y) and radius radius, how do you test if a given point with coordinates (x, y) is inside the circle? In general, Please note that points that satisfy the above equation with You can use Pythagoras to measure the distance between your point and the centre and see if it'...
I was using Win8 and installed Ubuntu 12.10... There is an entry in GRUB for W8, but when selecting it - GRUB comes back again, so Windows never boot up. I can only launch my Ubuntu. /dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT /dev/sda2 206848 123086847 61440000 7 HPFS/NTFS...
Boost.Wave offers a standard C++ lexer among many other tools like a standard preprocessor which are built on top of Boost.Spirit. Check the following sample in the boost directory: C:\boost\libs\wave\samples\lexed_tokens For example, if you have the following file which is called main.cpp: int main() { double PI =...
If i extract video file resolution of 320x240 , text on it is looking good and readable. in case if i give input video of resolution 1280x720 or any greater values. Text on it not readable. it resize or sacles but text is looking bad. Is it possible to apply text filter after image converted or any method available. pl...
hy I need to add a property to a model that can reference 4 different models: class WorldObject(db.Model): # type can only accept: text, image, profile, position # this should be like a set property in relational database and not a string type = db.StringProperty(required = True) # ???: this can be a re...
I just discovered a different behavior of Python logging, depending on if I use logging with fileconfig and logging with programmatic config. To demonstrate, I created two minimal examples. In the first example I'm configuring logging programmatically. This example works as expected - the debug log message is printed t...
I basically want to save the facebook ID of a given user so I can receive more material via Facebook. Ideally I want a solution that neither uses javascript nor cookie, just serverside but there was no example, just directions, so I've put together one we can discuss. Here's the code that I think works when I just link...
The (patched) kernel used in the Tolino Shine was made available (by accident) a few weeks ago. I mirrored the archive here: md5 size/mb file 90e78f2f7fdfffe460c85651cae431a3 109 kernel.tar.gz Extract the archive, export the path to the toolchain (if not done yet) and compile the kernel: >export PATH=$PATH:/home/devel/...
The simple idea of the app I am developing is user give the Linux commands and the result of Linux command will be shown in the webbrowser. Here's my views.py: from django.shortcuts import render_to_response from django.http import HttpResponseRedirect from django.template import RequestContext import subprocess global...
plasticgoat [Résolu] message d'erreur au lancement de synaptic Voilà le message d'erreur : W: Impossible de localiser la liste des paquets sources http://fr.archive.ubuntu.com breezy/universe Packages (/var/lib/apt/lists/fr.archive.ubuntu.com_ubuntu_dists_breezy_universe_binary-i386_Packages) - stat (2 Aucun fichier ou...
Chris__ Re : gReemote, télécommande + prog TV pour Freebox HD Hmmm l'upload du fichier deb a raté... Désolé :-) Cette fois il a réussi Hors ligne tocks Re : gReemote, télécommande + prog TV pour Freebox HD Pour la barre sa fonctionne très bien. Moi aussi en regardant, je ne trouve pas vraiment d'endroit pour rajouter c...
Posted by kevThu, 21 Jun 2007 16:41:00 GMT Spread the word on digg Powerset is fairly well-known in the Ruby community, but there’s a certain amount of confusion as to what we use it for. As a consequence, I’m regularly asked what the front end is going to be written in, and just as regularly have to leave the question...
I need to test performance of a multithreaded program on 1 CPU, but I have a dual CPU machine. I need to set affinity to those logical CPU's, that share their socket, oterwise they strongly benefit from larger number of FSB's. I tried affinity 0-7 and 8-15, but the results differ considerably, the first being faster. T...
Python-Powered Templates with Cheetah by Andrew Glover 01/13/2005 XML transformation via XSL Transformations (XSLT) is quite popular and indeed powerful. Well-constructed XSL can produce HTML, PDF, XML, and just about any other text format imaginable. XSLT, however, requires that the subject data be a well-structured X...
This is an extract from the code of a Quickly application I'm working on: # Code for other initialization actions should be added here. self.apachestart = self.builder.get_object("apachestart") self.label1 = self.builder.get_object("label1") def on_apachestart_clicked(self, widget): subprocess.call(['sudo', 'servic...
Will will need to have a working sensor node network comprising of a co-ordinator and at least one sensor node, so make sure you have followed the part 2 of this series! Additional things you will need: A Web Server: A Linux based PC/server with Apache, MySQL Server and Python installed. I'll be using my Beagleboard ru...
TO a similar problem here error: [Errno 10053] I also tried the same thing and got the same error. If there is a simple code like this to demonstrate this error: import socket host = 'localhost' port = 5001 size = 102400 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host,port)) for msg in ['Hello...
Here's a solution that uses a regexp to scan all occurrences of an uppercase letter followed by a number in brackets transforms the string pairs from the regexp with a generator expression into (value,key) tuples returns the key from the tuple that has the highest value I also added a main function so that the script c...
I have a network at home. ISP modem connects to my router which connects to my computers and laptops. When I look into my router logs I see a load of blocked access attempts. I was wondering if I can stop people from trying to access my wireless network. (My router does not have the ability to power down to decreased i...
ADcomp Re : ADesk Bar : Barre de lancement rapide [python/gtk/cairo] @sam7 : je suppose que tu parles de mon live "Madbox" .. comme je te l'ai dit sur l'autre post, il n'est pas prévu pour une installation "normale" et les paquet *-fr ne sont pas installés. Sinon , j'ai une mise à jour de mon live en cours ( plus conve...
I want to post a file to a server via python, for this I need to name this file as "xmlfile" so that server recognizes the input. import urllib2 url = "http://somedomain" to_send = open('test.xml').read() data = {} data['xmlfile'] = to_send f = urllib2.urlopen(url, data) This doesn't work, in addition, how can I retri...
I am running 32-bit Windows 7 and Python 2.7. I am trying to write a command line Python script that can run from CMD. I am trying to assign a value to sys.argv[1]. The aim of my script is to calculate the MD5 hash value of a file. This file will be inputted when the script is invoked in the command line and so, sys.ar...
Introduction to MapReduce with Hadoop on Linux MapReduce with Hadoop Hadoop is mostly a Java framework, but the magically awesome Streaming utility allows us to use programs written in other languages. The program must only obey certain conventions for standard input and output (which we've already done). You'll need J...
pango.FontsetSimple — a simple container for a set of fonts class pango.FontsetSimple(pango.Fontset): pango.FontsetSimple(language) def append(font) def size() This object is available in PyGTK 2.4 and above. A pango.FontsetSimpleis a subclass of pango.Fontsetthat provides a simple container for storing a ...
PotatoMasher Re : Script d'installation pour imprimantes Brother D'accord, alors j'ai retiré brscan2 de /etc/sane.d/dll.conf. brscan-skey -l donne toujours le même device, "Not Registered". Après avoir jeté un coup d'oeil aux groupes, je réalise que mon utilisateur n'est pas membre du groupe "scanner" et du groupe "san...
Introduction to MapReduce with Hadoop on Linux MapReduce with Hadoop Hadoop is mostly a Java framework, but the magically awesome Streaming utility allows us to use programs written in other languages. The program must only obey certain conventions for standard input and output (which we've already done). You'll need J...
Rather than trying to fsck the dos partition how about just zero'ing the parition table, create the partition table from new and re-format the DOS partition. Suppose the USB stick is on /dev/sdc, first make sure /dev/sdc1 is unmounted: umount /dev/sdc1 Then clear the partition table, say by copying a bunch of zeros ov...
I'm crazy green to WSGI on Google App Engine (GAE). How do I set the content type to JSON? This is what I have so far: class Instructions(webapp.RequestHandler): def get(self): response = {} response["message"] = "This is an instruction object" self.response.out.write(json.dumps(response)) a...
People like to find excuses to avoid writing tests for their code. Oneof the most common goes something like, "It's not feasible to test this,because it relies on external objects" - CGI code, code using theApache request object, TCP/IP servers, and so on. The Test::MockObject module makes it much easier to isolate cod...
Update I think he’s updated his table, and unsorted the results. No problem. :) I’ve been enjoying Peter Norvig’s article in which he explores ways of writing software to correct typos and spelling mistakes in English text. You can find it here. His general idea is to deliberately misspell a wrongly-spelled word in all...
Download the Code Sample In this month’s column, I present the design, a C# language implementation and testing techniques for a graph data structure that can be used to solve the maximum clique problem. The graph code can also be used for many other problems, as I’ll explain. So, just what is the maximum clique pr...
###### EDIT 10/14/2013:For information, ggplot has now been implemented for python (built on matplotlib). See this blog or go directly to the github page of the project for more information and examples. ###### To my knowledge, there is no built-in solution in matplotlib that will directly give to your figures a simila...
I have a bunch of drawing areas (they are actually cairo surfaces, but I don't think it matters too much) in a scrolled window, and I would like to refresh the drawings. However, when I redraw the images, they are not shown till I scroll the window up and down. After that the figures are correct, so I have to conclude ...
How I simulate requests from the python command line is: A simple way of simulating requests is: >>> from django.core.urlresolvers import reverse >>> import requests >>> r = requests.get(reverse('app.views.your_view')) >>> r.text (prints output) >>> r.status_code 200 Update: be sure to launch the django shell (via man...
I'm working on an iOS app. I have a UIViewController that uses auto layout. If I create the view controller in the app delegate and set it as the window's root view controller, the layout appears as expected. If, however, I make a navigation controller the root view controller when the app launches (the NavigationContr...
I am having trouble with the login function I implemented after deploying my app using Google App Engine. I think the login works on localhost though. This is the url to the app we deployed: nusrollinggo.appspot.com The problem is that when I clicked on login and chose the login method (I allow the user to login using ...
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. ...
You know, I've found (and I've tested this over and over) that try/except does not perform all that well, for whatever reason. I frequently try several ways of doing things, and I don't think I've ever found a method that uses try/except to perform the best of those tested, in fact it seems to me those methods have usu...
JavaScript macaela — 2011-07-05T10:38:07-04:00 — #1 hi i have the follow jwplayer i've got a link that loads the video into the player fine but now i am trying to add another one that load with the hd option here the single one works fine <a title="Testimonial One" href="#" onclick="loadNplay('http://www.1st4film.biz/h...
#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...
PPdM goolgle et Ubuntu 64bits Salut Je vous soumet un probleme recurent que je croyais du a ma config matérielle mais qui se manifeste sur un autre PC totalement différent. Les accès a google (tout les sites) sont très lent quand ce n'est pas impossible sur les config en 64 BIts, j'ai deux PC (un portable et un fixe) q...
Hey guys, I've got a model that has an id that isn't unique. Each model also has a date. I would like to return all results but only the most recent of each row that shares ids. The model looks something like this: class MyModel(models.Model): my_id = models.PositiveIntegerField() date = models.DateTimeField()...
Some explanation for the xml.etree.ElementTree for Python 2, and for its function parse(). The function takes the source as the first argument. Or it can be an open file object, or it can be a filename. The function creates the ElementTree instance, and then it passes the argument to the tree.parse(...) that looks like...