How to you check to see what JQuery plugins you have in your minified bundle?
Try something like this:
user# grep -E -o 'effects\.[a-z]+' jquery-ui-1.7.2.custom.min.js | sort | uniq
http://www.rockfloat.com/board/post/?id=612
December 12, 2009 @06:07
(Replies: 0)
How do you properly return the fqdn (domain.hostnname) using python?
You can get these from the socket module.
user# python
user# >>> import socket
user# >>> print socket.getfqdn(socket.gethostname())
It's important to note here, that hostname when called under unix should not return the full fqdn. If it does
[...]
http://www.rockfloat.com/board/post/?id=604
January 19, 2009 @21:43
(Replies: 0)
What are the mod_python apache code constants?
From /usr/lib/python2.3/site-packages/mod_python/apache.py
## Some constants
HTTP_CONTINUE = 100
HTTP_SWITCHING_PROTOCOLS = 101
HTTP_PROCESSING = 102
HTTP_OK = 200
H
[...]
http://www.rockfloat.com/board/post/?id=61
May 15, 2005 @01:21
(Replies: 0)
how do you install the Apple python class?
Try:
user# tar zxvf Apple-1.2.3.tar.gz
user# cd Apple-1.2.3
user# sudo python setup.py install
after doing this you can then use the Apple class from anywhere, here's a hello world to test with:
-----
#!/usr/bin/env python
import app
[...]
http://www.rockfloat.com/board/post/?id=90
November 16, 2003 @05:17
(Replies: 0)
How do you run test.py after installing mod_python via portage?
Here's what I use:
http://rockfloat.com/files/public/?d=/ebuilds/mod_python
user# sudo emerge -a mod_python
user# tar zxvf mod_python-3.2.5b.tgz
user# cd mod_python-3.2.5b
user# ./configure --with-apxs=/usr/sbin/apxs2
user# cp /usr/lib/apac
[...]
http://www.rockfloat.com/board/post/?id=497
November 15, 2005 @07:41
(Replies: 0)
Re: Graphs
I find the python module Matplotlib to be very good. Here is a quick tutorial on how to use it:
http://rockfloat.com/howto/python-matplotlib.html
Here's a snippet:
#! /usr/bin/env python
from matplotlib.matlab import *
t = arange(0.
[...]
http://www.rockfloat.com/board/post/?id=484
October 01, 2005 @18:16
(Replies: 0)
Graphs
hello
I am Adam in Mr. Deprato's computer class.
I was wondering
What would be the best way to create linear graphs in Python??
http://www.rockfloat.com/board/post/?id=482
October 01, 2005 @07:54
(Replies: 1)
How do you sort a list of dictionaries? Or sort a list based on the it's contents?
Try this:
a = []
a.append({'name':'chris 4', 'count':4})
a.append({'name':'chris 40', 'count':40})
a.append({'name':'chris3', 'count':3})
a.append({'name':'chris400', 'count':400})
from operator import itemgetter
result = sorted(a, key=i
[...]
http://www.rockfloat.com/board/post/?id=518
May 21, 2006 @00:13
(Replies: 0)
How do you test Python speed using timeit?
try something like this:
import timeit
timeit.Timer('a = [2, 5, 99, 5, 3, 4]; a.sort(); a.reverse()', 'gc.enable()').timeit()
John M.
http://www.rockfloat.com/board/post/?id=521
May 24, 2006 @03:38
(Replies: 0)
Re: Re: Looping
For example, we're working on a simple math game in class, and at the end of the game, we want to have a "play again" option. How would we command python to restart the game, although not discard the old game just played.
In other words, the game is
[...]
http://www.rockfloat.com/board/post/?id=489
October 05, 2005 @08:17
(Replies: 0)
Re: hello
Me too.
John M.
http://www.rockfloat.com/board/post/?id=36
October 03, 2005 @01:16
(Replies: 0)
Re: Global Variables
Very good question. I'm no expert, but I believe global variables should be avoided if possible. Python is very namespace centric, which makes it very clear where information is comming from. If you specify a variable to be global it makes it much e
[...]
http://www.rockfloat.com/board/post/?id=485
October 01, 2005 @18:20
(Replies: 0)
Re: Looping
Could you provide a more detailed example of what you're wanting to do?
John M.
http://www.rockfloat.com/board/post/?id=490
October 01, 2005 @18:17
(Replies: 1)
Empty subject
i like pie
http://www.rockfloat.com/board/post/?id=487
October 01, 2005 @08:28
(Replies: 1)
hello
hello this is aditya
http://www.rockfloat.com/board/post/?id=488
October 01, 2005 @07:53
(Replies: 0)
Looping
Does anyone know how to loop whole programs?
thnx...
http://www.rockfloat.com/board/post/?id=483
October 01, 2005 @07:51
(Replies: 1)
Global Variables
Are global variable good to use in Python or should they be avoided? I have heard different arguements on this topic.
TD
http://www.rockfloat.com/board/post/?id=486
October 01, 2005 @07:47
(Replies: 1)
Having problems with py2html and viewcvs where the python syntax and color formatting isn't working
You probably need an updated py2html.py and PyFontify.py
Place the above files from: http://openlook.org/distfiles/py2html-0.7.tar.gz
into: /var/www/localhost/viewcvs/lib
John M.
http://www.rockfloat.com/board/post/?id=43
June 15, 2005 @13:19
(Replies: 0)
Is there a dateAdd() function for python?
it sucks, but no.
try this:
<div class="code">
def dateAdd(strUnit, intDelta, objDate):
"""Return a date object x units from a given date:
Usage: functions.dateAdd('days', -5, datetime.datetime.now())
this would return a
[...]
http://www.rockfloat.com/board/post/?id=80
November 08, 2004 @21:50
(Replies: 0)
how to you configure python on freebsd to use tkinter?
very easy:
just install the py23-tkinter port:
/usr/ports/x11-toolkits/py-tkinter
then you can make and execute your hello world script:
#!/usr/bin/env python
from sys import exit
from Tkinter import *
root = Tk()
Button(root, te
[...]
http://www.rockfloat.com/board/post/?id=105
September 15, 2003 @01:52
(Replies: 0)