text
stringlengths
256
65.5k
Is it possible to use gradient as a background for generic GtkWidget? Related question: How to change GtkWidget background in GTK3? Sure you can! Gtk3 allows for theming using CSS. Here's a quick example I threw together in Python: #!/usr/bin/python3 from gi.repository import Gtk, Gdk button = Gtk.Button("Click Me") gr...
I am trying to programmatically create and bind a table of accelerators in wxPython in a loop so that I don't need to worry about getting and assigning new IDs to each accelerators (and with a view to inhaling the handler list from some external resource, rather than hard-coding them). I also pass in some arguments to ...
I've been able to get the recpatcha to show up properly and submit with my form that I want to put the captcha in front of but it validates no matter what you type into the recaptcha form. Here's my wtforms class: class MessageForm(Form): reason_code = SelectField(u'Reason', [validators.Required(message=(u'A reason f...
I'm having an issue where I have these "Pie Slices" and each one needs to be selectable BUT due to the nature of Qt it seems each on can only have a bounding rectangle. I'd need some kind of triangle. Using a rectangle would mean that each slice's rectangle would overlap with the other slices rectangles or each rectang...
I disagree with the key suggestion in the existing answers, which basically boils down to treating exceptions in Python as you would in, say, C++ or Java -- that's NOT the preferred style in Python, where often the good old idea that "it's better to ask forgiveness than permission" (attempt an operation and deal with t...
My function is: def searchstock(): dictionary=calcreturn(dictionize(tickers(openfile()),pairslist())) inp=raw_input("What is the stock ticker? ") while True: try: dictionary[inp] break except KeyError: print("Ticker not found. Please input again ") print(inp, dictionary[inp]) the try...
For: <foo> <bar key="value">text</bar></foo> How do I get "value"? xml.findtext("./bar[@key]") Throws an error. In [52]: import xml.etree.ElementTree as ET In [53]: xml=ET.fromstring(contents) In [54]: xml.find('./bar').attrib['key'] Out[54]: 'value' Your expression: It means: If you want to select the attribute, use...
This month we'll use NumPy and DISLIN to create, display, and manipulate a basic geometric image. At the heart of image manipulation are special matrices that can be used to create effects. You can use these effects separately or combine them for more complex operations. While the focus is on two-dimensional operations...
bidou10 mise à jour de sécurité importante bonjour à tous, depuis un petit moment, j'ai une mise à jour de sécurité importante qui ne veut pas se faire, elle apparait à chaque fois décochée. j'ai essayé cette commande dans le terminal, mais je ne suis pas très fort dans ce domaine et j'aimerai avoir un petit coup de ma...
bertrand47 [Résolu] Duplicate sources list J'ai depuis quelques jours une erreur "duplicate sources list", visiblement du à un doublon i386 et amd64. J'ai une installation amd64. W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages (/var/lib/apt/lists/security.ubuntu.c...
In my book, Practical Maya Programming with Python, I use Python’s type function for dynamically creating custom Maya nodes based on specifications, such as input and output attributes. I really love the type function*, so I thought I’d post another cool use of it. I recently wrote this gem as a way to dynamically crea...
jegougou Re : [Info] Installation du driver Libre ATI Radeon j'ai suivis ton conseil voila le resultat 4294 frames in 5.0 seconds = 858.715 FPS 4254 frames in 5.0 seconds = 850.774 FPS 4190 frames in 5.0 seconds = 837.903 FPS 3269 frames in 5.0 seconds = 653.660 FPS 4400 frames in 5.0 seconds = 879.915 FPS 4398 frames ...
lukophron [python]Monsieur Cinéscript Salut, Suite à une demande, j'ai pondu un script python pour mettre à jour la liste des films trouvés sur le topic-jeu Quel film c'est ? Ça tourne, ça remplit son objectif (et son deuxième objectif qui était de me remettre à apprendre Python ^^) Maintenant, il y aurait mieux. Je po...
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...
This is answered in a paper by Raab and Steger (they switch your $n$ and $m$). The case $n=m$ is simpler and had been known before (see their introduction). Intuitively, in order to find the "correct" answer, you calculate the expected number of bins $X_t$ which get at least $t$ balls; the value of $t$ such that $X_t \...
Numpy matrices are strictly 2-dimensional, while numpy arrays (ndarrays) areN-dimensional. Matrix objects are a subclass of ndarray, so they inherit allthe attributes and methods of ndarrays. The main advantage of numpy matrices is that they provide a convenient notationfor matrix multiplication: if a and b are matrice...
I'm working on a server / datacenter inventory management tool. I have a class to define a default "device", which is then used to express custom devices (linux servers, windows servers, routers, switches, etc.) I also have data models set up to express IP addresses within a network. My question is, what would be the b...
Emails and SMS Setting up email Web2py provides the gluon.tools.Mail class to make it easy to send emails using web2py. One can define a mailer with from gluon.tools import Mail mail = Mail() mail.settings.server = 'smtp.example.com:25' mail.settings.sender = 'you@example.com' mail.settings.login = 'username:password' ...
xbindkeys.. sudo apt-get install xbindkeys Xbindkeys is a very versatile program that lets you remap keys very easily. It uses a config file, my default located in your home directory, to change key bindings into certain commands. To create a default config file you use the command: xbindkeys --defaults Which prints t...
Im trying to create a zipfile with the content of a folder ( some dirs and files ) using the code belllow: import zip,os path = "c:\\tester\\folderToZip" zip = zipfile.ZipFile("zippedFolder.zip", "w") for root, dirs, files in os.walk(path): for file in files: zip.write(os.path.join(root, file)) zip.close() ...
There has got to be a better way to do this…. I’m using several multi sliders for a sequencer. I want to randomize the patterns. The only thing I can think of I pasted below. My solution is far from elegant, can anyone suggest anything else. If anyone has ideas on how to randomly alter the number of items in the list, ...
tiramiseb Re : Configuration MySQL 5.6 - Ubuntu 14.04 LTS - Houlala, là ce qu'il faut faire c'est essayer de revenir à une situation stable sans MySQL, histoire de partir sur des bases saines. Je ne saurais te dire précisément les commandes à effectuer, en tout cas ce sera à coups de "apt-get remove XYZ", "apt-get purg...
wlourf Postez vos scripts Lua pour Conky ! Bonsoir à tous ceux pour qui chaque pixel du bureau compte, J'ouvre ce topic suite aux discussions sur le topic des conky pour discuter des scripts Lua dans conky. Lua est un langage de script léger et facile a utiliser qui permet d'ajouter de nouvelles fonctionnalités à nos c...
I can parse a file that looks like: <a href="http://www.youtube.com/watch?v=DpQNMBzwShs"></a> but when I give it just: http://www.youtube.com/watch?v=DpQNMBzwShs It errors. How do I turn soup into a list skipping the # extract youtube video urls process entirely, which is what I think I need to do? # parse bookmarks....
mol1 Re : Hortus belli projet de tower defense (finissons le jeu d'helly) Un lien vers une esquisse de musique : http://ubuntuone.com/7RqEp9oXkT6K338qog5WlX Hors ligne Ypnose Re : Hortus belli projet de tower defense (finissons le jeu d'helly) La zike est pas mal. J'aiderai bien mais je suis pas bon codeur C, donc si v...
Softpanorama Contents Bulletin Scripting in shell and Perl Network troubleshooting History Humor Routing Recommended Links Default Route Linux Policy Routing Ethernet Protocol ethtool Static routing on Suse Static routing on Red Hat Humor Etc Static routing is the most simple and the most common way of configuring path...
henry-006 Re : [script] Pixup : Poster une image rapidement sur un forum ah désolé, moi ch'suis allé direct dans la logithèque, comme un bon bourrin, OS: Ubuntu 12.10 (Quetzal quantal ) 64 bits + Windows XP pro SP2 x32 en double boot PC Medion / Processeur: Intel core2 Duo (CPU 2.80GHz) Mémoire vive:3029 MiB Carte Grap...
Capybara Capybara helps you test web applications by simulating how a real user would interact with your app. It is agnostic about the driver running your tests and comes with Rack::Test and Selenium support built in. WebKit is supported through an external gem. Need help? Ask on the mailing list (please do not open an...
#0 Re : -1 » Gmediafinder : Youtube/dailymotion/vimeo.. sans flash et bien plus.... » Le 05/10/2012, à 12:32 waliby42 Réponses : 994 salut moi l installe s est bien passé mais quand je lance Gmediafinder il s ouvre mais dès que je choisis un clip sur youtube ou autre j ai un rapport d erreur gtk me demande de laisser f...
The Flask Mega-Tutorial, Part III: Web Forms The goal of the tutorial series is to develop a decently featured microblogging application that demonstrating total lack of originality I have decided to call microblog. Here is an index of all the articles in the series that have been published to date: Part I: Hello, Worl...
I am a python beginner and I am trying to average two NumPy 2D arrays with shape of (1024,1024). Doing it like this is quite fast: newImage = (image1 + image2) / 2 But now the images have a "mask" that invalidate certain elements if set to zero. That means if one of the elements is zero, the resulting element should al...
I am running Ubuntu 12.10 that has python 2.7 as its default. I have installed python 3.3 in /opt/python3.3 (using ./configure --prefix=/opt/python3.3). My problem is with the virtual environment. Created one in ~/python33 and activated it. Now after downloading, when I run distribute_setup.py within the venv, the inst...
I'm tasked with getting emails from a .csv file and using them to submit a form. I am using the csv and mechanize Python libraries to achieve this. import re import mechanize import csv def auto_email(email): br = mechanize.Browser() br.open("URL") br.select_form(name="vote_session") br['email_add'] = '...
This tutorial will show you how to communicate from your raspberry pi to your arduino using 3-wire SPI. Requirements 1 Raspberry pi (running Raspbian) 1 Arduino 4 wires Your raspberry pi should be running the newest version of Raspbian. To ensure your system is up-to-date please download and run rpi-update. Wiring Ardu...
Looks like you're missing a library file. The program apt-file can be used to find which package provides a certain file. (dpkg -S does this too, but does not work for packages which are not installed) apt-file search libXss.so yields: ia32-libs: /usr/lib32/libXss.so ia32-libs: /usr/lib32/libXss.so.1 ia32-libs: /usr/li...
You have a two basic choices: Treat handle_exceptions as a boolean, and re-raise if False Treat handle_exceptions as the exceptions to handle Along the boolean route you have two basic choices: def my_func(my_arg, handle_exceptions): try: do_something(my_arg) except Exception, e: if not handle_e...
henry-006 Re : [script] Pixup : Poster une image rapidement sur un forum ah désolé, moi ch'suis allé direct dans la logithèque, comme un bon bourrin, OS: Ubuntu 12.10 (Quetzal quantal ) 64 bits + Windows XP pro SP2 x32 en double boot PC Medion / Processeur: Intel core2 Duo (CPU 2.80GHz) Mémoire vive:3029 MiB Carte Grap...
Kedoc Re : script install wifi BCM94311MCG Petit point... Je me suis aperçu ce soir qu'il me suffit d'utiliser l'interrupteur matériel de ma carte pour l'éteindre et la rallumer, un coup au démarrage sous Ubuntu, et je peux ensuite l'utiliser (en wifi ouvert, et en WEP, ça fonctionne). Je n'ai pas encore bien compris, ...
Ramblings of a mad engineer MapReduce is one of those simple ideas that you look back on and say, well damn, I could have thought of that. MapReduce is a simple technology that allows programmers to write two simple functions, a mapper and a reducer, and have them scale to attack very large problems. I was recently nee...
This is the first thing I do after logging in: How can I make it happen automatically? To make the default Ubuntu IM application Empathy start automatically when you log in, the following instructions are from OMG Ubuntu: this script will automatically set status to "unavailable" when screen is locked or screensaver is...
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...
Dictionaries are pretty popular as well. Basically a hash table. {"one": 1, "two": 2} is an example, kind of looks like json. Then you can call it up like mydict["one"], which would return 1. Then you can use shelve to save the dictionary to a file: mydict = shelve.open(filename) # then you can call it from there, like...
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...
Table of Contents resolv.conf and nsswitch.conf Before we dive into configuring various aspects of network setup, we want to walk through the necessary bits that have to or can be present in the kernel. See Chapter 32, Compiling the kernel for more details on compiling the kernel, we will concentrate on the configurat...
The easiest way that I have found was to do something along the lines of: el = driver.find_element_by_id('id_of_select') for option in el.find_elements_by_tag_name('option'): if option.text == 'The Options I Am Looking For': option.click() # select() in earlier versions of webdriver break This may ...
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 made a few, different changes to settings.py AWS_S3_CUSTOM_DOMAIN = 'XXXXXXX.cloudfront.net' #important: no "http://" AWS_S3_SECURE_URLS = True #default, but must set to false if using an alias on cloudfront COMPRESS_STORAGE = 'example_app.storage.CachedS3BotoStorage' #from the docs (linked below) STATICFILES_STORAGE...
Here is a quick and dirty system monitor that I hacked together out of python: It uses the "System Monitor Indicator" (here) to call the script that I wrote.To use it: install indicator-sysmonitor. To do that, run the following command: sudo apt-add-repository ppa:alexeftimie/ppa && sudo apt-get update && sudo apt-get ...
I have a df in pdata.frame format from plm library : library(plm) head(df) : Company Year Kapitalinkomster Bank.o.kassa 3-1920 3 1920 1.388520 0.5520765 3-1921 3 1921 1.251319 0.6952595 3-1922 3 1922 1.001186 0.9812447 3-1923 3 1923 1.056346 1...
What is the best way to relaunch the application where it was running a listening TCP port? Problem is: if i quickly launch the application as relaunch it fails because the socket which was listening is already in use. How to safely relaunch in such case? socket.error: [Errno 98] Address already in use Code: #!/usr/bin...
When I run a python script in a terminal it runs as expected; downloads file and saves it in the desired spot. sudo python script.py I've added the python script to the root crontab, but then it runs as it is supposed to except it does not write the file. $ sudo crontab -l > * * * * * python /home/test/script.py >> /v...
If you slice a query in SQLAlchemy, it automatically limits the database result set fetched: limitedQuery = q[:50] If you were to get a count first, you can easily loop over chunked responses: count = q.count() for chunkstart in xrange(0, count, 50): CachedChunk += 1 chunkend = min(chunkstart + 50, count) ...
I could use a little help in AppEngine land... Using the [Python] API I create relationships like this example from the docs: class Author(db.Model): name = db.StringProperty() class Story(db.Model): author = db.ReferenceProperty(Author) story = db.get(story_key) author_name = story.author.name As I understand...
Lets say i have something like this: This is file tree.py: class leaf(): def green(): x = 100 This is file view.py: from tree import leaf.green g = green() print g.x How do i get the variable form subclass green I know for class its just: This is file tree.py: class leaf(): x = 100 This is file view.py: fro...
The following small python program uses the KDE APIs to retrieve the contents of an URL. Unfortunately, it segfaults. Am I doing anything wrong, or is this a bug in KDE? kio.py: #!/usr/bin/env python2 # coding: utf-8 from PyKDE4 import kdecore,kio url = kdecore.KUrl("http://www.google.com") print url kio.KIO.get(url) p...
Let's compare: from subprocess import check_output def wc(filename): return int(check_output(["wc", "-l", filename]).split()[0]) def native(filename): c = 0 with open(filename) as file: while True: chunk = file.read(10 ** 7) if chunk == "": return c ...
I'm trying to upload and parse json files using django. Everything works great up until the moment I need to parse the json. Then I get this error: No JSON object could be decoded: line 1 column 0 (char 0) Here's my code. (I'm following the instructions here, and overwriting the handle_uploaded_file method.) def handl...
tomtom Re : [HOW TO] adesklets : installation sous Ubuntu Breezy raaah ! j'ai un probleme d'interpreteur python ! J'ai installé toutes les librairies via synaptic et adesklets aussi. J'ai DL YAB (Yet Another Bar) et j'ai ca : [i]tomtom@barad-luin:/mnt/config/programmes/adesklets/yab-0.0.2$ [/i][b]ls -l[/b] total 56 -rw...
Here's the code @app.route('/account/<user_id>', methods = ["GET", "POST"]) @login_required def user(user_id): user = User.query.filter_by(id = user_id).first() ... return render_template('template.html') If someone manually enters htp://localhost/user/aaa for example, it throws an error. How can I check that the...
I'm trying to test using a TimedRotatingFileHandler with a logging.config file, nothing that complicated but it should roll over every 10 seconds into a new log file. However I'm getting the following Traceback (most recent call last): File "testLogging.py", line 6, in <module> logging.config.fileConfig(logDir+'l...
LOG: ==== Jul 5 10:03:22 SWH-iRed-1 amavis[1853]: (01853-01) Passed CLEAN, <websupport@atlantic.net> -> <mailman-subscribe@lists.sensusplenoir.com>, Message-ID: <51d6e01b.TLq2r6xMGZdBrWGe%websupport@atlantic.net>, mail_id: ox3SqxCSbfs5, Hits: 0.011, size: 316845, queued_as: C974940D08, 30507 ms Jul 5 10:03:23 SWH-iRed-...
bibichouchou TVDownloader: télécharger les médias du net ! [2] A k3c j'ai fait les mêmes constats quand à l'utilisation du script de KSV. le flux rtmp était bien utile car les séries n'étaient pas chiffrées. avec la version fragmentée, ce n'est pas le cas ci-dessous une version corrigée de ton script pour tf1 et compag...
In Python I want to tranform the integer 3892 into a hexcode with the given format and the result \x00\x00\x0F\x34. How can this be achieved? You are converting to a binary representation of the number, not so much a hex representation (although Python will display the bytes as hex). Use the Demonstration: >>> struct.p...
yann458 paquet computertemp ou autre Bonjour, J'ai monté une machine AMD , et étant donnée que les processeur AMD chauffe plus , je cherche un utilitaire aqéquat qui avertit d'une boite de dialogue si le processeur est en surchauffe. L'utilitaire computertemp joue un son si le processeur est en surchauffe , et je prefe...
The Python language About Python Python is a general-purpose high-level programming language. Its design philosophy emphasizes programmer productivity and code readability. It has a minimalist core syntax with very few basic commands and simple semantics, but it also has a large and comprehensive standard library, incl...
I have python 2.7 installed and I'm facing errors while trying to run scripts in Python. The GUI based Launchpad app Ground Control can't start and is facing bugs. But even a simple program can't run: from urllib import urlencode from urllib2 import urlopen pg = urlopen("http://www.beans-r-us.biz/proces.html") text = p...
CSS scott1964 — 2013-11-18T10:37:06-05:00 — #1 Greetings ... I am developing a site that uses a wordpress theme ... the customer wants it customized to include two login panels for Attorneys and Reporters at the very top of the screen. I've altered the index file to include the correct markup, but for some reason, the ...
I am thinking that there might be two ways to do this? I don't have photoshop so...Maybe I'll try python. Hopefully you used a tripod, a remote, and continuous shooting. I could see variable and long times between images very problematic. I have never done this, just thinking out loud. I'll have to take a time series a...
Here is what I do. I have a MigratingModel class, which all of my models inherit from. Here is migrating_model.py: """Models which know how to migrate themselves""" import logging from google.appengine.ext import db from google.appengine.api import memcache class MigrationError(Exception): """Error migrating""" class...
So, I have the latest Selenium 2.0 Python bindings installed via pip (Python 2.7.2, Windows 7). I wrote a small script to see if I could get it working: from selenium import webdriver driver = webdriver.Firefox() driver.get("http://www.google.com") driver.close() This will run, and open the command line. Then, a blank...
I'm trying to install java jre, i usually do it like this sudo echo 'deb http://www.duinsoft.nl/pkg debs all' >> /etc/apt/sources.list sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 5CB26B26 sudo apt-get update sudo apt-get install update-sun-jre exit but when i do sudo echo 'deb http://www.duinsoft.nl/pkg de...
I was eventually going to add another computer and more options to this (i.e., Rock-paper-scissors-lizard-Spock) but I wanted to make sure I was using the best practice for this type of game. Any help would be appreciated. # The traditional paper scissors rock game import os def clear(): os.system("clear") clear() ...
Emails and SMS Setting up email Web2py provides the gluon.tools.Mail class to make it easy to send emails using web2py. One can define a mailer with from gluon.tools import Mail mail = Mail() mail.settings.server = 'smtp.example.com:25' mail.settings.sender = 'you@example.com' mail.settings.login = 'username:password' ...
Good day, not so long ago, working with Django. Encountered the following problem. There are two models class Product(models.Model): productID = models.AutoField(primary_key=True) brandID = models.ForeignKey(Brand, verbose_name=u'Бренд') categoryID = models.ForeignKey(Category, verbo...
I am migrating from Ubuntu 10.04 to Ubuntu 11.10 (oneiric), but I have probrems when I try compile some applications that works fine on Ubuntu 10.04 no changes. I installed the sqlite3 and unac libraries, the same that I use on Ubuntu 10.4. I've installed using the followings commands: sudo su apt-get install libunac1-...
Another key point is that the mouse messages all report the position in "Screen Coordinates" (i.e., relative to the top-left corner of the screen) rather than in "Client Coordinates" (i.e., relative to the top-left corner of our window). You use a member function PyCWnd.ScreenToClient() to transform these coordinates. ...
This is related to my another post multithreading problem with wx.TextCtrl (or underlying GTK+), which after correction with calling GUI interactions from primary thread, I find it again comes to the pipe block buffering problem. so How to get spontaneous output from the subprocess.stdout? To be in short, currently I a...
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 ...
Simulating complex real-world systems is now possible with SimPy , an open source simulation package. SimPy, originally developed by the authors of this article, has been developed to production quality by a small team of enthusiastic open sourcerers around the world. As far as we know, it is the only existing discrete...
Is there a list somewhere of recommendations of different Python-based REST frameworks for use on the serverside to write your own RESTful APIs? Preferably with pros and cons. Please feel free to add recommendations here. :) Something to be careful about when designing a RESTful API is the conflation of GET and POST, a...
Django and everything are running on a server. When a user from his/her local machine accesses the application, I need to save the IPV4 and IPV6 from this local machine into a form. This is the view I'm using to save data: def t031003form_save(request): form = T031003Form(request.POST or None, request.FILES or None...
FQL turns into a snail or timeouts for any subquery greater than two. Also I am not even sure distinct page_ids are selected (each user likes the same page how is it filtered?). So when you do the set operation, it most likely wouldn't work. Just do two queries. One that gets your list of page_ids like by friends "SELE...
#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...
I create an image with PIL: I need to fill in the empty space (depicted as black). I could easily fill it with a static color, but what I'd like to do is fill the pixels in with nearby colors. For example, the first pixel after the border might be a Gaussian blur of the filled-in pixels. Or perhaps a push-pull type alg...
The previous advice is nice and reasonable, especially in an ideal world where third-party software is bug free and everything is configured correctly. Unfortunately, the real world is a bit different. For instance, you must be aware that your application doesn't work on some buggy browser, or that it cannot work in sp...
I'm working with a nested dictionary structure of 4 levels, I'm trying to iterate of the entire nested dictionary and give each individual dictionary an identification number(as a precursor to building a tree of the items and being able tell which item node is parent, which children a node has etc.) I have this functio...
Myspace Hack, How To Hack MySpace accounts, How To Hack MySpace Private Profile Updated: You Might also Want To Read, Myspace Hack : Profile And MySpace Email Myspace has become ridiculously easy to hack. I try my best to keep this blog updates with the latest hacks/codes that I find over the internet. These days even ...
While working at StudyRoom, the social learning network for online students, I recently faced a very difficult-to-debug problem that ended up being caused by a race condition between different parts of a distributed system. In this article I'll take you through the steps I used to isolate, debug, and ultimately solve t...
I ran into an error that was painful to track down, so I thought I'd add the cause + "solution" here. The setup: Devbox - Running Google App Engine listening on all ports ("--address=0.0.0.0") serving a URL that launches a task. Client - Client (Python requests library) which queries the callback URL App Engine code: c...
Question In Django, how can create a single cached version of a page (same for all users) that's only visible to authenticated users? Setup The pages I wish to cache are only available to authenticated users (they use @login_required on the view). These pages are the same for all authenticated users (e.g. no need to se...
The admin history is just an app like any other Django app, with the exception being special placement on the admin site. The model is in django.contrib.admin.models.LogEntry. When a user makes a change, add to the log like this (stolen shamelessly from contrib/admin/options.py: from django.contrib.admin.models import ...
So far, we have a selectable list containing two items each (title and description). Wecan go through it with up and down key arrows, and select one of them with the enterkey. We use urwid.Frame witch give us an useful layout divided in threeparts, header, body and footer. In the last post, we used the header todisplay...
Correo electrónico y SMS Configuración de email Web2py incluye la clase gluon.tools.Mail que hace más fácil el envío de correo electrónico usando web2py. Uno puede definir un servicio de envío de correo con from gluon.tools import Mail mail = Mail() mail.settings.server = 'smtp.example.com:25' mail.settings.sender = 't...
See answers below this for a better solution. Since I wrote this, a lot has changed. There are now better ways to disable CSRF. I feel your pain. It's not acceptable for a framework to change such fundamental functionality. Even if I want to start using this from now on, I have legacy sites on the same machine sharing ...
I'm trying to build a basic GUI using ttk / Tkinter. I have a plotted out a basic GUI that has the right basic components, but when I try and prettify it / space it out, I'm reach my limit of getting ttk containers to play nicely... Examples: from Tkinter import * import ttk class MakeGUI(object): def __init__(self...
I am trying to use rpy2 to let me use some r functionality in python. Here is a simple regression I want to do. I create a data frame, convert it to R data frame and then try using R's lm. But the R data frame cannot be found (see below). Where should I look to troubleshoot? FYI I am using python 2.7.3, rpy2-2.3.2, pan...
Deploying web.py on IIS7 via PyISAPIe This guide is an account of the various steps, including snippets of relevant code that tweaked and added, in order to get a web.py script to work on IIS7 using PyISAPIe. Please note that you must have Python as well as the PyWin32 extensions installed on Windows. This guide was te...
I am learning Python at the moment, and I come from a Java/C++ and C background. I usually like to "examine" the "objects" in debuggers to get a better understanding of what is going on, so excuse my question if it seems odd for python. I was reading the urllib2 documentation at Python's website. The following example ...
class Profile(db.Model): user = db.UserProperty() class Playlist(db.Model): name = db.StringProperty() profile = db.ReferenceProperty(Profile, collection_name='playlists') videos_num = db.IntegerProperty(default=0) This are the basic entities of my model. I can access the playlists like profile.playlis...
I'm having trouble understanding why an inner loop in my method isn't producing the desired behavior I'm expecting and I'm hoping someone can help me understand the problem. My method takes a series of arguments (*args) and if the argument is an integer I want to add dollar signs around the integer (eg. $5$). def t_row...